@claw-network/sdk 0.1.0
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 +41 -0
- package/dist/contracts.d.ts +47 -0
- package/dist/contracts.d.ts.map +1 -0
- package/dist/contracts.js +67 -0
- package/dist/contracts.js.map +1 -0
- package/dist/dao.d.ts +40 -0
- package/dist/dao.d.ts.map +1 -0
- package/dist/dao.js +74 -0
- package/dist/dao.js.map +1 -0
- package/dist/http.d.ts +48 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +117 -0
- package/dist/http.js.map +1 -0
- package/dist/identity.d.ts +18 -0
- package/dist/identity.d.ts.map +1 -0
- package/dist/identity.js +23 -0
- package/dist/identity.js.map +1 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +60 -0
- package/dist/index.js.map +1 -0
- package/dist/markets.d.ts +145 -0
- package/dist/markets.d.ts.map +1 -0
- package/dist/markets.js +212 -0
- package/dist/markets.js.map +1 -0
- package/dist/node.d.ts +21 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +36 -0
- package/dist/node.js.map +1 -0
- package/dist/reputation.d.ts +20 -0
- package/dist/reputation.d.ts.map +1 -0
- package/dist/reputation.js +19 -0
- package/dist/reputation.js.map +1 -0
- package/dist/types.d.ts +733 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/dist/wallet.d.ts +37 -0
- package/dist/wallet.d.ts.map +1 -0
- package/dist/wallet.js +49 -0
- package/dist/wallet.js.map +1 -0
- package/package.json +27 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,733 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared type definitions for the ClawNet SDK.
|
|
3
|
+
*
|
|
4
|
+
* All types mirror the OpenAPI schema defined in docs/api/openapi.yaml.
|
|
5
|
+
*/
|
|
6
|
+
export interface Pagination {
|
|
7
|
+
offset: number;
|
|
8
|
+
limit: number;
|
|
9
|
+
total: number;
|
|
10
|
+
}
|
|
11
|
+
export interface PaginatedList<T> {
|
|
12
|
+
items: T[];
|
|
13
|
+
total: number;
|
|
14
|
+
pagination?: Pagination;
|
|
15
|
+
hasMore?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/** Base event fields shared by most write endpoints. */
|
|
18
|
+
export interface EventFields {
|
|
19
|
+
/** Issuer DID (used for signing). */
|
|
20
|
+
did: string;
|
|
21
|
+
/** Local key passphrase. */
|
|
22
|
+
passphrase: string;
|
|
23
|
+
/** Monotonically-increasing nonce for the issuer. */
|
|
24
|
+
nonce: number;
|
|
25
|
+
/** Previous event hash (optional). */
|
|
26
|
+
prev?: string;
|
|
27
|
+
/** Event timestamp in milliseconds (optional, defaults to now). */
|
|
28
|
+
ts?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface NodeStatus {
|
|
31
|
+
did: string;
|
|
32
|
+
synced: boolean;
|
|
33
|
+
blockHeight: number;
|
|
34
|
+
peers: number;
|
|
35
|
+
network: string;
|
|
36
|
+
version: string;
|
|
37
|
+
uptime: number;
|
|
38
|
+
}
|
|
39
|
+
export interface PeerInfo {
|
|
40
|
+
peerId: string;
|
|
41
|
+
multiaddrs: string[];
|
|
42
|
+
latency?: number;
|
|
43
|
+
connectedAt?: number;
|
|
44
|
+
}
|
|
45
|
+
export interface NodePeersResponse {
|
|
46
|
+
peers: PeerInfo[];
|
|
47
|
+
total: number;
|
|
48
|
+
pagination?: Pagination;
|
|
49
|
+
}
|
|
50
|
+
export interface NodeConfig {
|
|
51
|
+
[key: string]: unknown;
|
|
52
|
+
}
|
|
53
|
+
export interface Identity {
|
|
54
|
+
did: string;
|
|
55
|
+
publicKey: string;
|
|
56
|
+
created: number;
|
|
57
|
+
updated: number;
|
|
58
|
+
[key: string]: unknown;
|
|
59
|
+
}
|
|
60
|
+
export interface Capability {
|
|
61
|
+
id?: string;
|
|
62
|
+
type: string;
|
|
63
|
+
name: string;
|
|
64
|
+
description?: string;
|
|
65
|
+
version?: string;
|
|
66
|
+
[key: string]: unknown;
|
|
67
|
+
}
|
|
68
|
+
export interface CapabilityCredential {
|
|
69
|
+
type: string;
|
|
70
|
+
name: string;
|
|
71
|
+
description?: string;
|
|
72
|
+
version?: string;
|
|
73
|
+
[key: string]: unknown;
|
|
74
|
+
}
|
|
75
|
+
export interface RegisterCapabilityParams extends EventFields {
|
|
76
|
+
credential: CapabilityCredential;
|
|
77
|
+
}
|
|
78
|
+
export interface CapabilitiesResponse {
|
|
79
|
+
capabilities: Capability[];
|
|
80
|
+
pagination?: Pagination;
|
|
81
|
+
}
|
|
82
|
+
export interface Balance {
|
|
83
|
+
balance: number;
|
|
84
|
+
available: number;
|
|
85
|
+
pending: number;
|
|
86
|
+
locked: number;
|
|
87
|
+
}
|
|
88
|
+
export interface TransferParams extends EventFields {
|
|
89
|
+
/** Recipient DID or claw address. */
|
|
90
|
+
to: string;
|
|
91
|
+
/** Amount in Token (integer). */
|
|
92
|
+
amount: number;
|
|
93
|
+
/** Fee in Token (integer, optional). */
|
|
94
|
+
fee?: number;
|
|
95
|
+
/** Memo (max 256 chars). */
|
|
96
|
+
memo?: string;
|
|
97
|
+
}
|
|
98
|
+
export interface TransferResult {
|
|
99
|
+
txHash: string;
|
|
100
|
+
from: string;
|
|
101
|
+
to: string;
|
|
102
|
+
amount: number;
|
|
103
|
+
fee?: number;
|
|
104
|
+
status: string;
|
|
105
|
+
timestamp: number;
|
|
106
|
+
}
|
|
107
|
+
export interface Transaction {
|
|
108
|
+
txHash: string;
|
|
109
|
+
from: string;
|
|
110
|
+
to: string;
|
|
111
|
+
amount: number;
|
|
112
|
+
fee?: number;
|
|
113
|
+
memo?: string;
|
|
114
|
+
type: string;
|
|
115
|
+
status: string;
|
|
116
|
+
timestamp: number;
|
|
117
|
+
[key: string]: unknown;
|
|
118
|
+
}
|
|
119
|
+
export interface TransactionHistoryResponse {
|
|
120
|
+
transactions: Transaction[];
|
|
121
|
+
total: number;
|
|
122
|
+
hasMore: boolean;
|
|
123
|
+
pagination?: Pagination;
|
|
124
|
+
}
|
|
125
|
+
export interface ReleaseRule {
|
|
126
|
+
[key: string]: unknown;
|
|
127
|
+
}
|
|
128
|
+
export interface CreateEscrowParams extends EventFields {
|
|
129
|
+
escrowId?: string;
|
|
130
|
+
/** Beneficiary DID or claw address. */
|
|
131
|
+
beneficiary: string;
|
|
132
|
+
amount: number;
|
|
133
|
+
releaseRules: ReleaseRule[];
|
|
134
|
+
resourcePrev?: string | null;
|
|
135
|
+
arbiter?: string;
|
|
136
|
+
refundRules?: ReleaseRule[];
|
|
137
|
+
expiresAt?: number;
|
|
138
|
+
autoFund?: boolean;
|
|
139
|
+
}
|
|
140
|
+
export interface Escrow {
|
|
141
|
+
id: string;
|
|
142
|
+
depositor: string;
|
|
143
|
+
beneficiary: string;
|
|
144
|
+
amount: number;
|
|
145
|
+
funded: number;
|
|
146
|
+
released: number;
|
|
147
|
+
status: string;
|
|
148
|
+
releaseRules: ReleaseRule[];
|
|
149
|
+
refundRules?: ReleaseRule[];
|
|
150
|
+
arbiter?: string;
|
|
151
|
+
expiresAt?: number;
|
|
152
|
+
createdAt: number;
|
|
153
|
+
[key: string]: unknown;
|
|
154
|
+
}
|
|
155
|
+
export interface EscrowActionParams extends EventFields {
|
|
156
|
+
amount: number;
|
|
157
|
+
resourcePrev: string;
|
|
158
|
+
ruleId?: string;
|
|
159
|
+
reason?: string;
|
|
160
|
+
evidence?: Record<string, unknown>[];
|
|
161
|
+
}
|
|
162
|
+
export interface EscrowExpireParams extends EventFields {
|
|
163
|
+
action?: 'refund' | 'release';
|
|
164
|
+
ruleId?: string;
|
|
165
|
+
reason?: string;
|
|
166
|
+
evidence?: Record<string, unknown>[];
|
|
167
|
+
}
|
|
168
|
+
export type MarketType = 'info' | 'task' | 'capability';
|
|
169
|
+
export type ListingStatus = 'draft' | 'active' | 'paused' | 'sold_out' | 'expired' | 'removed';
|
|
170
|
+
export interface Pricing {
|
|
171
|
+
model: string;
|
|
172
|
+
basePrice: number;
|
|
173
|
+
currency?: string;
|
|
174
|
+
[key: string]: unknown;
|
|
175
|
+
}
|
|
176
|
+
export interface SearchParams {
|
|
177
|
+
q?: string;
|
|
178
|
+
type?: MarketType;
|
|
179
|
+
minPrice?: number;
|
|
180
|
+
maxPrice?: number;
|
|
181
|
+
tags?: string;
|
|
182
|
+
status?: ListingStatus;
|
|
183
|
+
seller?: string;
|
|
184
|
+
sortBy?: string;
|
|
185
|
+
sortOrder?: 'asc' | 'desc';
|
|
186
|
+
limit?: number;
|
|
187
|
+
offset?: number;
|
|
188
|
+
}
|
|
189
|
+
export interface SearchResult {
|
|
190
|
+
listings: MarketListing[];
|
|
191
|
+
total: number;
|
|
192
|
+
facets?: Record<string, unknown>;
|
|
193
|
+
pagination?: Pagination;
|
|
194
|
+
}
|
|
195
|
+
export interface MarketListing {
|
|
196
|
+
id: string;
|
|
197
|
+
type: MarketType;
|
|
198
|
+
seller: string;
|
|
199
|
+
title: string;
|
|
200
|
+
description?: string;
|
|
201
|
+
tags?: string[];
|
|
202
|
+
pricing?: Pricing;
|
|
203
|
+
status: ListingStatus;
|
|
204
|
+
createdAt: number;
|
|
205
|
+
updatedAt?: number;
|
|
206
|
+
[key: string]: unknown;
|
|
207
|
+
}
|
|
208
|
+
export interface OrderReview {
|
|
209
|
+
rating: number;
|
|
210
|
+
comment?: string;
|
|
211
|
+
aspects?: Record<string, number>;
|
|
212
|
+
}
|
|
213
|
+
export interface InfoPublishParams extends EventFields {
|
|
214
|
+
title: string;
|
|
215
|
+
description?: string;
|
|
216
|
+
infoType: string;
|
|
217
|
+
contentFormat: string;
|
|
218
|
+
content?: string;
|
|
219
|
+
tags?: string[];
|
|
220
|
+
pricing: Pricing;
|
|
221
|
+
accessMethod?: {
|
|
222
|
+
type: string;
|
|
223
|
+
[key: string]: unknown;
|
|
224
|
+
};
|
|
225
|
+
preview?: string;
|
|
226
|
+
metadata?: Record<string, unknown>;
|
|
227
|
+
expiresAt?: number;
|
|
228
|
+
status?: ListingStatus;
|
|
229
|
+
}
|
|
230
|
+
export interface InfoPublishResponse {
|
|
231
|
+
listingId: string;
|
|
232
|
+
txHash: string;
|
|
233
|
+
}
|
|
234
|
+
export interface InfoPurchaseParams extends EventFields {
|
|
235
|
+
orderId?: string;
|
|
236
|
+
resourcePrev?: string | null;
|
|
237
|
+
}
|
|
238
|
+
export interface InfoPurchaseResponse {
|
|
239
|
+
orderId: string;
|
|
240
|
+
txHash: string;
|
|
241
|
+
}
|
|
242
|
+
export interface InfoDeliverParams extends EventFields {
|
|
243
|
+
orderId: string;
|
|
244
|
+
deliveryData?: Record<string, unknown>;
|
|
245
|
+
resourcePrev?: string;
|
|
246
|
+
}
|
|
247
|
+
export interface InfoDeliverResponse {
|
|
248
|
+
txHash: string;
|
|
249
|
+
}
|
|
250
|
+
export interface InfoConfirmParams extends EventFields {
|
|
251
|
+
orderId: string;
|
|
252
|
+
resourcePrev?: string;
|
|
253
|
+
}
|
|
254
|
+
export interface InfoConfirmResponse {
|
|
255
|
+
txHash: string;
|
|
256
|
+
}
|
|
257
|
+
export interface InfoReviewParams extends EventFields {
|
|
258
|
+
orderId: string;
|
|
259
|
+
rating: number;
|
|
260
|
+
comment?: string;
|
|
261
|
+
aspects?: Record<string, number>;
|
|
262
|
+
resourcePrev?: string;
|
|
263
|
+
}
|
|
264
|
+
export interface InfoReviewResponse {
|
|
265
|
+
txHash: string;
|
|
266
|
+
}
|
|
267
|
+
export interface TaskPublishParams extends EventFields {
|
|
268
|
+
title: string;
|
|
269
|
+
description?: string;
|
|
270
|
+
taskType: string;
|
|
271
|
+
tags?: string[];
|
|
272
|
+
pricing: Pricing;
|
|
273
|
+
deadline?: number;
|
|
274
|
+
requirements?: Record<string, unknown>;
|
|
275
|
+
deliverables?: string[];
|
|
276
|
+
bidding?: Record<string, unknown>;
|
|
277
|
+
metadata?: Record<string, unknown>;
|
|
278
|
+
expiresAt?: number;
|
|
279
|
+
status?: ListingStatus;
|
|
280
|
+
}
|
|
281
|
+
export interface TaskPublishResponse {
|
|
282
|
+
listingId: string;
|
|
283
|
+
txHash: string;
|
|
284
|
+
}
|
|
285
|
+
export interface TaskBidParams extends EventFields {
|
|
286
|
+
bidId?: string;
|
|
287
|
+
amount: number;
|
|
288
|
+
message?: string;
|
|
289
|
+
timeline?: number;
|
|
290
|
+
proposal?: Record<string, unknown>;
|
|
291
|
+
resourcePrev?: string | null;
|
|
292
|
+
}
|
|
293
|
+
export interface TaskBidResponse {
|
|
294
|
+
bidId: string;
|
|
295
|
+
txHash: string;
|
|
296
|
+
}
|
|
297
|
+
export interface TaskAcceptBidParams extends EventFields {
|
|
298
|
+
bidId: string;
|
|
299
|
+
resourcePrev?: string;
|
|
300
|
+
}
|
|
301
|
+
export interface TaskDeliverParams extends EventFields {
|
|
302
|
+
submission: Record<string, unknown>;
|
|
303
|
+
message?: string;
|
|
304
|
+
resourcePrev?: string;
|
|
305
|
+
}
|
|
306
|
+
export interface TaskConfirmParams extends EventFields {
|
|
307
|
+
resourcePrev?: string;
|
|
308
|
+
}
|
|
309
|
+
export interface TaskReviewParams extends EventFields {
|
|
310
|
+
rating: number;
|
|
311
|
+
comment?: string;
|
|
312
|
+
aspects?: Record<string, number>;
|
|
313
|
+
resourcePrev?: string;
|
|
314
|
+
}
|
|
315
|
+
export interface CapabilityPublishParams extends EventFields {
|
|
316
|
+
title: string;
|
|
317
|
+
description?: string;
|
|
318
|
+
capabilityType: string;
|
|
319
|
+
interfaceType?: string;
|
|
320
|
+
endpoint?: string;
|
|
321
|
+
tags?: string[];
|
|
322
|
+
pricing: Pricing;
|
|
323
|
+
sla?: Record<string, unknown>;
|
|
324
|
+
auth?: Record<string, unknown>;
|
|
325
|
+
metadata?: Record<string, unknown>;
|
|
326
|
+
expiresAt?: number;
|
|
327
|
+
status?: ListingStatus;
|
|
328
|
+
}
|
|
329
|
+
export interface CapabilityPublishResponse {
|
|
330
|
+
listingId: string;
|
|
331
|
+
txHash: string;
|
|
332
|
+
}
|
|
333
|
+
export interface CapabilityLeasePlan {
|
|
334
|
+
type: 'pay_per_use' | 'time_based' | 'subscription' | 'credits';
|
|
335
|
+
details?: Record<string, unknown>;
|
|
336
|
+
}
|
|
337
|
+
export interface CapabilityLeaseParams extends EventFields {
|
|
338
|
+
leaseId?: string;
|
|
339
|
+
plan: CapabilityLeasePlan;
|
|
340
|
+
credentials?: Record<string, unknown>;
|
|
341
|
+
metadata?: Record<string, unknown>;
|
|
342
|
+
expiresAt?: number;
|
|
343
|
+
resourcePrev?: string | null;
|
|
344
|
+
}
|
|
345
|
+
export interface CapabilityLeaseResponse {
|
|
346
|
+
leaseId: string;
|
|
347
|
+
txHash: string;
|
|
348
|
+
credentials?: Record<string, unknown>;
|
|
349
|
+
}
|
|
350
|
+
export interface CapabilityLease {
|
|
351
|
+
id: string;
|
|
352
|
+
listingId: string;
|
|
353
|
+
lessee: string;
|
|
354
|
+
lessor: string;
|
|
355
|
+
plan: CapabilityLeasePlan;
|
|
356
|
+
credentials?: Record<string, unknown>;
|
|
357
|
+
status: string;
|
|
358
|
+
startedAt: number;
|
|
359
|
+
updatedAt?: number;
|
|
360
|
+
expiresAt?: number;
|
|
361
|
+
lastUsedAt?: number;
|
|
362
|
+
metadata?: Record<string, unknown>;
|
|
363
|
+
}
|
|
364
|
+
export interface CapabilityUsageRecord {
|
|
365
|
+
id: string;
|
|
366
|
+
leaseId: string;
|
|
367
|
+
resource: string;
|
|
368
|
+
units?: number;
|
|
369
|
+
latency?: number;
|
|
370
|
+
success: boolean;
|
|
371
|
+
cost?: string;
|
|
372
|
+
timestamp: number;
|
|
373
|
+
}
|
|
374
|
+
export interface CapabilityUsageStats {
|
|
375
|
+
totalCalls: number;
|
|
376
|
+
successfulCalls: number;
|
|
377
|
+
failedCalls: number;
|
|
378
|
+
totalUnits: number;
|
|
379
|
+
averageLatency: number;
|
|
380
|
+
p95Latency: number;
|
|
381
|
+
totalCost: string;
|
|
382
|
+
}
|
|
383
|
+
export interface CapabilityLeaseDetail {
|
|
384
|
+
lease: CapabilityLease;
|
|
385
|
+
usage: CapabilityUsageRecord[];
|
|
386
|
+
stats: CapabilityUsageStats;
|
|
387
|
+
}
|
|
388
|
+
export interface CapabilityInvokeParams extends EventFields {
|
|
389
|
+
resource: string;
|
|
390
|
+
units?: number;
|
|
391
|
+
latency: number;
|
|
392
|
+
success: boolean;
|
|
393
|
+
cost?: number | string;
|
|
394
|
+
}
|
|
395
|
+
export interface CapabilityInvokeResponse {
|
|
396
|
+
leaseId: string;
|
|
397
|
+
txHash: string;
|
|
398
|
+
usage: CapabilityUsageRecord;
|
|
399
|
+
}
|
|
400
|
+
export interface CapabilityLeaseActionParams extends EventFields {
|
|
401
|
+
}
|
|
402
|
+
export interface CapabilityLeaseActionResponse {
|
|
403
|
+
leaseId: string;
|
|
404
|
+
txHash: string;
|
|
405
|
+
action: string;
|
|
406
|
+
}
|
|
407
|
+
export type ContractStatus = 'draft' | 'pending_signature' | 'pending_funding' | 'active' | 'completed' | 'disputed' | 'cancelled';
|
|
408
|
+
export interface ContractTerms {
|
|
409
|
+
title: string;
|
|
410
|
+
description?: string;
|
|
411
|
+
deliverables?: string[];
|
|
412
|
+
deadline?: number;
|
|
413
|
+
revisions?: number;
|
|
414
|
+
confidentiality?: boolean;
|
|
415
|
+
ipOwnership?: 'client' | 'provider' | 'shared';
|
|
416
|
+
}
|
|
417
|
+
export interface PaymentTerms {
|
|
418
|
+
type: 'fixed' | 'hourly' | 'milestone';
|
|
419
|
+
totalAmount: number;
|
|
420
|
+
currency?: string;
|
|
421
|
+
escrowRequired?: boolean;
|
|
422
|
+
paymentSchedule?: {
|
|
423
|
+
milestoneId: string;
|
|
424
|
+
amount: number;
|
|
425
|
+
percentage?: number;
|
|
426
|
+
}[];
|
|
427
|
+
}
|
|
428
|
+
export interface ContractMilestone {
|
|
429
|
+
id: string;
|
|
430
|
+
title: string;
|
|
431
|
+
description?: string;
|
|
432
|
+
amount?: number;
|
|
433
|
+
percentage?: number;
|
|
434
|
+
deadline?: number;
|
|
435
|
+
status: string;
|
|
436
|
+
deliverables?: string[];
|
|
437
|
+
submittedAt?: number;
|
|
438
|
+
approvedAt?: number;
|
|
439
|
+
}
|
|
440
|
+
export interface ContractSignature {
|
|
441
|
+
signer: string;
|
|
442
|
+
signature: string;
|
|
443
|
+
signedAt: number;
|
|
444
|
+
}
|
|
445
|
+
export interface Contract {
|
|
446
|
+
id: string;
|
|
447
|
+
client: string;
|
|
448
|
+
provider: string;
|
|
449
|
+
status: ContractStatus;
|
|
450
|
+
terms: ContractTerms;
|
|
451
|
+
payment: PaymentTerms;
|
|
452
|
+
milestones: ContractMilestone[];
|
|
453
|
+
escrowId?: string;
|
|
454
|
+
signatures: ContractSignature[];
|
|
455
|
+
createdAt: number;
|
|
456
|
+
signedAt?: number;
|
|
457
|
+
completedAt?: number;
|
|
458
|
+
[key: string]: unknown;
|
|
459
|
+
}
|
|
460
|
+
export interface CreateContractParams extends EventFields {
|
|
461
|
+
provider: string;
|
|
462
|
+
terms: ContractTerms;
|
|
463
|
+
payment: PaymentTerms;
|
|
464
|
+
milestones?: Omit<ContractMilestone, 'status' | 'submittedAt' | 'approvedAt'>[];
|
|
465
|
+
arbiter?: string;
|
|
466
|
+
}
|
|
467
|
+
export interface CreateContractResponse {
|
|
468
|
+
contractId: string;
|
|
469
|
+
txHash: string;
|
|
470
|
+
}
|
|
471
|
+
export interface ContractActionParams extends EventFields {
|
|
472
|
+
resourcePrev?: string;
|
|
473
|
+
}
|
|
474
|
+
export interface ContractFundParams extends EventFields {
|
|
475
|
+
amount: number;
|
|
476
|
+
resourcePrev?: string;
|
|
477
|
+
}
|
|
478
|
+
export interface MilestoneSubmitParams extends EventFields {
|
|
479
|
+
deliverables?: string[];
|
|
480
|
+
message?: string;
|
|
481
|
+
resourcePrev?: string;
|
|
482
|
+
}
|
|
483
|
+
export interface MilestoneApproveParams extends EventFields {
|
|
484
|
+
resourcePrev?: string;
|
|
485
|
+
}
|
|
486
|
+
export interface MilestoneRejectParams extends EventFields {
|
|
487
|
+
reason?: string;
|
|
488
|
+
resourcePrev?: string;
|
|
489
|
+
}
|
|
490
|
+
export interface ContractDisputeParams extends EventFields {
|
|
491
|
+
reason: string;
|
|
492
|
+
description?: string;
|
|
493
|
+
evidence?: string[];
|
|
494
|
+
resourcePrev?: string;
|
|
495
|
+
}
|
|
496
|
+
export interface ContractDisputeResolveParams extends EventFields {
|
|
497
|
+
decision: string;
|
|
498
|
+
clientRefund?: number;
|
|
499
|
+
providerPayment?: number;
|
|
500
|
+
resourcePrev?: string;
|
|
501
|
+
}
|
|
502
|
+
export interface ContractSettlementParams extends EventFields {
|
|
503
|
+
resourcePrev?: string;
|
|
504
|
+
}
|
|
505
|
+
export interface ReputationDimensions {
|
|
506
|
+
transaction?: number;
|
|
507
|
+
delivery?: number;
|
|
508
|
+
quality?: number;
|
|
509
|
+
social?: number;
|
|
510
|
+
behavior?: number;
|
|
511
|
+
}
|
|
512
|
+
export interface Reputation {
|
|
513
|
+
did: string;
|
|
514
|
+
score: number;
|
|
515
|
+
level: string;
|
|
516
|
+
levelNumber: number;
|
|
517
|
+
dimensions: ReputationDimensions;
|
|
518
|
+
totalTransactions: number;
|
|
519
|
+
successRate: number;
|
|
520
|
+
averageRating: number;
|
|
521
|
+
badges?: string[];
|
|
522
|
+
updatedAt?: number;
|
|
523
|
+
}
|
|
524
|
+
export interface Review {
|
|
525
|
+
id: string;
|
|
526
|
+
contractId?: string;
|
|
527
|
+
reviewer: string;
|
|
528
|
+
reviewee: string;
|
|
529
|
+
rating: number;
|
|
530
|
+
comment?: string;
|
|
531
|
+
aspects?: Record<string, number>;
|
|
532
|
+
createdAt: number;
|
|
533
|
+
}
|
|
534
|
+
export interface ReviewsResponse {
|
|
535
|
+
reviews: Review[];
|
|
536
|
+
total: number;
|
|
537
|
+
averageRating: number;
|
|
538
|
+
pagination?: Pagination;
|
|
539
|
+
}
|
|
540
|
+
export interface RecordReputationParams extends EventFields {
|
|
541
|
+
target: string;
|
|
542
|
+
dimension: 'transaction' | 'fulfillment' | 'quality' | 'social' | 'behavior';
|
|
543
|
+
score: number;
|
|
544
|
+
ref: string;
|
|
545
|
+
comment?: string;
|
|
546
|
+
aspects?: Record<string, number>;
|
|
547
|
+
}
|
|
548
|
+
export interface ReputationRecordResult {
|
|
549
|
+
txHash: string;
|
|
550
|
+
status: string;
|
|
551
|
+
timestamp: number;
|
|
552
|
+
}
|
|
553
|
+
export interface MarketDisputeOpenParams extends EventFields {
|
|
554
|
+
orderId: string;
|
|
555
|
+
reason: string;
|
|
556
|
+
description?: string;
|
|
557
|
+
evidence?: string[];
|
|
558
|
+
resourcePrev?: string;
|
|
559
|
+
}
|
|
560
|
+
export interface MarketDisputeRespondParams extends EventFields {
|
|
561
|
+
response: string;
|
|
562
|
+
evidence?: string[];
|
|
563
|
+
resourcePrev?: string;
|
|
564
|
+
}
|
|
565
|
+
export interface MarketDisputeResolveParams extends EventFields {
|
|
566
|
+
decision: string;
|
|
567
|
+
buyerRefund?: number;
|
|
568
|
+
sellerPayment?: number;
|
|
569
|
+
resourcePrev?: string;
|
|
570
|
+
}
|
|
571
|
+
export type DaoProposalType = 'parameter_change' | 'treasury_spend' | 'protocol_upgrade' | 'emergency' | 'signal';
|
|
572
|
+
export type DaoProposalStatus = 'draft' | 'discussion' | 'voting' | 'passed' | 'rejected' | 'queued' | 'executed' | 'expired' | 'vetoed';
|
|
573
|
+
export type DaoVoteOption = 'for' | 'against' | 'abstain';
|
|
574
|
+
export interface DaoProposalAction {
|
|
575
|
+
type: string;
|
|
576
|
+
[key: string]: unknown;
|
|
577
|
+
}
|
|
578
|
+
export interface DaoProposalTimeline {
|
|
579
|
+
createdAt: number;
|
|
580
|
+
discussionEndsAt: number;
|
|
581
|
+
votingStartsAt: number;
|
|
582
|
+
votingEndsAt: number;
|
|
583
|
+
executionDelay: number;
|
|
584
|
+
expiresAt: number;
|
|
585
|
+
}
|
|
586
|
+
export interface DaoProposalVotes {
|
|
587
|
+
for: string;
|
|
588
|
+
against: string;
|
|
589
|
+
abstain: string;
|
|
590
|
+
}
|
|
591
|
+
export interface DaoProposal {
|
|
592
|
+
id: string;
|
|
593
|
+
proposer: string;
|
|
594
|
+
type: DaoProposalType;
|
|
595
|
+
title: string;
|
|
596
|
+
description: string;
|
|
597
|
+
discussionUrl?: string;
|
|
598
|
+
actions: DaoProposalAction[];
|
|
599
|
+
timeline: DaoProposalTimeline;
|
|
600
|
+
votes: DaoProposalVotes;
|
|
601
|
+
status: DaoProposalStatus;
|
|
602
|
+
resourcePrev?: string | null;
|
|
603
|
+
}
|
|
604
|
+
export interface DaoVote {
|
|
605
|
+
voter: string;
|
|
606
|
+
proposalId: string;
|
|
607
|
+
option: DaoVoteOption;
|
|
608
|
+
power: string;
|
|
609
|
+
reason?: string;
|
|
610
|
+
ts: number;
|
|
611
|
+
hash: string;
|
|
612
|
+
}
|
|
613
|
+
export interface DaoDelegationScope {
|
|
614
|
+
proposalTypes?: DaoProposalType[];
|
|
615
|
+
topics?: string[];
|
|
616
|
+
all?: boolean;
|
|
617
|
+
}
|
|
618
|
+
export interface DaoDelegation {
|
|
619
|
+
delegator: string;
|
|
620
|
+
delegate: string;
|
|
621
|
+
scope: DaoDelegationScope;
|
|
622
|
+
percentage: number;
|
|
623
|
+
expiresAt?: number;
|
|
624
|
+
revokedAt?: number;
|
|
625
|
+
createdAt: number;
|
|
626
|
+
}
|
|
627
|
+
export interface DaoTreasuryAllocationPolicy {
|
|
628
|
+
development: number;
|
|
629
|
+
nodeRewards: number;
|
|
630
|
+
ecosystem: number;
|
|
631
|
+
reserve: number;
|
|
632
|
+
}
|
|
633
|
+
export interface DaoTreasurySpendingLimits {
|
|
634
|
+
perProposal: string;
|
|
635
|
+
perQuarter: string;
|
|
636
|
+
requireMultisig: string;
|
|
637
|
+
}
|
|
638
|
+
export interface DaoTreasury {
|
|
639
|
+
balance: string;
|
|
640
|
+
allocationPolicy: DaoTreasuryAllocationPolicy;
|
|
641
|
+
spendingLimits: DaoTreasurySpendingLimits;
|
|
642
|
+
totalSpent: string;
|
|
643
|
+
spentThisQuarter: string;
|
|
644
|
+
quarterStart: number;
|
|
645
|
+
}
|
|
646
|
+
export interface DaoTimelockEntry {
|
|
647
|
+
actionId: string;
|
|
648
|
+
proposalId: string;
|
|
649
|
+
action: DaoProposalAction;
|
|
650
|
+
queuedAt: number;
|
|
651
|
+
executeAfter: number;
|
|
652
|
+
status: 'queued' | 'executed' | 'cancelled';
|
|
653
|
+
}
|
|
654
|
+
export interface DaoProposalThreshold {
|
|
655
|
+
createThreshold: number;
|
|
656
|
+
passThreshold: number;
|
|
657
|
+
quorum: number;
|
|
658
|
+
discussionPeriod: number;
|
|
659
|
+
votingPeriod: number;
|
|
660
|
+
timelockDelay: number;
|
|
661
|
+
}
|
|
662
|
+
export interface DaoCreateProposalParams extends EventFields {
|
|
663
|
+
proposalId?: string;
|
|
664
|
+
type: DaoProposalType;
|
|
665
|
+
title: string;
|
|
666
|
+
description: string;
|
|
667
|
+
discussionUrl?: string;
|
|
668
|
+
actions: DaoProposalAction[];
|
|
669
|
+
discussionPeriod?: number;
|
|
670
|
+
votingPeriod?: number;
|
|
671
|
+
timelockDelay?: number;
|
|
672
|
+
}
|
|
673
|
+
export interface DaoAdvanceProposalParams extends EventFields {
|
|
674
|
+
proposalId: string;
|
|
675
|
+
newStatus: string;
|
|
676
|
+
resourcePrev: string;
|
|
677
|
+
}
|
|
678
|
+
export interface DaoVoteCastParams extends EventFields {
|
|
679
|
+
proposalId: string;
|
|
680
|
+
option: DaoVoteOption;
|
|
681
|
+
power: string | number;
|
|
682
|
+
reason?: string;
|
|
683
|
+
}
|
|
684
|
+
export interface DaoDelegateSetParams extends EventFields {
|
|
685
|
+
delegate: string;
|
|
686
|
+
scope?: DaoDelegationScope;
|
|
687
|
+
percentage?: number;
|
|
688
|
+
expiresAt?: number;
|
|
689
|
+
}
|
|
690
|
+
export interface DaoDelegateRevokeParams extends EventFields {
|
|
691
|
+
delegate: string;
|
|
692
|
+
}
|
|
693
|
+
export interface DaoTreasuryDepositParams extends EventFields {
|
|
694
|
+
amount: string | number;
|
|
695
|
+
source: string;
|
|
696
|
+
}
|
|
697
|
+
export interface DaoTimelockActionParams extends EventFields {
|
|
698
|
+
actionId: string;
|
|
699
|
+
}
|
|
700
|
+
export interface DaoTimelockCancelParams extends EventFields {
|
|
701
|
+
actionId: string;
|
|
702
|
+
reason: string;
|
|
703
|
+
}
|
|
704
|
+
export interface DaoProposalListResponse {
|
|
705
|
+
proposals: DaoProposal[];
|
|
706
|
+
}
|
|
707
|
+
export interface DaoProposalResponse {
|
|
708
|
+
proposal: DaoProposal;
|
|
709
|
+
}
|
|
710
|
+
export interface DaoVotesResponse {
|
|
711
|
+
proposalId: string;
|
|
712
|
+
votes: DaoVote[];
|
|
713
|
+
}
|
|
714
|
+
export interface DaoDelegationsResponse {
|
|
715
|
+
did: string;
|
|
716
|
+
delegatedFrom: DaoDelegation[];
|
|
717
|
+
delegatedTo: DaoDelegation[];
|
|
718
|
+
}
|
|
719
|
+
export interface DaoTreasuryResponse {
|
|
720
|
+
treasury: DaoTreasury;
|
|
721
|
+
}
|
|
722
|
+
export interface DaoTimelockListResponse {
|
|
723
|
+
entries: DaoTimelockEntry[];
|
|
724
|
+
}
|
|
725
|
+
export interface DaoParamsResponse {
|
|
726
|
+
thresholds: Record<DaoProposalType, DaoProposalThreshold>;
|
|
727
|
+
}
|
|
728
|
+
export interface DaoTxResult {
|
|
729
|
+
txHash: string;
|
|
730
|
+
status: string;
|
|
731
|
+
[key: string]: unknown;
|
|
732
|
+
}
|
|
733
|
+
//# sourceMappingURL=types.d.ts.map
|