@swarm-tips/client 0.4.2 → 0.4.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/README.md +3 -2
- package/SBOM.spdx.json +5 -5
- package/dist/agent.d.ts +17 -1
- package/dist/agent.js +71 -54
- package/dist/cli/swarm.d.ts +5 -0
- package/dist/cli/swarm.js +48 -21
- package/dist/contracts/generated/coordination_game.d.ts +179 -1
- package/dist/contracts/generated/shillbot.d.ts +119 -12
- package/dist/contracts/idl/coordination_game.json +180 -2
- package/dist/contracts/idl/shillbot.json +119 -12
- package/dist/generated/openapi.d.ts +17 -2
- package/dist/generated/openapi.js +1 -1
- package/dist/http.js +1 -1
- package/dist/inbox/client.d.ts +2 -4
- package/dist/inbox/client.js +11 -6
- package/dist/inbox/index.d.ts +1 -1
- package/dist/inbox/index.js +1 -1
- package/dist/inbox/types.d.ts +9 -0
- package/dist/inbox/types.js +10 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.js +4 -2
- package/dist/shillbot/api.d.ts +8 -1
- package/dist/shillbot/api.js +53 -133
- package/dist/shillbot/index.d.ts +1 -0
- package/dist/shillbot/index.js +3 -0
- package/dist/shillbot/verify-tx.d.ts +62 -0
- package/dist/shillbot/verify-tx.js +643 -0
- package/dist/signer/evm.d.ts +1 -1
- package/dist/signer/evm.js +72 -2
- package/dist/signer/index.d.ts +1 -1
- package/dist/signer/solana.d.ts +3 -2
- package/dist/signer/solana.js +36 -9
- package/dist/signer/types.d.ts +4 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/vow/index.d.ts +1 -1
- package/dist/vow/index.js +1 -1
- package/dist/vow/verify.d.ts +36 -0
- package/dist/vow/verify.js +458 -1
- package/package.json +1 -1
|
@@ -1469,6 +1469,59 @@
|
|
|
1469
1469
|
],
|
|
1470
1470
|
"args": []
|
|
1471
1471
|
},
|
|
1472
|
+
{
|
|
1473
|
+
"name": "set_devnet_enabled",
|
|
1474
|
+
"discriminator": [
|
|
1475
|
+
186,
|
|
1476
|
+
145,
|
|
1477
|
+
8,
|
|
1478
|
+
221,
|
|
1479
|
+
180,
|
|
1480
|
+
97,
|
|
1481
|
+
214,
|
|
1482
|
+
209
|
|
1483
|
+
],
|
|
1484
|
+
"accounts": [
|
|
1485
|
+
{
|
|
1486
|
+
"name": "global_state",
|
|
1487
|
+
"writable": true,
|
|
1488
|
+
"pda": {
|
|
1489
|
+
"seeds": [
|
|
1490
|
+
{
|
|
1491
|
+
"kind": "const",
|
|
1492
|
+
"value": [
|
|
1493
|
+
115,
|
|
1494
|
+
104,
|
|
1495
|
+
105,
|
|
1496
|
+
108,
|
|
1497
|
+
108,
|
|
1498
|
+
98,
|
|
1499
|
+
111,
|
|
1500
|
+
116,
|
|
1501
|
+
95,
|
|
1502
|
+
103,
|
|
1503
|
+
108,
|
|
1504
|
+
111,
|
|
1505
|
+
98,
|
|
1506
|
+
97,
|
|
1507
|
+
108
|
|
1508
|
+
]
|
|
1509
|
+
}
|
|
1510
|
+
]
|
|
1511
|
+
}
|
|
1512
|
+
},
|
|
1513
|
+
{
|
|
1514
|
+
"name": "authority",
|
|
1515
|
+
"signer": true
|
|
1516
|
+
}
|
|
1517
|
+
],
|
|
1518
|
+
"args": [
|
|
1519
|
+
{
|
|
1520
|
+
"name": "enabled",
|
|
1521
|
+
"type": "bool"
|
|
1522
|
+
}
|
|
1523
|
+
]
|
|
1524
|
+
},
|
|
1472
1525
|
{
|
|
1473
1526
|
"name": "set_payout_to",
|
|
1474
1527
|
"docs": [
|
|
@@ -2375,6 +2428,19 @@
|
|
|
2375
2428
|
105
|
|
2376
2429
|
]
|
|
2377
2430
|
},
|
|
2431
|
+
{
|
|
2432
|
+
"name": "DevnetEnabledUpdated",
|
|
2433
|
+
"discriminator": [
|
|
2434
|
+
134,
|
|
2435
|
+
199,
|
|
2436
|
+
123,
|
|
2437
|
+
224,
|
|
2438
|
+
220,
|
|
2439
|
+
73,
|
|
2440
|
+
89,
|
|
2441
|
+
126
|
|
2442
|
+
]
|
|
2443
|
+
},
|
|
2378
2444
|
{
|
|
2379
2445
|
"name": "EmergencyReturn",
|
|
2380
2446
|
"discriminator": [
|
|
@@ -2905,6 +2971,31 @@
|
|
|
2905
2971
|
"code": 6058,
|
|
2906
2972
|
"name": "InvalidInstructionBundle",
|
|
2907
2973
|
"msg": "OnChainAction claim must be bundled atomically at top-level with submit_work"
|
|
2974
|
+
},
|
|
2975
|
+
{
|
|
2976
|
+
"code": 6059,
|
|
2977
|
+
"name": "DevnetOnly",
|
|
2978
|
+
"msg": "Instruction or verification mode is restricted to devnet"
|
|
2979
|
+
},
|
|
2980
|
+
{
|
|
2981
|
+
"code": 6060,
|
|
2982
|
+
"name": "BelowMinimumEscrow",
|
|
2983
|
+
"msg": "Escrow amount is below the minimum required for this platform"
|
|
2984
|
+
},
|
|
2985
|
+
{
|
|
2986
|
+
"code": 6061,
|
|
2987
|
+
"name": "DeadlineTooFarInFuture",
|
|
2988
|
+
"msg": "Task deadline exceeds maximum allowed horizon"
|
|
2989
|
+
},
|
|
2990
|
+
{
|
|
2991
|
+
"code": 6062,
|
|
2992
|
+
"name": "VerificationTimeoutExceeded",
|
|
2993
|
+
"msg": "Verification timeout window has elapsed since submission"
|
|
2994
|
+
},
|
|
2995
|
+
{
|
|
2996
|
+
"code": 6063,
|
|
2997
|
+
"name": "StrikeCooldownActive",
|
|
2998
|
+
"msg": "Agent is in cooldown after a score-0 reopened submission"
|
|
2908
2999
|
}
|
|
2909
3000
|
],
|
|
2910
3001
|
"types": [
|
|
@@ -3000,17 +3091,13 @@
|
|
|
3000
3091
|
"type": "u64"
|
|
3001
3092
|
},
|
|
3002
3093
|
{
|
|
3003
|
-
"name": "
|
|
3094
|
+
"name": "last_strike_at",
|
|
3004
3095
|
"docs": [
|
|
3005
|
-
"
|
|
3006
|
-
"
|
|
3096
|
+
"Unix timestamp of the most recent score-0 reopened submission for this",
|
|
3097
|
+
"agent (`0` = none). Carved from the 8-byte `_reserved` slot so",
|
|
3098
|
+
"`AgentState::SPACE` stays `90` and existing accounts read `0`."
|
|
3007
3099
|
],
|
|
3008
|
-
"type":
|
|
3009
|
-
"array": [
|
|
3010
|
-
"u8",
|
|
3011
|
-
8
|
|
3012
|
-
]
|
|
3013
|
-
}
|
|
3100
|
+
"type": "i64"
|
|
3014
3101
|
},
|
|
3015
3102
|
{
|
|
3016
3103
|
"name": "bump",
|
|
@@ -3229,6 +3316,18 @@
|
|
|
3229
3316
|
]
|
|
3230
3317
|
}
|
|
3231
3318
|
},
|
|
3319
|
+
{
|
|
3320
|
+
"name": "DevnetEnabledUpdated",
|
|
3321
|
+
"type": {
|
|
3322
|
+
"kind": "struct",
|
|
3323
|
+
"fields": [
|
|
3324
|
+
{
|
|
3325
|
+
"name": "devnet_enabled",
|
|
3326
|
+
"type": "bool"
|
|
3327
|
+
}
|
|
3328
|
+
]
|
|
3329
|
+
}
|
|
3330
|
+
},
|
|
3232
3331
|
{
|
|
3233
3332
|
"name": "EmergencyReturn",
|
|
3234
3333
|
"type": {
|
|
@@ -3430,17 +3529,25 @@
|
|
|
3430
3529
|
],
|
|
3431
3530
|
"type": "i64"
|
|
3432
3531
|
},
|
|
3532
|
+
{
|
|
3533
|
+
"name": "devnet_enabled",
|
|
3534
|
+
"docs": [
|
|
3535
|
+
"Whether devnet-only verification paths (`verify_task` and kind-0",
|
|
3536
|
+
"`OnChainAction`) are enabled. Carved from `_reserved` — existing",
|
|
3537
|
+
"zero-initialized mainnet accounts read `false` without migration."
|
|
3538
|
+
],
|
|
3539
|
+
"type": "bool"
|
|
3540
|
+
},
|
|
3433
3541
|
{
|
|
3434
3542
|
"name": "_reserved",
|
|
3435
3543
|
"docs": [
|
|
3436
3544
|
"Reserved space for future fields without reallocation.",
|
|
3437
|
-
"32 → 12 by D2/D3 → 4 by
|
|
3438
|
-
"`dispute_resolution_window_seconds` carve."
|
|
3545
|
+
"32 → 12 by D2/D3 → 4 by dispute-window carve → 3 by `devnet_enabled`."
|
|
3439
3546
|
],
|
|
3440
3547
|
"type": {
|
|
3441
3548
|
"array": [
|
|
3442
3549
|
"u8",
|
|
3443
|
-
|
|
3550
|
+
3
|
|
3444
3551
|
]
|
|
3445
3552
|
}
|
|
3446
3553
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const OPENAPI_VERSION: "0.
|
|
1
|
+
export declare const OPENAPI_VERSION: "0.4.4";
|
|
2
2
|
export declare const OPENAPI_SERVERS: readonly ["https://mcp.swarm.tips", "https://api.shillbot.org", "https://api.coordination.game"];
|
|
3
3
|
export type OpenApiServerUrl = (typeof OPENAPI_SERVERS)[number];
|
|
4
4
|
export interface OpenApiSchemas {
|
|
@@ -113,6 +113,7 @@ export interface OpenApiSchemas {
|
|
|
113
113
|
created_at: string;
|
|
114
114
|
experiment_cohort: string;
|
|
115
115
|
lean_policy?: number | null;
|
|
116
|
+
onchain_action_spec?: Record<string, unknown> | null;
|
|
116
117
|
policy_id?: string | null;
|
|
117
118
|
spent_lamports: number;
|
|
118
119
|
status: OpenApiSchemas["CampaignStatus"];
|
|
@@ -167,6 +168,7 @@ export interface OpenApiSchemas {
|
|
|
167
168
|
daily_cap_lamports?: number | null;
|
|
168
169
|
experiment_cohort?: string | null;
|
|
169
170
|
lean_policy?: number | null;
|
|
171
|
+
onchain_action?: Record<string, unknown> | null;
|
|
170
172
|
platform?: number;
|
|
171
173
|
requires_approval?: boolean;
|
|
172
174
|
statement_lean?: string | null;
|
|
@@ -208,6 +210,7 @@ export interface OpenApiSchemas {
|
|
|
208
210
|
};
|
|
209
211
|
EvmStakedRequest: {
|
|
210
212
|
game_id: string;
|
|
213
|
+
wallet?: string | null;
|
|
211
214
|
};
|
|
212
215
|
ExperimentParams: {
|
|
213
216
|
cohort_name?: string;
|
|
@@ -306,6 +309,12 @@ export interface OpenApiSchemas {
|
|
|
306
309
|
NetworkQuery: {
|
|
307
310
|
network?: string | null;
|
|
308
311
|
};
|
|
312
|
+
OnChainActionInstructions: {
|
|
313
|
+
atomic_claim_and_submit: boolean;
|
|
314
|
+
content_id_format: string;
|
|
315
|
+
guidance: string;
|
|
316
|
+
status: string;
|
|
317
|
+
};
|
|
309
318
|
OnboardResponse: {
|
|
310
319
|
message: string;
|
|
311
320
|
signature: string;
|
|
@@ -323,12 +332,15 @@ export interface OpenApiSchemas {
|
|
|
323
332
|
wins: number;
|
|
324
333
|
};
|
|
325
334
|
PreflightTaskRequest: {
|
|
326
|
-
|
|
335
|
+
agent_wallet?: string | null;
|
|
336
|
+
content_id?: string | null;
|
|
337
|
+
proof_lean?: string;
|
|
327
338
|
};
|
|
328
339
|
PreflightTaskResponse: {
|
|
329
340
|
detail: string;
|
|
330
341
|
lean_policy: number;
|
|
331
342
|
ok: boolean;
|
|
343
|
+
status?: string | null;
|
|
332
344
|
task_id: string;
|
|
333
345
|
};
|
|
334
346
|
QueueRequest: {
|
|
@@ -475,6 +487,8 @@ export interface OpenApiSchemas {
|
|
|
475
487
|
gameplay_instructions?: null | OpenApiSchemas["GamePlayInstructions"];
|
|
476
488
|
lean_policy?: number | null;
|
|
477
489
|
lean_proof_instructions?: null | OpenApiSchemas["LeanProofInstructions"];
|
|
490
|
+
onchain_action_instructions?: null | OpenApiSchemas["OnChainActionInstructions"];
|
|
491
|
+
onchain_action_spec?: Record<string, unknown> | null;
|
|
478
492
|
payment_amount?: number | null;
|
|
479
493
|
platform: number;
|
|
480
494
|
quality_threshold: number;
|
|
@@ -487,6 +501,7 @@ export interface OpenApiSchemas {
|
|
|
487
501
|
task_id: string;
|
|
488
502
|
task_nonce?: string | null;
|
|
489
503
|
task_pda?: string | null;
|
|
504
|
+
trust_level?: string | null;
|
|
490
505
|
website_instructions?: null | OpenApiSchemas["WebsiteInstructions"];
|
|
491
506
|
};
|
|
492
507
|
TaskState: "open" | "claimed" | "submitted" | "approved" | "verified" | "finalized" | "disputed" | "resolved" | "expired";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// AUTO-GENERATED by scripts/sync-generated.mjs from services/mcp-server/openapi.merged.json.
|
|
2
2
|
// Do not edit by hand — run `pnpm --filter @swarm-tips/client sync:generated`.
|
|
3
|
-
export const OPENAPI_VERSION = "0.
|
|
3
|
+
export const OPENAPI_VERSION = "0.4.4";
|
|
4
4
|
export const OPENAPI_SERVERS = [
|
|
5
5
|
"https://mcp.swarm.tips",
|
|
6
6
|
"https://api.shillbot.org",
|
package/dist/http.js
CHANGED
|
@@ -29,7 +29,7 @@ export class HttpClient {
|
|
|
29
29
|
}
|
|
30
30
|
async request(path, init = {}) {
|
|
31
31
|
const operation = `${init.method ?? "GET"} ${path}`;
|
|
32
|
-
const token = init.token
|
|
32
|
+
const token = init.token !== undefined ? init.token : await this.getToken?.();
|
|
33
33
|
const { token: _token, _retried, ...fetchInit } = init;
|
|
34
34
|
const headers = {
|
|
35
35
|
...fetchInit.headers,
|
package/dist/inbox/client.d.ts
CHANGED
|
@@ -158,9 +158,8 @@ export interface ReportReceipt {
|
|
|
158
158
|
hidden: boolean;
|
|
159
159
|
already_reported: boolean;
|
|
160
160
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
export type TopicId = "open-challenge" | "subcontract";
|
|
161
|
+
import { VALID_TOPICS, isValidTopicId, type TopicId } from "./types.js";
|
|
162
|
+
export { VALID_TOPICS, isValidTopicId, type TopicId };
|
|
164
163
|
export interface SendReceipt {
|
|
165
164
|
msg_id: string;
|
|
166
165
|
thread_id: string;
|
|
@@ -281,4 +280,3 @@ export declare class InboxClient {
|
|
|
281
280
|
private readCachedSession;
|
|
282
281
|
private writeCachedSession;
|
|
283
282
|
}
|
|
284
|
-
export {};
|
package/dist/inbox/client.js
CHANGED
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
* bs58(ed25519 detached over the nonce UTF-8 bytes) — use `solanaNonceSigner`
|
|
25
25
|
* from this package; EVM = the `personal_sign` hex string as-is.
|
|
26
26
|
*/
|
|
27
|
+
import { VALID_TOPICS, isValidTopicId } from "./types.js";
|
|
28
|
+
export { VALID_TOPICS, isValidTopicId };
|
|
27
29
|
/** Non-2xx responses and client-side boundary rejections. `status` is the
|
|
28
30
|
* HTTP status, or 0 for errors raised before any request was made. */
|
|
29
31
|
export class InboxApiError extends Error {
|
|
@@ -233,8 +235,9 @@ export class InboxClient {
|
|
|
233
235
|
* needed. `minTrust` drops posts whose author trust is below it
|
|
234
236
|
* server-side. Hidden (auto-moderated) posts are always dropped. */
|
|
235
237
|
async readTopic(topicId, opts = {}) {
|
|
236
|
-
if (!topicId)
|
|
237
|
-
throw new InboxApiError(0,
|
|
238
|
+
if (!isValidTopicId(topicId)) {
|
|
239
|
+
throw new InboxApiError(0, `topicId must be one of ${VALID_TOPICS.join(", ")}`);
|
|
240
|
+
}
|
|
238
241
|
const params = new URLSearchParams({ topic_id: topicId });
|
|
239
242
|
if (opts.cursor)
|
|
240
243
|
params.set("cursor", opts.cursor);
|
|
@@ -261,8 +264,9 @@ export class InboxClient {
|
|
|
261
264
|
* inbox send). Rejects empty / oversize bodies client-side; quota
|
|
262
265
|
* rejections surface as InboxApiError with the server's message. */
|
|
263
266
|
async publishPost(topicId, body, opts = {}) {
|
|
264
|
-
if (!topicId)
|
|
265
|
-
throw new InboxApiError(0,
|
|
267
|
+
if (!isValidTopicId(topicId)) {
|
|
268
|
+
throw new InboxApiError(0, `topicId must be one of ${VALID_TOPICS.join(", ")}`);
|
|
269
|
+
}
|
|
266
270
|
const bytes = new TextEncoder().encode(body).length;
|
|
267
271
|
if (bytes === 0 || bytes > MAX_BODY_BYTES) {
|
|
268
272
|
throw new InboxApiError(0, `body must be 1..${MAX_BODY_BYTES} bytes (got ${bytes})`);
|
|
@@ -282,8 +286,9 @@ export class InboxClient {
|
|
|
282
286
|
/** Report a post for moderation. Session-gated. Idempotent per reporter —
|
|
283
287
|
* a repeat report returns `already_reported: true`. */
|
|
284
288
|
async reportPost(topicId, postId, reason) {
|
|
285
|
-
if (!topicId)
|
|
286
|
-
throw new InboxApiError(0,
|
|
289
|
+
if (!isValidTopicId(topicId)) {
|
|
290
|
+
throw new InboxApiError(0, `topicId must be one of ${VALID_TOPICS.join(", ")}`);
|
|
291
|
+
}
|
|
287
292
|
if (!postId)
|
|
288
293
|
throw new InboxApiError(0, "postId is required");
|
|
289
294
|
const payload = {
|
package/dist/inbox/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { InboxClient, InboxApiError, type InboxClientOpts, type InboxMessage, type MessageReference, type MessageEnvelope, type InboxListOptions, type InboxListPage, type OpenMessageResult, type OpenedMessage, type AckMessageResult, type InboxSession, type MessagePage, type NonceSigner, type SendReceipt, type MuteReceipt, type TopicId, type TopicPost, type TopicPage, type PublishReceipt, type ReportReceipt, } from "./client.js";
|
|
1
|
+
export { InboxClient, InboxApiError, type InboxClientOpts, type InboxMessage, type MessageReference, type MessageEnvelope, type InboxListOptions, type InboxListPage, type OpenMessageResult, type OpenedMessage, type AckMessageResult, type InboxSession, type MessagePage, type NonceSigner, type SendReceipt, type MuteReceipt, VALID_TOPICS, isValidTopicId, type TopicId, type TopicPost, type TopicPage, type PublishReceipt, type ReportReceipt, } from "./client.js";
|
|
2
2
|
export { solanaNonceSigner } from "./solana.js";
|
package/dist/inbox/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
// Shared browser client for the agent-inbox REST twins
|
|
2
2
|
// (mcp.swarm.tips /internal/inbox/*).
|
|
3
|
-
export { InboxClient, InboxApiError, } from "./client.js";
|
|
3
|
+
export { InboxClient, InboxApiError, VALID_TOPICS, isValidTopicId, } from "./client.js";
|
|
4
4
|
export { solanaNonceSigner } from "./solana.js";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical public topic boards supported by the Swarm MCP inbox/topics service:
|
|
3
|
+
* - `open-challenge`: Coordination Game matchmaking
|
|
4
|
+
* - `subcontract`: Shillbot task handoff
|
|
5
|
+
* - `town-square`: Open general coordination board
|
|
6
|
+
*/
|
|
7
|
+
export declare const VALID_TOPICS: readonly ["open-challenge", "subcontract", "town-square"];
|
|
8
|
+
export type TopicId = (typeof VALID_TOPICS)[number];
|
|
9
|
+
export declare function isValidTopicId(value: unknown): value is TopicId;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical public topic boards supported by the Swarm MCP inbox/topics service:
|
|
3
|
+
* - `open-challenge`: Coordination Game matchmaking
|
|
4
|
+
* - `subcontract`: Shillbot task handoff
|
|
5
|
+
* - `town-square`: Open general coordination board
|
|
6
|
+
*/
|
|
7
|
+
export const VALID_TOPICS = ["open-challenge", "subcontract", "town-square"];
|
|
8
|
+
export function isValidTopicId(value) {
|
|
9
|
+
return typeof value === "string" && VALID_TOPICS.includes(value);
|
|
10
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,10 @@ export { CLIENT_VERSION } from "./version.js";
|
|
|
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";
|
|
6
|
-
export { SwarmAgent, createSwarmAgent, type ExecuteTaskOptions, type ExecutedTaskResult, type NextTaskAction, type SwarmAgentOptions, type SwarmNetwork, type TaskLifecycleStep, } from "./agent.js";
|
|
6
|
+
export { DEFAULT_MAX_NETWORK_FEE_WEI, SwarmAgent, createSwarmAgent, extractCreateEscrowLamports, type ExecuteTaskOptions, type ExecutedTaskResult, type NextTaskAction, type SwarmAgentOptions, type SwarmNetwork, type TaskLifecycleStep, } from "./agent.js";
|
|
7
7
|
export { WalletTokenManager, type TokenProvider, type WalletTokenManagerOptions, } from "./auth/token-manager.js";
|
|
8
|
-
export { fromEvmPrivateKey, fromEvmWalletClient, fromSolanaKeypair, fromSolanaSecretKey, fromSolanaWalletAdapter, redactSigner, type EvmCallRequest, type EvmPrivateKeyOptions, type EvmSwarmSigner, type EvmWalletClientLike, type SolanaSwarmSigner, type SolanaWalletAdapterLike, type SwarmSigner, } from "./signer/index.js";
|
|
9
|
-
export { SHILLBOT_ESCROW_DEPLOYMENTS, SHILLBOT_EVM_SELECTORS, buildOnChainActionProofRef, estimateSolanaNetworkFeeLamports, formatOnChainActionAttributionMessage, validatePreparedEvmCall, validatePreparedTransaction, type BuildOnChainActionProofRefParams, type BuildVerifyOptions, type PreparedEvmCallExpectation, type PreparedTransactionExpectation, type PreparedTransactionResponse, type ValidatedEvmCall, type VerificationDataResponse, } from "./shillbot/api.js";
|
|
8
|
+
export { fromEvmPrivateKey, fromEvmWalletClient, fromSolanaKeypair, fromSolanaSecretKey, fromSolanaWalletAdapter, redactSigner, type EvmCallRequest, type EvmPrivateKeyOptions, type EvmSwarmSigner, type EvmTransactionSigner, type EvmWalletClientLike, type SolanaSwarmSigner, type SolanaWalletAdapterLike, type SwarmSigner, } from "./signer/index.js";
|
|
9
|
+
export { MAX_COMPUTE_UNIT_LIMIT, MAX_COMPUTE_UNIT_PRICE_MICROLAMPORTS, SHILLBOT_ESCROW_DEPLOYMENTS, SHILLBOT_EVM_SELECTORS, SHILLBOT_INSTRUCTION_SPECS, buildOnChainActionProofRef, estimateSolanaNetworkFeeLamports, formatOnChainActionAttributionMessage, normalizeEvmChainId, validateComputeBudgetInstruction, validateComputeBudgetInstructions, validatePreparedEvmCall, validatePreparedTransaction, verifyBuiltTransaction, type AuthoritySlotRule, type BuildOnChainActionProofRefParams, type BuildVerifyOptions, type PreparedEvmCallExpectation, type PreparedTransactionExpectation, type PreparedTransactionResponse, type ShillbotInstructionName, type ShillbotInstructionSpec, type ValidatedEvmCall, type VerificationDataResponse, type VerifyBuiltTransactionExpectation, } from "./shillbot/api.js";
|
|
10
|
+
export { VALID_TOPICS, isValidTopicId, type TopicId, } from "./inbox/types.js";
|
|
11
|
+
export { DEFAULT_MAX_VOW_BYTES, fetchVowAttestationJson, validateVowUrl, verifyVow, type FetchVowOptions, type VerifyVowOptions, } from "./vow/verify.js";
|
|
10
12
|
export { OPENAPI_SERVERS, OPENAPI_VERSION, type OpenApiOperationId, type OpenApiOperations, type OpenApiPaths, type OpenApiSchemas, type OpenApiServerUrl, } from "./generated/openapi.js";
|
package/dist/index.js
CHANGED
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
export { CLIENT_VERSION } from "./version.js";
|
|
3
3
|
export const CLIENT_MANIFEST_SCHEMA = "swarm.client-manifest/v1";
|
|
4
4
|
export { SwarmClientError } from "./errors.js";
|
|
5
|
-
export { SwarmAgent, createSwarmAgent, } from "./agent.js";
|
|
5
|
+
export { DEFAULT_MAX_NETWORK_FEE_WEI, SwarmAgent, createSwarmAgent, extractCreateEscrowLamports, } from "./agent.js";
|
|
6
6
|
export { WalletTokenManager, } from "./auth/token-manager.js";
|
|
7
7
|
export { fromEvmPrivateKey, fromEvmWalletClient, fromSolanaKeypair, fromSolanaSecretKey, fromSolanaWalletAdapter, redactSigner, } from "./signer/index.js";
|
|
8
|
-
export { SHILLBOT_ESCROW_DEPLOYMENTS, SHILLBOT_EVM_SELECTORS, buildOnChainActionProofRef, estimateSolanaNetworkFeeLamports, formatOnChainActionAttributionMessage, validatePreparedEvmCall, validatePreparedTransaction, } from "./shillbot/api.js";
|
|
8
|
+
export { MAX_COMPUTE_UNIT_LIMIT, MAX_COMPUTE_UNIT_PRICE_MICROLAMPORTS, SHILLBOT_ESCROW_DEPLOYMENTS, SHILLBOT_EVM_SELECTORS, SHILLBOT_INSTRUCTION_SPECS, buildOnChainActionProofRef, estimateSolanaNetworkFeeLamports, formatOnChainActionAttributionMessage, normalizeEvmChainId, validateComputeBudgetInstruction, validateComputeBudgetInstructions, validatePreparedEvmCall, validatePreparedTransaction, verifyBuiltTransaction, } from "./shillbot/api.js";
|
|
9
|
+
export { VALID_TOPICS, isValidTopicId, } from "./inbox/types.js";
|
|
10
|
+
export { DEFAULT_MAX_VOW_BYTES, fetchVowAttestationJson, validateVowUrl, verifyVow, } from "./vow/verify.js";
|
|
9
11
|
export { OPENAPI_SERVERS, OPENAPI_VERSION, } from "./generated/openapi.js";
|
package/dist/shillbot/api.d.ts
CHANGED
|
@@ -43,7 +43,7 @@ export declare class ShillbotApiClient {
|
|
|
43
43
|
post<T>(path: string, body?: unknown): Promise<T>;
|
|
44
44
|
patch<T>(path: string, body?: unknown): Promise<T>;
|
|
45
45
|
listTasks<TTask = unknown>(limit?: number): Promise<TaskListResponse<TTask>>;
|
|
46
|
-
getTask<TTask = unknown>(id: string): Promise<TTask>;
|
|
46
|
+
getTask<TTask = unknown>(id: string, network?: "mainnet" | "devnet"): Promise<TTask>;
|
|
47
47
|
listAgentTasks<TTask = unknown>(): Promise<TTask[] | TaskListResponse<TTask>>;
|
|
48
48
|
listPendingApproval<TTask = unknown>(): Promise<TTask[] | TaskListResponse<TTask>>;
|
|
49
49
|
listCampaigns<TCampaign = unknown>(): Promise<TCampaign[] | CampaignListResponse<TCampaign>>;
|
|
@@ -70,13 +70,19 @@ export declare class ShillbotApiClient {
|
|
|
70
70
|
buildFinalize(id: string): Promise<PreparedTransactionResponse>;
|
|
71
71
|
confirmTask<TResponse = unknown>(id: string, body: ConfirmTransactionRequest): Promise<TResponse>;
|
|
72
72
|
}
|
|
73
|
+
import { MAX_COMPUTE_UNIT_LIMIT, MAX_COMPUTE_UNIT_PRICE_MICROLAMPORTS, SHILLBOT_INSTRUCTION_SPECS, validateComputeBudgetInstruction, validateComputeBudgetInstructions, verifyBuiltTransaction, type AuthoritySlotRule, type ShillbotInstructionName, type ShillbotInstructionSpec, type VerifyBuiltTransactionExpectation } from "./verify-tx.js";
|
|
74
|
+
export { MAX_COMPUTE_UNIT_LIMIT, MAX_COMPUTE_UNIT_PRICE_MICROLAMPORTS, SHILLBOT_INSTRUCTION_SPECS, validateComputeBudgetInstruction, validateComputeBudgetInstructions, verifyBuiltTransaction, type AuthoritySlotRule, type ShillbotInstructionName, type ShillbotInstructionSpec, type VerifyBuiltTransactionExpectation, };
|
|
73
75
|
export interface PreparedTransactionExpectation {
|
|
74
76
|
action: Action;
|
|
75
77
|
network: "mainnet" | "devnet";
|
|
76
78
|
wallet: string;
|
|
77
79
|
taskPda?: string;
|
|
78
80
|
feePayer?: string;
|
|
81
|
+
payoutTo?: string;
|
|
82
|
+
oracleAuthority?: string;
|
|
79
83
|
escrowLamports?: bigint;
|
|
84
|
+
contentId?: string;
|
|
85
|
+
maxComputeUnitPriceMicroLamports?: bigint;
|
|
80
86
|
allowedProgramIds?: string[];
|
|
81
87
|
}
|
|
82
88
|
/** Canonical deployed ShillbotEscrow EVM contracts keyed by CAIP-2 chain ID. */
|
|
@@ -94,6 +100,7 @@ export interface ValidatedEvmCall {
|
|
|
94
100
|
value: bigint;
|
|
95
101
|
chain: string;
|
|
96
102
|
}
|
|
103
|
+
export declare function normalizeEvmChainId(chain: string | number): string;
|
|
97
104
|
/**
|
|
98
105
|
* C10 fail-closed local validator for server-prepared EVM `ShillbotEscrow` calls.
|
|
99
106
|
* Verifies canonical contract address for `chain`, 4-byte function selector for
|