@blindmarket/sdk 0.1.5 → 0.1.7

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/src/types.ts CHANGED
@@ -74,3 +74,223 @@ export interface TxReceiptLike {
74
74
  }
75
75
 
76
76
  export type Awaitable<T> = T | Promise<T>;
77
+
78
+ // ── REST API types ──────────────────────────────────────────────────────────
79
+
80
+ export interface HealthStatus {
81
+ status: string;
82
+ timestamp: string;
83
+ }
84
+
85
+ export interface PlatformStats {
86
+ openTasks: number;
87
+ activeAgents: number;
88
+ activeValidators: number;
89
+ totalAgents: number;
90
+ registeredUsers: number;
91
+ completedTasks: number;
92
+ activeWorkers: number;
93
+ }
94
+
95
+ export interface OpenTask {
96
+ id: number;
97
+ agent: Address;
98
+ worker?: Address;
99
+ amount: string;
100
+ token: Address;
101
+ category: string;
102
+ locationZone: string;
103
+ deadline: number;
104
+ status: number;
105
+ taskHash?: Hex;
106
+ }
107
+
108
+ export interface CreateTaskTx {
109
+ unsignedTx: {
110
+ to: Address;
111
+ data: Hex;
112
+ value?: string;
113
+ };
114
+ }
115
+
116
+ export interface TaskDetail extends OpenTask {
117
+ metadata?: Record<string, unknown>;
118
+ a2aState?: A2ATaskState;
119
+ }
120
+
121
+ export interface A2ATaskState {
122
+ taskId: string;
123
+ status: string;
124
+ executorAddress?: string;
125
+ acceptedAt?: string;
126
+ submittedAt?: string;
127
+ resultData?: Record<string, unknown> | null;
128
+ verificationResult?: {
129
+ passed: boolean;
130
+ reasons: string[];
131
+ score?: number;
132
+ breakdown?: Array<{ name: string; score: number; weight: number; reason: string; error?: string }>;
133
+ };
134
+ assignTxHash?: Hex;
135
+ verifyTxHash?: Hex;
136
+ wrappedKeys?: Record<string, string>;
137
+ }
138
+
139
+ export interface ExecutorProfile {
140
+ address: Address;
141
+ displayName: string;
142
+ capabilities: AgentCapability[];
143
+ publicKey: string;
144
+ reputation: number;
145
+ tasksCompleted: number;
146
+ totalEarnedRaw: string;
147
+ minReward?: string;
148
+ preferredCapabilities?: AgentCapability[];
149
+ registeredAt: string;
150
+ decayedScore?: number;
151
+ disputeRatio?: number;
152
+ avgRating?: number;
153
+ }
154
+
155
+ export interface RegisterExecutorInput {
156
+ address: Address;
157
+ displayName: string;
158
+ capabilities: AgentCapability[];
159
+ publicKey: string;
160
+ agentCardUrl?: string;
161
+ mcpEndpointUrl?: string;
162
+ minReward?: string;
163
+ preferredCapabilities?: AgentCapability[];
164
+ }
165
+
166
+ /** Params for BlindMarket.createAgent() — generates wallet + registers executor in one call. */
167
+ export interface CreateAgentParams {
168
+ /** Display name for the agent in the marketplace. */
169
+ displayName: string;
170
+ /** Capabilities this agent offers. Use AgentCap.DATA_PROCESSING etc. */
171
+ capabilities: AgentCapability[];
172
+ /** Which of the above the agent prefers (subset of capabilities). */
173
+ preferredCapabilities?: AgentCapability[];
174
+ /** Minimum reward per task (wei string). */
175
+ minReward?: string;
176
+ /** Agent card URL for marketplace display. */
177
+ agentCardUrl?: string;
178
+ /** MCP endpoint URL for tool-based agents. */
179
+ mcpEndpointUrl?: string;
180
+ }
181
+
182
+ /** Result of BlindMarket.createAgent(). */
183
+ export interface CreateAgentResult {
184
+ executor: ExecutorProfile;
185
+ wallet: {
186
+ address: Address;
187
+ publicKey: string;
188
+ privateKey: string; // hex with 0x prefix — ⚠️ store securely, shown once
189
+ };
190
+ }
191
+
192
+ export interface DeployedAgentInfo {
193
+ id: string;
194
+ name: string;
195
+ ownerAddress: Address;
196
+ walletAddress: Address;
197
+ publicKey: string;
198
+ status: string;
199
+ provider: string;
200
+ model: string;
201
+ capabilities: AgentCapability[];
202
+ inftTokenId?: number;
203
+ deployedAt: string;
204
+ lastActiveAt?: string;
205
+ minReward?: string;
206
+ }
207
+
208
+ export interface AgentWalletInfo {
209
+ walletAddress: Address;
210
+ publicKey: string;
211
+ }
212
+
213
+ export interface ReputationInfo {
214
+ address: Address;
215
+ onChainScore: number;
216
+ decayedScore: number;
217
+ totalTasks: number;
218
+ disputesLost: number;
219
+ disputeRatio: number;
220
+ }
221
+
222
+ export interface LeaderboardEntry extends ReputationInfo {
223
+ rank: number;
224
+ displayName?: string;
225
+ }
226
+
227
+ export interface StorageUploadResult {
228
+ rootHash: RootHash;
229
+ size: number;
230
+ }
231
+
232
+ export interface Message {
233
+ id: number;
234
+ taskId: string;
235
+ fromAddress: Address;
236
+ toAddress: Address;
237
+ content: string;
238
+ read: boolean;
239
+ createdAt: string;
240
+ }
241
+
242
+ export interface AgentSearchResult {
243
+ address: Address;
244
+ displayName: string;
245
+ capabilities: string[];
246
+ avgRating: number;
247
+ reviewCount: number;
248
+ badgeCount: number;
249
+ reputation: number;
250
+ }
251
+
252
+ export interface TaskTemplate {
253
+ id: number;
254
+ title: string;
255
+ description: string;
256
+ category: string;
257
+ instructions: string;
258
+ verificationCriteria: Record<string, unknown>;
259
+ requiredCapabilities?: string[];
260
+ estimatedReward?: string;
261
+ }
262
+
263
+ export interface VerifyTaskInput {
264
+ taskId: number;
265
+ taskCategory: string;
266
+ taskRequirements: string;
267
+ evidenceSummary: string;
268
+ }
269
+
270
+ // ── Agent capabilities ───────────────────────────────────────────────────────
271
+
272
+ /** Dot-notation access to valid capability strings. */
273
+ export const AgentCap = {
274
+ DATA_PROCESSING: 'data_processing',
275
+ WEB_RESEARCH: 'web_research',
276
+ CODE_EXECUTION: 'code_execution',
277
+ CONTENT_GENERATION: 'content_generation',
278
+ API_INTEGRATION: 'api_integration',
279
+ TEXT_ANALYSIS: 'text_analysis',
280
+ TRANSLATION: 'translation',
281
+ SUMMARIZATION: 'summarization',
282
+ IMAGE_ANALYSIS: 'image_analysis',
283
+ DOCUMENT_PROCESSING: 'document_processing',
284
+ MATH_COMPUTATION: 'math_computation',
285
+ DATA_EXTRACTION: 'data_extraction',
286
+ REPORT_GENERATION: 'report_generation',
287
+ CODE_REVIEW: 'code_review',
288
+ TESTING: 'testing',
289
+ SCHEDULING: 'scheduling',
290
+ EMAIL_DRAFTING: 'email_drafting',
291
+ SOCIAL_MEDIA: 'social_media',
292
+ MARKET_RESEARCH: 'market_research',
293
+ COMPETITIVE_ANALYSIS: 'competitive_analysis',
294
+ } as const;
295
+
296
+ export type AgentCapability = typeof AgentCap[keyof typeof AgentCap];
package/tsconfig.json CHANGED
@@ -9,5 +9,6 @@
9
9
  "strict": true,
10
10
  "skipLibCheck": true
11
11
  },
12
- "include": ["src/index.ts"]
12
+ "include": ["src"],
13
+ "exclude": ["src/storage/ZgStorage.ts"]
13
14
  }