@blindmarket/sdk 0.1.7 → 0.4.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.
Files changed (188) hide show
  1. package/dist/chain/BlindEscrowClient.d.ts +2 -0
  2. package/dist/chain/BlindEscrowClient.js +14 -6
  3. package/dist/chain/BlindReputationClient.d.ts +3 -0
  4. package/dist/chain/BlindReputationClient.js +3 -1
  5. package/dist/chain/ChainClient.d.ts +5 -2
  6. package/dist/chain/ChainClient.js +5 -0
  7. package/dist/chain/IBlindMarketChain.d.ts +74 -0
  8. package/dist/chain/TaskRegistryClient.d.ts +2 -1
  9. package/dist/chain/TaskRegistryClient.js +15 -7
  10. package/dist/chain/createChainAdapter.d.ts +25 -0
  11. package/dist/chain/createChainAdapter.js +24 -0
  12. package/dist/chain/domain-types.d.ts +77 -0
  13. package/dist/chain/evm/EVMChainAdapter.d.ts +56 -0
  14. package/dist/chain/evm/EVMChainAdapter.js +161 -0
  15. package/dist/chain/evm/index.d.ts +1 -0
  16. package/dist/chain/evm/index.js +1 -0
  17. package/dist/chain/index.d.ts +4 -0
  18. package/dist/chain/index.js +5 -0
  19. package/dist/executor/WorkerRuntime.d.ts +134 -0
  20. package/dist/executor/WorkerRuntime.js +277 -0
  21. package/dist/executor/index.d.ts +1 -0
  22. package/dist/executor/index.js +1 -0
  23. package/dist/index.d.ts +82 -9
  24. package/dist/index.js +60 -6
  25. package/dist/network/presets.d.ts +33 -5
  26. package/dist/network/presets.js +35 -8
  27. package/dist/network/resolve.d.ts +12 -3
  28. package/dist/network/resolve.js +15 -7
  29. package/dist/network/types.d.ts +3 -16
  30. package/dist/types.d.ts +1 -1
  31. package/package.json +8 -1
  32. package/biome.json +0 -19
  33. package/dist/BlindEscrowClient-CyPuKMge.d.cts +0 -54
  34. package/dist/BlindEscrowClient-R7iGpE-n.d.ts +0 -54
  35. package/dist/KeyStore-Be_SSpCt.d.cts +0 -21
  36. package/dist/KeyStore-k1JgYPJY.d.ts +0 -21
  37. package/dist/Signer-BnqH_qew.d.cts +0 -38
  38. package/dist/Signer-LColE0Uo.d.ts +0 -38
  39. package/dist/Storage-4QOrh7rm.d.ts +0 -17
  40. package/dist/Storage-Cf4IJRMk.d.cts +0 -17
  41. package/dist/TaskRegistryClient-Ch6lYqM_.d.ts +0 -24
  42. package/dist/TaskRegistryClient-CrQjddDc.d.cts +0 -24
  43. package/dist/aes-J-7HrHze.d.cts +0 -17
  44. package/dist/aes-J-7HrHze.d.ts +0 -17
  45. package/dist/agent/index.cjs +0 -425
  46. package/dist/agent/index.cjs.map +0 -1
  47. package/dist/agent/index.d.cts +0 -63
  48. package/dist/agent/index.js.map +0 -1
  49. package/dist/api/index.cjs +0 -4
  50. package/dist/api/index.cjs.map +0 -1
  51. package/dist/api/index.d.cts +0 -2
  52. package/dist/api/index.js.map +0 -1
  53. package/dist/chain/index.cjs +0 -2484
  54. package/dist/chain/index.cjs.map +0 -1
  55. package/dist/chain/index.d.cts +0 -2305
  56. package/dist/chain/index.js.map +0 -1
  57. package/dist/compute/index.cjs +0 -4
  58. package/dist/compute/index.cjs.map +0 -1
  59. package/dist/compute/index.d.cts +0 -2
  60. package/dist/compute/index.js.map +0 -1
  61. package/dist/crypto/index.cjs +0 -424
  62. package/dist/crypto/index.cjs.map +0 -1
  63. package/dist/crypto/index.d.cts +0 -74
  64. package/dist/crypto/index.js.map +0 -1
  65. package/dist/errors/BlindBountyError.d.ts +0 -14
  66. package/dist/errors/BlindBountyError.js +0 -30
  67. package/dist/errors/index.cjs +0 -136
  68. package/dist/errors/index.cjs.map +0 -1
  69. package/dist/errors/index.d.cts +0 -60
  70. package/dist/errors/index.js.map +0 -1
  71. package/dist/events/index.cjs +0 -41
  72. package/dist/events/index.cjs.map +0 -1
  73. package/dist/events/index.d.cts +0 -61
  74. package/dist/events/index.js.map +0 -1
  75. package/dist/index.cjs +0 -4
  76. package/dist/index.cjs.map +0 -1
  77. package/dist/index.d.cts +0 -2
  78. package/dist/index.js.map +0 -1
  79. package/dist/keystore/index.cjs +0 -335
  80. package/dist/keystore/index.cjs.map +0 -1
  81. package/dist/keystore/index.d.cts +0 -23
  82. package/dist/keystore/index.js.map +0 -1
  83. package/dist/mcp.d.ts +0 -23
  84. package/dist/mcp.js +0 -101
  85. package/dist/network/index.cjs +0 -74
  86. package/dist/network/index.cjs.map +0 -1
  87. package/dist/network/index.d.cts +0 -36
  88. package/dist/network/index.js.map +0 -1
  89. package/dist/signer/index.cjs +0 -121
  90. package/dist/signer/index.cjs.map +0 -1
  91. package/dist/signer/index.d.cts +0 -40
  92. package/dist/signer/index.js.map +0 -1
  93. package/dist/storage/ZgStorage.d.ts +0 -24
  94. package/dist/storage/ZgStorage.js +0 -102
  95. package/dist/storage/index.cjs +0 -221
  96. package/dist/storage/index.cjs.map +0 -1
  97. package/dist/storage/index.d.cts +0 -44
  98. package/dist/storage/index.js.map +0 -1
  99. package/dist/testing/index.cjs +0 -4
  100. package/dist/testing/index.cjs.map +0 -1
  101. package/dist/testing/index.d.cts +0 -2
  102. package/dist/testing/index.js.map +0 -1
  103. package/dist/types-BOG5Ub1z.d.cts +0 -31
  104. package/dist/types-BOG5Ub1z.d.ts +0 -31
  105. package/dist/types-V7_ZmUb-.d.cts +0 -19
  106. package/dist/types-hAsITUQ7.d.ts +0 -19
  107. package/dist/verifier/index.cjs +0 -4
  108. package/dist/verifier/index.cjs.map +0 -1
  109. package/dist/verifier/index.d.cts +0 -2
  110. package/dist/verifier/index.js.map +0 -1
  111. package/dist/worker/index.cjs +0 -382
  112. package/dist/worker/index.cjs.map +0 -1
  113. package/dist/worker/index.d.cts +0 -58
  114. package/dist/worker/index.js.map +0 -1
  115. package/examples/agent-demo.ts +0 -121
  116. package/scripts/gen-crypto-fixtures.mjs +0 -72
  117. package/src/agent/Agent.ts +0 -122
  118. package/src/agent/index.ts +0 -1
  119. package/src/chain/BlindEscrowClient.ts +0 -187
  120. package/src/chain/BlindReputationClient.ts +0 -55
  121. package/src/chain/ChainClient.ts +0 -59
  122. package/src/chain/TaskRegistryClient.ts +0 -82
  123. package/src/chain/abi/BlindEscrow.json +0 -1113
  124. package/src/chain/abi/BlindReputation.json +0 -447
  125. package/src/chain/abi/TaskRegistry.json +0 -586
  126. package/src/chain/abi/index.ts +0 -5
  127. package/src/chain/errors.ts +0 -43
  128. package/src/chain/index.ts +0 -6
  129. package/src/crypto/aes.ts +0 -104
  130. package/src/crypto/constants.ts +0 -7
  131. package/src/crypto/ecies.ts +0 -60
  132. package/src/crypto/envelope.ts +0 -131
  133. package/src/crypto/hkdf.ts +0 -45
  134. package/src/crypto/index.ts +0 -6
  135. package/src/crypto/keys.ts +0 -56
  136. package/src/errors/BlindMarketError.ts +0 -38
  137. package/src/errors/codes.ts +0 -67
  138. package/src/errors/index.ts +0 -3
  139. package/src/errors/subclasses.ts +0 -59
  140. package/src/events/EventBus.ts +0 -45
  141. package/src/events/index.ts +0 -2
  142. package/src/events/types.ts +0 -13
  143. package/src/index.ts +0 -617
  144. package/src/keystore/InMemoryKeyStore.ts +0 -146
  145. package/src/keystore/KeyStore.ts +0 -19
  146. package/src/keystore/index.ts +0 -2
  147. package/src/network/index.ts +0 -3
  148. package/src/network/presets.ts +0 -27
  149. package/src/network/resolve.ts +0 -19
  150. package/src/network/types.ts +0 -18
  151. package/src/signer/EthersSigner.ts +0 -82
  152. package/src/signer/PrivateKeySigner.ts +0 -19
  153. package/src/signer/Signer.ts +0 -40
  154. package/src/signer/index.ts +0 -3
  155. package/src/storage/MemoryStorage.ts +0 -49
  156. package/src/storage/Storage.ts +0 -15
  157. package/src/storage/ZgStorage.ts +0 -124
  158. package/src/storage/index.ts +0 -3
  159. package/src/testing/index.ts +0 -1
  160. package/src/tools/adapters.ts +0 -177
  161. package/src/tools/helpers.ts +0 -199
  162. package/src/tools/index.ts +0 -59
  163. package/src/tools/types.ts +0 -47
  164. package/src/types.ts +0 -296
  165. package/src/verifier/index.ts +0 -1
  166. package/src/worker/Worker.ts +0 -98
  167. package/src/worker/index.ts +0 -1
  168. package/test/agent.test.ts +0 -193
  169. package/test/chain.test.ts +0 -145
  170. package/test/crypto.aes.test.ts +0 -81
  171. package/test/crypto.compat.test.ts +0 -33
  172. package/test/crypto.ecies.test.ts +0 -64
  173. package/test/envelope.test.ts +0 -82
  174. package/test/errors.test.ts +0 -64
  175. package/test/events.test.ts +0 -59
  176. package/test/fixtures/crypto.json +0 -16
  177. package/test/keystore.test.ts +0 -103
  178. package/test/network.test.ts +0 -53
  179. package/test/signer.test.ts +0 -66
  180. package/test/smoke.test.ts +0 -7
  181. package/test/storage.test.ts +0 -55
  182. package/test/worker.test.ts +0 -181
  183. package/tsconfig.build.json +0 -1
  184. package/tsconfig.json +0 -14
  185. package/tsup.config.ts +0 -32
  186. package/vitest.config.ts +0 -17
  187. /package/{src/api/index.ts → dist/chain/IBlindMarketChain.js} +0 -0
  188. /package/{src/compute/index.ts → dist/chain/domain-types.js} +0 -0
@@ -1,2305 +0,0 @@
1
- import { ChainError } from '../errors/index.cjs';
2
- import { B as BlindEscrowClient } from '../BlindEscrowClient-CyPuKMge.cjs';
3
- export { C as CreateTaskArgs, O as OnChainTask } from '../BlindEscrowClient-CyPuKMge.cjs';
4
- import { T as TaskRegistryClient } from '../TaskRegistryClient-CrQjddDc.cjs';
5
- export { O as OpenTaskMeta } from '../TaskRegistryClient-CrQjddDc.cjs';
6
- import { ethers } from 'ethers';
7
- import { A as Address, T as TaskId, b as TxReceiptLike } from '../types-BOG5Ub1z.cjs';
8
- import { S as Signer } from '../Signer-BnqH_qew.cjs';
9
- import { N as Network } from '../types-V7_ZmUb-.cjs';
10
-
11
- var BlindEscrow = [
12
- {
13
- inputs: [
14
- {
15
- internalType: "address",
16
- name: "_treasury",
17
- type: "address"
18
- },
19
- {
20
- internalType: "address",
21
- name: "_verifier",
22
- type: "address"
23
- }
24
- ],
25
- stateMutability: "nonpayable",
26
- type: "constructor"
27
- },
28
- {
29
- inputs: [
30
- ],
31
- name: "DeadlineNotReached",
32
- type: "error"
33
- },
34
- {
35
- inputs: [
36
- ],
37
- name: "DeadlineReached",
38
- type: "error"
39
- },
40
- {
41
- inputs: [
42
- ],
43
- name: "EmptyHash",
44
- type: "error"
45
- },
46
- {
47
- inputs: [
48
- ],
49
- name: "EnforcedPause",
50
- type: "error"
51
- },
52
- {
53
- inputs: [
54
- ],
55
- name: "ExpectedPause",
56
- type: "error"
57
- },
58
- {
59
- inputs: [
60
- ],
61
- name: "FeeExceedsMax",
62
- type: "error"
63
- },
64
- {
65
- inputs: [
66
- ],
67
- name: "InvalidDeadline",
68
- type: "error"
69
- },
70
- {
71
- inputs: [
72
- {
73
- internalType: "enum BlindEscrow.TaskStatus",
74
- name: "current",
75
- type: "uint8"
76
- },
77
- {
78
- internalType: "enum BlindEscrow.TaskStatus",
79
- name: "required",
80
- type: "uint8"
81
- }
82
- ],
83
- name: "InvalidStatus",
84
- type: "error"
85
- },
86
- {
87
- inputs: [
88
- ],
89
- name: "MaxSubmissionAttemptsReached",
90
- type: "error"
91
- },
92
- {
93
- inputs: [
94
- ],
95
- name: "NotAdmin",
96
- type: "error"
97
- },
98
- {
99
- inputs: [
100
- ],
101
- name: "NotAgent",
102
- type: "error"
103
- },
104
- {
105
- inputs: [
106
- ],
107
- name: "NotPendingAdmin",
108
- type: "error"
109
- },
110
- {
111
- inputs: [
112
- ],
113
- name: "NotVerifier",
114
- type: "error"
115
- },
116
- {
117
- inputs: [
118
- ],
119
- name: "NotWorker",
120
- type: "error"
121
- },
122
- {
123
- inputs: [
124
- ],
125
- name: "ReentrancyGuardReentrantCall",
126
- type: "error"
127
- },
128
- {
129
- inputs: [
130
- {
131
- internalType: "address",
132
- name: "token",
133
- type: "address"
134
- }
135
- ],
136
- name: "SafeERC20FailedOperation",
137
- type: "error"
138
- },
139
- {
140
- inputs: [
141
- ],
142
- name: "SelfAssignment",
143
- type: "error"
144
- },
145
- {
146
- inputs: [
147
- ],
148
- name: "TokenNotAllowed",
149
- type: "error"
150
- },
151
- {
152
- inputs: [
153
- ],
154
- name: "ZeroAddress",
155
- type: "error"
156
- },
157
- {
158
- inputs: [
159
- ],
160
- name: "ZeroAmount",
161
- type: "error"
162
- },
163
- {
164
- anonymous: false,
165
- inputs: [
166
- {
167
- indexed: true,
168
- internalType: "address",
169
- name: "oldAdmin",
170
- type: "address"
171
- },
172
- {
173
- indexed: true,
174
- internalType: "address",
175
- name: "newAdmin",
176
- type: "address"
177
- }
178
- ],
179
- name: "AdminTransferCompleted",
180
- type: "event"
181
- },
182
- {
183
- anonymous: false,
184
- inputs: [
185
- {
186
- indexed: true,
187
- internalType: "address",
188
- name: "currentAdmin",
189
- type: "address"
190
- },
191
- {
192
- indexed: true,
193
- internalType: "address",
194
- name: "pendingAdmin",
195
- type: "address"
196
- }
197
- ],
198
- name: "AdminTransferProposed",
199
- type: "event"
200
- },
201
- {
202
- anonymous: false,
203
- inputs: [
204
- {
205
- indexed: true,
206
- internalType: "uint256",
207
- name: "taskId",
208
- type: "uint256"
209
- },
210
- {
211
- indexed: false,
212
- internalType: "uint256",
213
- name: "refundAmount",
214
- type: "uint256"
215
- }
216
- ],
217
- name: "DeadlineExpired",
218
- type: "event"
219
- },
220
- {
221
- anonymous: false,
222
- inputs: [
223
- {
224
- indexed: true,
225
- internalType: "uint256",
226
- name: "taskId",
227
- type: "uint256"
228
- },
229
- {
230
- indexed: false,
231
- internalType: "bool",
232
- name: "workerFavored",
233
- type: "bool"
234
- }
235
- ],
236
- name: "DisputeResolved",
237
- type: "event"
238
- },
239
- {
240
- anonymous: false,
241
- inputs: [
242
- {
243
- indexed: true,
244
- internalType: "uint256",
245
- name: "taskId",
246
- type: "uint256"
247
- },
248
- {
249
- indexed: true,
250
- internalType: "address",
251
- name: "worker",
252
- type: "address"
253
- },
254
- {
255
- indexed: false,
256
- internalType: "bytes32",
257
- name: "evidenceHash",
258
- type: "bytes32"
259
- },
260
- {
261
- indexed: false,
262
- internalType: "uint8",
263
- name: "attempt",
264
- type: "uint8"
265
- }
266
- ],
267
- name: "EvidenceSubmitted",
268
- type: "event"
269
- },
270
- {
271
- anonymous: false,
272
- inputs: [
273
- {
274
- indexed: false,
275
- internalType: "uint256",
276
- name: "oldFeeBps",
277
- type: "uint256"
278
- },
279
- {
280
- indexed: false,
281
- internalType: "uint256",
282
- name: "newFeeBps",
283
- type: "uint256"
284
- }
285
- ],
286
- name: "FeeBpsUpdated",
287
- type: "event"
288
- },
289
- {
290
- anonymous: false,
291
- inputs: [
292
- {
293
- indexed: false,
294
- internalType: "address",
295
- name: "account",
296
- type: "address"
297
- }
298
- ],
299
- name: "Paused",
300
- type: "event"
301
- },
302
- {
303
- anonymous: false,
304
- inputs: [
305
- {
306
- indexed: true,
307
- internalType: "address",
308
- name: "oldContract",
309
- type: "address"
310
- },
311
- {
312
- indexed: true,
313
- internalType: "address",
314
- name: "newContract",
315
- type: "address"
316
- }
317
- ],
318
- name: "ReputationContractUpdated",
319
- type: "event"
320
- },
321
- {
322
- anonymous: false,
323
- inputs: [
324
- {
325
- indexed: true,
326
- internalType: "uint256",
327
- name: "taskId",
328
- type: "uint256"
329
- },
330
- {
331
- indexed: false,
332
- internalType: "uint256",
333
- name: "refundAmount",
334
- type: "uint256"
335
- }
336
- ],
337
- name: "TaskCancelled",
338
- type: "event"
339
- },
340
- {
341
- anonymous: false,
342
- inputs: [
343
- {
344
- indexed: true,
345
- internalType: "uint256",
346
- name: "taskId",
347
- type: "uint256"
348
- },
349
- {
350
- indexed: false,
351
- internalType: "uint256",
352
- name: "workerPayout",
353
- type: "uint256"
354
- },
355
- {
356
- indexed: false,
357
- internalType: "uint256",
358
- name: "platformFee",
359
- type: "uint256"
360
- }
361
- ],
362
- name: "TaskCompleted",
363
- type: "event"
364
- },
365
- {
366
- anonymous: false,
367
- inputs: [
368
- {
369
- indexed: true,
370
- internalType: "uint256",
371
- name: "taskId",
372
- type: "uint256"
373
- },
374
- {
375
- indexed: true,
376
- internalType: "address",
377
- name: "agent",
378
- type: "address"
379
- },
380
- {
381
- indexed: false,
382
- internalType: "address",
383
- name: "token",
384
- type: "address"
385
- },
386
- {
387
- indexed: false,
388
- internalType: "uint256",
389
- name: "amount",
390
- type: "uint256"
391
- },
392
- {
393
- indexed: false,
394
- internalType: "bytes32",
395
- name: "taskHash",
396
- type: "bytes32"
397
- },
398
- {
399
- indexed: false,
400
- internalType: "string",
401
- name: "category",
402
- type: "string"
403
- },
404
- {
405
- indexed: false,
406
- internalType: "string",
407
- name: "locationZone",
408
- type: "string"
409
- },
410
- {
411
- indexed: false,
412
- internalType: "uint256",
413
- name: "deadline",
414
- type: "uint256"
415
- }
416
- ],
417
- name: "TaskCreated",
418
- type: "event"
419
- },
420
- {
421
- anonymous: false,
422
- inputs: [
423
- {
424
- indexed: true,
425
- internalType: "uint256",
426
- name: "taskId",
427
- type: "uint256"
428
- },
429
- {
430
- indexed: true,
431
- internalType: "address",
432
- name: "initiator",
433
- type: "address"
434
- }
435
- ],
436
- name: "TaskDisputed",
437
- type: "event"
438
- },
439
- {
440
- anonymous: false,
441
- inputs: [
442
- {
443
- indexed: true,
444
- internalType: "address",
445
- name: "oldRegistry",
446
- type: "address"
447
- },
448
- {
449
- indexed: true,
450
- internalType: "address",
451
- name: "newRegistry",
452
- type: "address"
453
- }
454
- ],
455
- name: "TaskRegistryUpdated",
456
- type: "event"
457
- },
458
- {
459
- anonymous: false,
460
- inputs: [
461
- {
462
- indexed: true,
463
- internalType: "address",
464
- name: "token",
465
- type: "address"
466
- }
467
- ],
468
- name: "TokenAllowed",
469
- type: "event"
470
- },
471
- {
472
- anonymous: false,
473
- inputs: [
474
- {
475
- indexed: true,
476
- internalType: "address",
477
- name: "token",
478
- type: "address"
479
- }
480
- ],
481
- name: "TokenDisallowed",
482
- type: "event"
483
- },
484
- {
485
- anonymous: false,
486
- inputs: [
487
- {
488
- indexed: true,
489
- internalType: "address",
490
- name: "oldTreasury",
491
- type: "address"
492
- },
493
- {
494
- indexed: true,
495
- internalType: "address",
496
- name: "newTreasury",
497
- type: "address"
498
- }
499
- ],
500
- name: "TreasuryUpdated",
501
- type: "event"
502
- },
503
- {
504
- anonymous: false,
505
- inputs: [
506
- {
507
- indexed: false,
508
- internalType: "address",
509
- name: "account",
510
- type: "address"
511
- }
512
- ],
513
- name: "Unpaused",
514
- type: "event"
515
- },
516
- {
517
- anonymous: false,
518
- inputs: [
519
- {
520
- indexed: true,
521
- internalType: "uint256",
522
- name: "taskId",
523
- type: "uint256"
524
- },
525
- {
526
- indexed: false,
527
- internalType: "bool",
528
- name: "passed",
529
- type: "bool"
530
- }
531
- ],
532
- name: "VerificationCompleted",
533
- type: "event"
534
- },
535
- {
536
- anonymous: false,
537
- inputs: [
538
- {
539
- indexed: true,
540
- internalType: "address",
541
- name: "oldVerifier",
542
- type: "address"
543
- },
544
- {
545
- indexed: true,
546
- internalType: "address",
547
- name: "newVerifier",
548
- type: "address"
549
- }
550
- ],
551
- name: "VerifierUpdated",
552
- type: "event"
553
- },
554
- {
555
- anonymous: false,
556
- inputs: [
557
- {
558
- indexed: true,
559
- internalType: "uint256",
560
- name: "taskId",
561
- type: "uint256"
562
- },
563
- {
564
- indexed: true,
565
- internalType: "address",
566
- name: "worker",
567
- type: "address"
568
- }
569
- ],
570
- name: "WorkerAssigned",
571
- type: "event"
572
- },
573
- {
574
- inputs: [
575
- ],
576
- name: "MAX_DEADLINE",
577
- outputs: [
578
- {
579
- internalType: "uint256",
580
- name: "",
581
- type: "uint256"
582
- }
583
- ],
584
- stateMutability: "view",
585
- type: "function"
586
- },
587
- {
588
- inputs: [
589
- ],
590
- name: "MAX_FEE_BPS",
591
- outputs: [
592
- {
593
- internalType: "uint256",
594
- name: "",
595
- type: "uint256"
596
- }
597
- ],
598
- stateMutability: "view",
599
- type: "function"
600
- },
601
- {
602
- inputs: [
603
- ],
604
- name: "MAX_SUBMISSION_ATTEMPTS",
605
- outputs: [
606
- {
607
- internalType: "uint8",
608
- name: "",
609
- type: "uint8"
610
- }
611
- ],
612
- stateMutability: "view",
613
- type: "function"
614
- },
615
- {
616
- inputs: [
617
- ],
618
- name: "MIN_DEADLINE",
619
- outputs: [
620
- {
621
- internalType: "uint256",
622
- name: "",
623
- type: "uint256"
624
- }
625
- ],
626
- stateMutability: "view",
627
- type: "function"
628
- },
629
- {
630
- inputs: [
631
- ],
632
- name: "acceptAdmin",
633
- outputs: [
634
- ],
635
- stateMutability: "nonpayable",
636
- type: "function"
637
- },
638
- {
639
- inputs: [
640
- ],
641
- name: "admin",
642
- outputs: [
643
- {
644
- internalType: "address",
645
- name: "",
646
- type: "address"
647
- }
648
- ],
649
- stateMutability: "view",
650
- type: "function"
651
- },
652
- {
653
- inputs: [
654
- {
655
- internalType: "address",
656
- name: "token",
657
- type: "address"
658
- }
659
- ],
660
- name: "allowToken",
661
- outputs: [
662
- ],
663
- stateMutability: "nonpayable",
664
- type: "function"
665
- },
666
- {
667
- inputs: [
668
- {
669
- internalType: "address",
670
- name: "",
671
- type: "address"
672
- }
673
- ],
674
- name: "allowedTokens",
675
- outputs: [
676
- {
677
- internalType: "bool",
678
- name: "",
679
- type: "bool"
680
- }
681
- ],
682
- stateMutability: "view",
683
- type: "function"
684
- },
685
- {
686
- inputs: [
687
- {
688
- internalType: "uint256",
689
- name: "taskId",
690
- type: "uint256"
691
- },
692
- {
693
- internalType: "address",
694
- name: "worker",
695
- type: "address"
696
- }
697
- ],
698
- name: "assignWorker",
699
- outputs: [
700
- ],
701
- stateMutability: "nonpayable",
702
- type: "function"
703
- },
704
- {
705
- inputs: [
706
- {
707
- internalType: "uint256",
708
- name: "taskId",
709
- type: "uint256"
710
- }
711
- ],
712
- name: "cancelTask",
713
- outputs: [
714
- ],
715
- stateMutability: "nonpayable",
716
- type: "function"
717
- },
718
- {
719
- inputs: [
720
- {
721
- internalType: "uint256",
722
- name: "taskId",
723
- type: "uint256"
724
- }
725
- ],
726
- name: "claimTimeout",
727
- outputs: [
728
- ],
729
- stateMutability: "nonpayable",
730
- type: "function"
731
- },
732
- {
733
- inputs: [
734
- {
735
- internalType: "uint256",
736
- name: "taskId",
737
- type: "uint256"
738
- },
739
- {
740
- internalType: "bool",
741
- name: "passed",
742
- type: "bool"
743
- }
744
- ],
745
- name: "completeVerification",
746
- outputs: [
747
- ],
748
- stateMutability: "nonpayable",
749
- type: "function"
750
- },
751
- {
752
- inputs: [
753
- {
754
- internalType: "bytes32",
755
- name: "taskHash",
756
- type: "bytes32"
757
- },
758
- {
759
- internalType: "address",
760
- name: "token",
761
- type: "address"
762
- },
763
- {
764
- internalType: "uint256",
765
- name: "amount",
766
- type: "uint256"
767
- },
768
- {
769
- internalType: "string",
770
- name: "category",
771
- type: "string"
772
- },
773
- {
774
- internalType: "string",
775
- name: "locationZone",
776
- type: "string"
777
- },
778
- {
779
- internalType: "uint256",
780
- name: "duration",
781
- type: "uint256"
782
- }
783
- ],
784
- name: "createTask",
785
- outputs: [
786
- {
787
- internalType: "uint256",
788
- name: "taskId",
789
- type: "uint256"
790
- }
791
- ],
792
- stateMutability: "nonpayable",
793
- type: "function"
794
- },
795
- {
796
- inputs: [
797
- {
798
- internalType: "address",
799
- name: "token",
800
- type: "address"
801
- }
802
- ],
803
- name: "disallowToken",
804
- outputs: [
805
- ],
806
- stateMutability: "nonpayable",
807
- type: "function"
808
- },
809
- {
810
- inputs: [
811
- ],
812
- name: "feeBps",
813
- outputs: [
814
- {
815
- internalType: "uint256",
816
- name: "",
817
- type: "uint256"
818
- }
819
- ],
820
- stateMutability: "view",
821
- type: "function"
822
- },
823
- {
824
- inputs: [
825
- {
826
- internalType: "uint256",
827
- name: "taskId",
828
- type: "uint256"
829
- }
830
- ],
831
- name: "getTask",
832
- outputs: [
833
- {
834
- components: [
835
- {
836
- internalType: "address",
837
- name: "agent",
838
- type: "address"
839
- },
840
- {
841
- internalType: "address",
842
- name: "worker",
843
- type: "address"
844
- },
845
- {
846
- internalType: "address",
847
- name: "token",
848
- type: "address"
849
- },
850
- {
851
- internalType: "uint256",
852
- name: "amount",
853
- type: "uint256"
854
- },
855
- {
856
- internalType: "bytes32",
857
- name: "taskHash",
858
- type: "bytes32"
859
- },
860
- {
861
- internalType: "bytes32",
862
- name: "evidenceHash",
863
- type: "bytes32"
864
- },
865
- {
866
- internalType: "enum BlindEscrow.TaskStatus",
867
- name: "status",
868
- type: "uint8"
869
- },
870
- {
871
- internalType: "string",
872
- name: "category",
873
- type: "string"
874
- },
875
- {
876
- internalType: "string",
877
- name: "locationZone",
878
- type: "string"
879
- },
880
- {
881
- internalType: "uint256",
882
- name: "createdAt",
883
- type: "uint256"
884
- },
885
- {
886
- internalType: "uint256",
887
- name: "deadline",
888
- type: "uint256"
889
- },
890
- {
891
- internalType: "uint8",
892
- name: "submissionAttempts",
893
- type: "uint8"
894
- }
895
- ],
896
- internalType: "struct BlindEscrow.Task",
897
- name: "",
898
- type: "tuple"
899
- }
900
- ],
901
- stateMutability: "view",
902
- type: "function"
903
- },
904
- {
905
- inputs: [
906
- {
907
- internalType: "uint256",
908
- name: "taskId",
909
- type: "uint256"
910
- }
911
- ],
912
- name: "isTaskExpired",
913
- outputs: [
914
- {
915
- internalType: "bool",
916
- name: "",
917
- type: "bool"
918
- }
919
- ],
920
- stateMutability: "view",
921
- type: "function"
922
- },
923
- {
924
- inputs: [
925
- ],
926
- name: "nextTaskId",
927
- outputs: [
928
- {
929
- internalType: "uint256",
930
- name: "",
931
- type: "uint256"
932
- }
933
- ],
934
- stateMutability: "view",
935
- type: "function"
936
- },
937
- {
938
- inputs: [
939
- ],
940
- name: "pause",
941
- outputs: [
942
- ],
943
- stateMutability: "nonpayable",
944
- type: "function"
945
- },
946
- {
947
- inputs: [
948
- ],
949
- name: "paused",
950
- outputs: [
951
- {
952
- internalType: "bool",
953
- name: "",
954
- type: "bool"
955
- }
956
- ],
957
- stateMutability: "view",
958
- type: "function"
959
- },
960
- {
961
- inputs: [
962
- ],
963
- name: "pendingAdmin",
964
- outputs: [
965
- {
966
- internalType: "address",
967
- name: "",
968
- type: "address"
969
- }
970
- ],
971
- stateMutability: "view",
972
- type: "function"
973
- },
974
- {
975
- inputs: [
976
- {
977
- internalType: "address",
978
- name: "_newAdmin",
979
- type: "address"
980
- }
981
- ],
982
- name: "proposeAdmin",
983
- outputs: [
984
- ],
985
- stateMutability: "nonpayable",
986
- type: "function"
987
- },
988
- {
989
- inputs: [
990
- {
991
- internalType: "uint256",
992
- name: "taskId",
993
- type: "uint256"
994
- }
995
- ],
996
- name: "raiseDispute",
997
- outputs: [
998
- ],
999
- stateMutability: "nonpayable",
1000
- type: "function"
1001
- },
1002
- {
1003
- inputs: [
1004
- ],
1005
- name: "reputationContract",
1006
- outputs: [
1007
- {
1008
- internalType: "contract IBlindReputation",
1009
- name: "",
1010
- type: "address"
1011
- }
1012
- ],
1013
- stateMutability: "view",
1014
- type: "function"
1015
- },
1016
- {
1017
- inputs: [
1018
- {
1019
- internalType: "uint256",
1020
- name: "taskId",
1021
- type: "uint256"
1022
- },
1023
- {
1024
- internalType: "bool",
1025
- name: "workerFavored",
1026
- type: "bool"
1027
- }
1028
- ],
1029
- name: "resolveDispute",
1030
- outputs: [
1031
- ],
1032
- stateMutability: "nonpayable",
1033
- type: "function"
1034
- },
1035
- {
1036
- inputs: [
1037
- {
1038
- internalType: "uint256",
1039
- name: "_feeBps",
1040
- type: "uint256"
1041
- }
1042
- ],
1043
- name: "setFeeBps",
1044
- outputs: [
1045
- ],
1046
- stateMutability: "nonpayable",
1047
- type: "function"
1048
- },
1049
- {
1050
- inputs: [
1051
- {
1052
- internalType: "address",
1053
- name: "_reputation",
1054
- type: "address"
1055
- }
1056
- ],
1057
- name: "setReputationContract",
1058
- outputs: [
1059
- ],
1060
- stateMutability: "nonpayable",
1061
- type: "function"
1062
- },
1063
- {
1064
- inputs: [
1065
- {
1066
- internalType: "address",
1067
- name: "_registry",
1068
- type: "address"
1069
- }
1070
- ],
1071
- name: "setTaskRegistry",
1072
- outputs: [
1073
- ],
1074
- stateMutability: "nonpayable",
1075
- type: "function"
1076
- },
1077
- {
1078
- inputs: [
1079
- {
1080
- internalType: "address",
1081
- name: "_treasury",
1082
- type: "address"
1083
- }
1084
- ],
1085
- name: "setTreasury",
1086
- outputs: [
1087
- ],
1088
- stateMutability: "nonpayable",
1089
- type: "function"
1090
- },
1091
- {
1092
- inputs: [
1093
- {
1094
- internalType: "address",
1095
- name: "_verifier",
1096
- type: "address"
1097
- }
1098
- ],
1099
- name: "setVerifier",
1100
- outputs: [
1101
- ],
1102
- stateMutability: "nonpayable",
1103
- type: "function"
1104
- },
1105
- {
1106
- inputs: [
1107
- {
1108
- internalType: "uint256",
1109
- name: "taskId",
1110
- type: "uint256"
1111
- },
1112
- {
1113
- internalType: "bytes32",
1114
- name: "evidenceHash",
1115
- type: "bytes32"
1116
- }
1117
- ],
1118
- name: "submitEvidence",
1119
- outputs: [
1120
- ],
1121
- stateMutability: "nonpayable",
1122
- type: "function"
1123
- },
1124
- {
1125
- inputs: [
1126
- ],
1127
- name: "taskRegistry",
1128
- outputs: [
1129
- {
1130
- internalType: "contract ITaskRegistry",
1131
- name: "",
1132
- type: "address"
1133
- }
1134
- ],
1135
- stateMutability: "view",
1136
- type: "function"
1137
- },
1138
- {
1139
- inputs: [
1140
- ],
1141
- name: "treasury",
1142
- outputs: [
1143
- {
1144
- internalType: "address",
1145
- name: "",
1146
- type: "address"
1147
- }
1148
- ],
1149
- stateMutability: "view",
1150
- type: "function"
1151
- },
1152
- {
1153
- inputs: [
1154
- ],
1155
- name: "unpause",
1156
- outputs: [
1157
- ],
1158
- stateMutability: "nonpayable",
1159
- type: "function"
1160
- },
1161
- {
1162
- inputs: [
1163
- ],
1164
- name: "verifier",
1165
- outputs: [
1166
- {
1167
- internalType: "address",
1168
- name: "",
1169
- type: "address"
1170
- }
1171
- ],
1172
- stateMutability: "view",
1173
- type: "function"
1174
- }
1175
- ];
1176
-
1177
- var BlindReputation = [
1178
- {
1179
- inputs: [
1180
- ],
1181
- stateMutability: "nonpayable",
1182
- type: "constructor"
1183
- },
1184
- {
1185
- inputs: [
1186
- ],
1187
- name: "AlreadyRated",
1188
- type: "error"
1189
- },
1190
- {
1191
- inputs: [
1192
- ],
1193
- name: "EnforcedPause",
1194
- type: "error"
1195
- },
1196
- {
1197
- inputs: [
1198
- ],
1199
- name: "ExpectedPause",
1200
- type: "error"
1201
- },
1202
- {
1203
- inputs: [
1204
- ],
1205
- name: "InvalidScore",
1206
- type: "error"
1207
- },
1208
- {
1209
- inputs: [
1210
- ],
1211
- name: "NotAdmin",
1212
- type: "error"
1213
- },
1214
- {
1215
- inputs: [
1216
- ],
1217
- name: "NotAuthorizedRater",
1218
- type: "error"
1219
- },
1220
- {
1221
- inputs: [
1222
- ],
1223
- name: "NotPendingAdmin",
1224
- type: "error"
1225
- },
1226
- {
1227
- inputs: [
1228
- ],
1229
- name: "ZeroAddress",
1230
- type: "error"
1231
- },
1232
- {
1233
- anonymous: false,
1234
- inputs: [
1235
- {
1236
- indexed: true,
1237
- internalType: "address",
1238
- name: "oldAdmin",
1239
- type: "address"
1240
- },
1241
- {
1242
- indexed: true,
1243
- internalType: "address",
1244
- name: "newAdmin",
1245
- type: "address"
1246
- }
1247
- ],
1248
- name: "AdminTransferCompleted",
1249
- type: "event"
1250
- },
1251
- {
1252
- anonymous: false,
1253
- inputs: [
1254
- {
1255
- indexed: true,
1256
- internalType: "address",
1257
- name: "currentAdmin",
1258
- type: "address"
1259
- },
1260
- {
1261
- indexed: true,
1262
- internalType: "address",
1263
- name: "pendingAdmin",
1264
- type: "address"
1265
- }
1266
- ],
1267
- name: "AdminTransferProposed",
1268
- type: "event"
1269
- },
1270
- {
1271
- anonymous: false,
1272
- inputs: [
1273
- {
1274
- indexed: true,
1275
- internalType: "address",
1276
- name: "worker",
1277
- type: "address"
1278
- },
1279
- {
1280
- indexed: true,
1281
- internalType: "uint256",
1282
- name: "taskId",
1283
- type: "uint256"
1284
- }
1285
- ],
1286
- name: "DisputeRecorded",
1287
- type: "event"
1288
- },
1289
- {
1290
- anonymous: false,
1291
- inputs: [
1292
- {
1293
- indexed: false,
1294
- internalType: "address",
1295
- name: "account",
1296
- type: "address"
1297
- }
1298
- ],
1299
- name: "Paused",
1300
- type: "event"
1301
- },
1302
- {
1303
- anonymous: false,
1304
- inputs: [
1305
- {
1306
- indexed: true,
1307
- internalType: "address",
1308
- name: "worker",
1309
- type: "address"
1310
- },
1311
- {
1312
- indexed: true,
1313
- internalType: "address",
1314
- name: "rater",
1315
- type: "address"
1316
- },
1317
- {
1318
- indexed: false,
1319
- internalType: "uint8",
1320
- name: "score",
1321
- type: "uint8"
1322
- },
1323
- {
1324
- indexed: true,
1325
- internalType: "uint256",
1326
- name: "taskId",
1327
- type: "uint256"
1328
- }
1329
- ],
1330
- name: "Rated",
1331
- type: "event"
1332
- },
1333
- {
1334
- anonymous: false,
1335
- inputs: [
1336
- {
1337
- indexed: true,
1338
- internalType: "address",
1339
- name: "rater",
1340
- type: "address"
1341
- }
1342
- ],
1343
- name: "RaterAuthorized",
1344
- type: "event"
1345
- },
1346
- {
1347
- anonymous: false,
1348
- inputs: [
1349
- {
1350
- indexed: true,
1351
- internalType: "address",
1352
- name: "rater",
1353
- type: "address"
1354
- }
1355
- ],
1356
- name: "RaterRevoked",
1357
- type: "event"
1358
- },
1359
- {
1360
- anonymous: false,
1361
- inputs: [
1362
- {
1363
- indexed: false,
1364
- internalType: "address",
1365
- name: "account",
1366
- type: "address"
1367
- }
1368
- ],
1369
- name: "Unpaused",
1370
- type: "event"
1371
- },
1372
- {
1373
- inputs: [
1374
- ],
1375
- name: "acceptAdmin",
1376
- outputs: [
1377
- ],
1378
- stateMutability: "nonpayable",
1379
- type: "function"
1380
- },
1381
- {
1382
- inputs: [
1383
- ],
1384
- name: "admin",
1385
- outputs: [
1386
- {
1387
- internalType: "address",
1388
- name: "",
1389
- type: "address"
1390
- }
1391
- ],
1392
- stateMutability: "view",
1393
- type: "function"
1394
- },
1395
- {
1396
- inputs: [
1397
- {
1398
- internalType: "address",
1399
- name: "rater",
1400
- type: "address"
1401
- }
1402
- ],
1403
- name: "authorizeRater",
1404
- outputs: [
1405
- ],
1406
- stateMutability: "nonpayable",
1407
- type: "function"
1408
- },
1409
- {
1410
- inputs: [
1411
- {
1412
- internalType: "address",
1413
- name: "",
1414
- type: "address"
1415
- }
1416
- ],
1417
- name: "authorizedRaters",
1418
- outputs: [
1419
- {
1420
- internalType: "bool",
1421
- name: "",
1422
- type: "bool"
1423
- }
1424
- ],
1425
- stateMutability: "view",
1426
- type: "function"
1427
- },
1428
- {
1429
- inputs: [
1430
- {
1431
- internalType: "address",
1432
- name: "worker",
1433
- type: "address"
1434
- }
1435
- ],
1436
- name: "getReputation",
1437
- outputs: [
1438
- {
1439
- internalType: "uint256",
1440
- name: "tasksCompleted",
1441
- type: "uint256"
1442
- },
1443
- {
1444
- internalType: "uint256",
1445
- name: "avgScore",
1446
- type: "uint256"
1447
- },
1448
- {
1449
- internalType: "uint256",
1450
- name: "disputes",
1451
- type: "uint256"
1452
- }
1453
- ],
1454
- stateMutability: "view",
1455
- type: "function"
1456
- },
1457
- {
1458
- inputs: [
1459
- {
1460
- internalType: "address",
1461
- name: "worker",
1462
- type: "address"
1463
- },
1464
- {
1465
- internalType: "uint256",
1466
- name: "taskId",
1467
- type: "uint256"
1468
- }
1469
- ],
1470
- name: "hasBeenRated",
1471
- outputs: [
1472
- {
1473
- internalType: "bool",
1474
- name: "",
1475
- type: "bool"
1476
- }
1477
- ],
1478
- stateMutability: "view",
1479
- type: "function"
1480
- },
1481
- {
1482
- inputs: [
1483
- ],
1484
- name: "pause",
1485
- outputs: [
1486
- ],
1487
- stateMutability: "nonpayable",
1488
- type: "function"
1489
- },
1490
- {
1491
- inputs: [
1492
- ],
1493
- name: "paused",
1494
- outputs: [
1495
- {
1496
- internalType: "bool",
1497
- name: "",
1498
- type: "bool"
1499
- }
1500
- ],
1501
- stateMutability: "view",
1502
- type: "function"
1503
- },
1504
- {
1505
- inputs: [
1506
- ],
1507
- name: "pendingAdmin",
1508
- outputs: [
1509
- {
1510
- internalType: "address",
1511
- name: "",
1512
- type: "address"
1513
- }
1514
- ],
1515
- stateMutability: "view",
1516
- type: "function"
1517
- },
1518
- {
1519
- inputs: [
1520
- {
1521
- internalType: "address",
1522
- name: "_newAdmin",
1523
- type: "address"
1524
- }
1525
- ],
1526
- name: "proposeAdmin",
1527
- outputs: [
1528
- ],
1529
- stateMutability: "nonpayable",
1530
- type: "function"
1531
- },
1532
- {
1533
- inputs: [
1534
- {
1535
- internalType: "address",
1536
- name: "worker",
1537
- type: "address"
1538
- },
1539
- {
1540
- internalType: "uint8",
1541
- name: "score",
1542
- type: "uint8"
1543
- },
1544
- {
1545
- internalType: "uint256",
1546
- name: "taskId",
1547
- type: "uint256"
1548
- }
1549
- ],
1550
- name: "rate",
1551
- outputs: [
1552
- ],
1553
- stateMutability: "nonpayable",
1554
- type: "function"
1555
- },
1556
- {
1557
- inputs: [
1558
- {
1559
- internalType: "bytes32",
1560
- name: "",
1561
- type: "bytes32"
1562
- }
1563
- ],
1564
- name: "ratedTasks",
1565
- outputs: [
1566
- {
1567
- internalType: "bool",
1568
- name: "",
1569
- type: "bool"
1570
- }
1571
- ],
1572
- stateMutability: "view",
1573
- type: "function"
1574
- },
1575
- {
1576
- inputs: [
1577
- {
1578
- internalType: "address",
1579
- name: "worker",
1580
- type: "address"
1581
- },
1582
- {
1583
- internalType: "uint256",
1584
- name: "taskId",
1585
- type: "uint256"
1586
- }
1587
- ],
1588
- name: "recordDispute",
1589
- outputs: [
1590
- ],
1591
- stateMutability: "nonpayable",
1592
- type: "function"
1593
- },
1594
- {
1595
- inputs: [
1596
- {
1597
- internalType: "address",
1598
- name: "",
1599
- type: "address"
1600
- }
1601
- ],
1602
- name: "reputations",
1603
- outputs: [
1604
- {
1605
- internalType: "uint256",
1606
- name: "tasksCompleted",
1607
- type: "uint256"
1608
- },
1609
- {
1610
- internalType: "uint256",
1611
- name: "totalScore",
1612
- type: "uint256"
1613
- },
1614
- {
1615
- internalType: "uint256",
1616
- name: "disputes",
1617
- type: "uint256"
1618
- }
1619
- ],
1620
- stateMutability: "view",
1621
- type: "function"
1622
- },
1623
- {
1624
- inputs: [
1625
- {
1626
- internalType: "address",
1627
- name: "rater",
1628
- type: "address"
1629
- }
1630
- ],
1631
- name: "revokeRater",
1632
- outputs: [
1633
- ],
1634
- stateMutability: "nonpayable",
1635
- type: "function"
1636
- },
1637
- {
1638
- inputs: [
1639
- ],
1640
- name: "unpause",
1641
- outputs: [
1642
- ],
1643
- stateMutability: "nonpayable",
1644
- type: "function"
1645
- }
1646
- ];
1647
-
1648
- var TaskRegistry = [
1649
- {
1650
- inputs: [
1651
- ],
1652
- stateMutability: "nonpayable",
1653
- type: "constructor"
1654
- },
1655
- {
1656
- inputs: [
1657
- ],
1658
- name: "EnforcedPause",
1659
- type: "error"
1660
- },
1661
- {
1662
- inputs: [
1663
- ],
1664
- name: "ExpectedPause",
1665
- type: "error"
1666
- },
1667
- {
1668
- inputs: [
1669
- ],
1670
- name: "NotAdmin",
1671
- type: "error"
1672
- },
1673
- {
1674
- inputs: [
1675
- ],
1676
- name: "NotAuthorized",
1677
- type: "error"
1678
- },
1679
- {
1680
- inputs: [
1681
- ],
1682
- name: "NotPendingAdmin",
1683
- type: "error"
1684
- },
1685
- {
1686
- inputs: [
1687
- ],
1688
- name: "TaskAlreadyClosed",
1689
- type: "error"
1690
- },
1691
- {
1692
- inputs: [
1693
- ],
1694
- name: "TaskAlreadyExists",
1695
- type: "error"
1696
- },
1697
- {
1698
- inputs: [
1699
- ],
1700
- name: "TaskNotFound",
1701
- type: "error"
1702
- },
1703
- {
1704
- inputs: [
1705
- ],
1706
- name: "ZeroAddress",
1707
- type: "error"
1708
- },
1709
- {
1710
- anonymous: false,
1711
- inputs: [
1712
- {
1713
- indexed: true,
1714
- internalType: "address",
1715
- name: "oldAdmin",
1716
- type: "address"
1717
- },
1718
- {
1719
- indexed: true,
1720
- internalType: "address",
1721
- name: "newAdmin",
1722
- type: "address"
1723
- }
1724
- ],
1725
- name: "AdminTransferCompleted",
1726
- type: "event"
1727
- },
1728
- {
1729
- anonymous: false,
1730
- inputs: [
1731
- {
1732
- indexed: true,
1733
- internalType: "address",
1734
- name: "currentAdmin",
1735
- type: "address"
1736
- },
1737
- {
1738
- indexed: true,
1739
- internalType: "address",
1740
- name: "pendingAdmin",
1741
- type: "address"
1742
- }
1743
- ],
1744
- name: "AdminTransferProposed",
1745
- type: "event"
1746
- },
1747
- {
1748
- anonymous: false,
1749
- inputs: [
1750
- {
1751
- indexed: false,
1752
- internalType: "address",
1753
- name: "account",
1754
- type: "address"
1755
- }
1756
- ],
1757
- name: "Paused",
1758
- type: "event"
1759
- },
1760
- {
1761
- anonymous: false,
1762
- inputs: [
1763
- {
1764
- indexed: true,
1765
- internalType: "address",
1766
- name: "publisher",
1767
- type: "address"
1768
- }
1769
- ],
1770
- name: "PublisherAuthorized",
1771
- type: "event"
1772
- },
1773
- {
1774
- anonymous: false,
1775
- inputs: [
1776
- {
1777
- indexed: true,
1778
- internalType: "address",
1779
- name: "publisher",
1780
- type: "address"
1781
- }
1782
- ],
1783
- name: "PublisherRevoked",
1784
- type: "event"
1785
- },
1786
- {
1787
- anonymous: false,
1788
- inputs: [
1789
- {
1790
- indexed: true,
1791
- internalType: "uint256",
1792
- name: "taskId",
1793
- type: "uint256"
1794
- }
1795
- ],
1796
- name: "TaskClosed",
1797
- type: "event"
1798
- },
1799
- {
1800
- anonymous: false,
1801
- inputs: [
1802
- {
1803
- indexed: true,
1804
- internalType: "uint256",
1805
- name: "taskId",
1806
- type: "uint256"
1807
- },
1808
- {
1809
- indexed: true,
1810
- internalType: "address",
1811
- name: "agent",
1812
- type: "address"
1813
- },
1814
- {
1815
- indexed: false,
1816
- internalType: "string",
1817
- name: "category",
1818
- type: "string"
1819
- },
1820
- {
1821
- indexed: false,
1822
- internalType: "string",
1823
- name: "locationZone",
1824
- type: "string"
1825
- },
1826
- {
1827
- indexed: false,
1828
- internalType: "uint256",
1829
- name: "reward",
1830
- type: "uint256"
1831
- }
1832
- ],
1833
- name: "TaskPublished",
1834
- type: "event"
1835
- },
1836
- {
1837
- anonymous: false,
1838
- inputs: [
1839
- {
1840
- indexed: false,
1841
- internalType: "address",
1842
- name: "account",
1843
- type: "address"
1844
- }
1845
- ],
1846
- name: "Unpaused",
1847
- type: "event"
1848
- },
1849
- {
1850
- inputs: [
1851
- ],
1852
- name: "acceptAdmin",
1853
- outputs: [
1854
- ],
1855
- stateMutability: "nonpayable",
1856
- type: "function"
1857
- },
1858
- {
1859
- inputs: [
1860
- ],
1861
- name: "admin",
1862
- outputs: [
1863
- {
1864
- internalType: "address",
1865
- name: "",
1866
- type: "address"
1867
- }
1868
- ],
1869
- stateMutability: "view",
1870
- type: "function"
1871
- },
1872
- {
1873
- inputs: [
1874
- {
1875
- internalType: "address",
1876
- name: "publisher",
1877
- type: "address"
1878
- }
1879
- ],
1880
- name: "authorizePublisher",
1881
- outputs: [
1882
- ],
1883
- stateMutability: "nonpayable",
1884
- type: "function"
1885
- },
1886
- {
1887
- inputs: [
1888
- {
1889
- internalType: "address",
1890
- name: "",
1891
- type: "address"
1892
- }
1893
- ],
1894
- name: "authorizedPublishers",
1895
- outputs: [
1896
- {
1897
- internalType: "bool",
1898
- name: "",
1899
- type: "bool"
1900
- }
1901
- ],
1902
- stateMutability: "view",
1903
- type: "function"
1904
- },
1905
- {
1906
- inputs: [
1907
- {
1908
- internalType: "uint256",
1909
- name: "taskId",
1910
- type: "uint256"
1911
- }
1912
- ],
1913
- name: "closeTask",
1914
- outputs: [
1915
- ],
1916
- stateMutability: "nonpayable",
1917
- type: "function"
1918
- },
1919
- {
1920
- inputs: [
1921
- {
1922
- internalType: "uint256",
1923
- name: "offset",
1924
- type: "uint256"
1925
- },
1926
- {
1927
- internalType: "uint256",
1928
- name: "limit",
1929
- type: "uint256"
1930
- }
1931
- ],
1932
- name: "getOpenTasks",
1933
- outputs: [
1934
- {
1935
- components: [
1936
- {
1937
- internalType: "uint256",
1938
- name: "taskId",
1939
- type: "uint256"
1940
- },
1941
- {
1942
- internalType: "address",
1943
- name: "agent",
1944
- type: "address"
1945
- },
1946
- {
1947
- internalType: "string",
1948
- name: "category",
1949
- type: "string"
1950
- },
1951
- {
1952
- internalType: "string",
1953
- name: "locationZone",
1954
- type: "string"
1955
- },
1956
- {
1957
- internalType: "uint256",
1958
- name: "reward",
1959
- type: "uint256"
1960
- },
1961
- {
1962
- internalType: "uint256",
1963
- name: "createdAt",
1964
- type: "uint256"
1965
- },
1966
- {
1967
- internalType: "bool",
1968
- name: "isOpen",
1969
- type: "bool"
1970
- }
1971
- ],
1972
- internalType: "struct TaskRegistry.TaskMeta[]",
1973
- name: "",
1974
- type: "tuple[]"
1975
- }
1976
- ],
1977
- stateMutability: "view",
1978
- type: "function"
1979
- },
1980
- {
1981
- inputs: [
1982
- {
1983
- internalType: "uint256",
1984
- name: "taskId",
1985
- type: "uint256"
1986
- }
1987
- ],
1988
- name: "getTaskMeta",
1989
- outputs: [
1990
- {
1991
- components: [
1992
- {
1993
- internalType: "uint256",
1994
- name: "taskId",
1995
- type: "uint256"
1996
- },
1997
- {
1998
- internalType: "address",
1999
- name: "agent",
2000
- type: "address"
2001
- },
2002
- {
2003
- internalType: "string",
2004
- name: "category",
2005
- type: "string"
2006
- },
2007
- {
2008
- internalType: "string",
2009
- name: "locationZone",
2010
- type: "string"
2011
- },
2012
- {
2013
- internalType: "uint256",
2014
- name: "reward",
2015
- type: "uint256"
2016
- },
2017
- {
2018
- internalType: "uint256",
2019
- name: "createdAt",
2020
- type: "uint256"
2021
- },
2022
- {
2023
- internalType: "bool",
2024
- name: "isOpen",
2025
- type: "bool"
2026
- }
2027
- ],
2028
- internalType: "struct TaskRegistry.TaskMeta",
2029
- name: "",
2030
- type: "tuple"
2031
- }
2032
- ],
2033
- stateMutability: "view",
2034
- type: "function"
2035
- },
2036
- {
2037
- inputs: [
2038
- ],
2039
- name: "openTaskCount",
2040
- outputs: [
2041
- {
2042
- internalType: "uint256",
2043
- name: "",
2044
- type: "uint256"
2045
- }
2046
- ],
2047
- stateMutability: "view",
2048
- type: "function"
2049
- },
2050
- {
2051
- inputs: [
2052
- ],
2053
- name: "pause",
2054
- outputs: [
2055
- ],
2056
- stateMutability: "nonpayable",
2057
- type: "function"
2058
- },
2059
- {
2060
- inputs: [
2061
- ],
2062
- name: "paused",
2063
- outputs: [
2064
- {
2065
- internalType: "bool",
2066
- name: "",
2067
- type: "bool"
2068
- }
2069
- ],
2070
- stateMutability: "view",
2071
- type: "function"
2072
- },
2073
- {
2074
- inputs: [
2075
- ],
2076
- name: "pendingAdmin",
2077
- outputs: [
2078
- {
2079
- internalType: "address",
2080
- name: "",
2081
- type: "address"
2082
- }
2083
- ],
2084
- stateMutability: "view",
2085
- type: "function"
2086
- },
2087
- {
2088
- inputs: [
2089
- {
2090
- internalType: "address",
2091
- name: "_newAdmin",
2092
- type: "address"
2093
- }
2094
- ],
2095
- name: "proposeAdmin",
2096
- outputs: [
2097
- ],
2098
- stateMutability: "nonpayable",
2099
- type: "function"
2100
- },
2101
- {
2102
- inputs: [
2103
- {
2104
- internalType: "uint256",
2105
- name: "taskId",
2106
- type: "uint256"
2107
- },
2108
- {
2109
- internalType: "address",
2110
- name: "agent",
2111
- type: "address"
2112
- },
2113
- {
2114
- internalType: "string",
2115
- name: "category",
2116
- type: "string"
2117
- },
2118
- {
2119
- internalType: "string",
2120
- name: "locationZone",
2121
- type: "string"
2122
- },
2123
- {
2124
- internalType: "uint256",
2125
- name: "reward",
2126
- type: "uint256"
2127
- }
2128
- ],
2129
- name: "publishTask",
2130
- outputs: [
2131
- ],
2132
- stateMutability: "nonpayable",
2133
- type: "function"
2134
- },
2135
- {
2136
- inputs: [
2137
- {
2138
- internalType: "address",
2139
- name: "publisher",
2140
- type: "address"
2141
- }
2142
- ],
2143
- name: "revokePublisher",
2144
- outputs: [
2145
- ],
2146
- stateMutability: "nonpayable",
2147
- type: "function"
2148
- },
2149
- {
2150
- inputs: [
2151
- {
2152
- internalType: "uint256",
2153
- name: "",
2154
- type: "uint256"
2155
- }
2156
- ],
2157
- name: "taskExists",
2158
- outputs: [
2159
- {
2160
- internalType: "bool",
2161
- name: "",
2162
- type: "bool"
2163
- }
2164
- ],
2165
- stateMutability: "view",
2166
- type: "function"
2167
- },
2168
- {
2169
- inputs: [
2170
- {
2171
- internalType: "uint256",
2172
- name: "",
2173
- type: "uint256"
2174
- }
2175
- ],
2176
- name: "taskIdToIndex",
2177
- outputs: [
2178
- {
2179
- internalType: "uint256",
2180
- name: "",
2181
- type: "uint256"
2182
- }
2183
- ],
2184
- stateMutability: "view",
2185
- type: "function"
2186
- },
2187
- {
2188
- inputs: [
2189
- {
2190
- internalType: "uint256",
2191
- name: "",
2192
- type: "uint256"
2193
- }
2194
- ],
2195
- name: "taskList",
2196
- outputs: [
2197
- {
2198
- internalType: "uint256",
2199
- name: "taskId",
2200
- type: "uint256"
2201
- },
2202
- {
2203
- internalType: "address",
2204
- name: "agent",
2205
- type: "address"
2206
- },
2207
- {
2208
- internalType: "string",
2209
- name: "category",
2210
- type: "string"
2211
- },
2212
- {
2213
- internalType: "string",
2214
- name: "locationZone",
2215
- type: "string"
2216
- },
2217
- {
2218
- internalType: "uint256",
2219
- name: "reward",
2220
- type: "uint256"
2221
- },
2222
- {
2223
- internalType: "uint256",
2224
- name: "createdAt",
2225
- type: "uint256"
2226
- },
2227
- {
2228
- internalType: "bool",
2229
- name: "isOpen",
2230
- type: "bool"
2231
- }
2232
- ],
2233
- stateMutability: "view",
2234
- type: "function"
2235
- },
2236
- {
2237
- inputs: [
2238
- ],
2239
- name: "totalTasks",
2240
- outputs: [
2241
- {
2242
- internalType: "uint256",
2243
- name: "",
2244
- type: "uint256"
2245
- }
2246
- ],
2247
- stateMutability: "view",
2248
- type: "function"
2249
- },
2250
- {
2251
- inputs: [
2252
- ],
2253
- name: "unpause",
2254
- outputs: [
2255
- ],
2256
- stateMutability: "nonpayable",
2257
- type: "function"
2258
- }
2259
- ];
2260
-
2261
- /**
2262
- * Map an ethers-thrown error to a typed ChainError. Best-effort: walks the
2263
- * ethers error shape for a revert reason, maps common codes (INSUFFICIENT_FUNDS,
2264
- * NETWORK_ERROR, TIMEOUT), and falls back to TX_REVERTED with the original
2265
- * message in context.
2266
- */
2267
- declare function wrapChainError(err: unknown, hint?: string): ChainError;
2268
-
2269
- interface ReputationSnapshot {
2270
- tasksCompleted: bigint;
2271
- totalScore: bigint;
2272
- disputes: bigint;
2273
- avgScore: number;
2274
- }
2275
- declare class BlindReputationClient {
2276
- readonly contract: ethers.Contract;
2277
- readonly address: Address;
2278
- constructor(address: Address, runner: ethers.ContractRunner);
2279
- getReputation(worker: Address): Promise<ReputationSnapshot>;
2280
- rate(worker: Address, score: number, taskId: TaskId): Promise<TxReceiptLike>;
2281
- hasBeenRated(worker: Address, taskId: TaskId): Promise<boolean>;
2282
- }
2283
-
2284
- interface ChainClientOptions {
2285
- network: Network;
2286
- signer?: Signer;
2287
- /** If provided, used for reads even when signer is absent. Useful for public queries. */
2288
- provider?: ethers.Provider;
2289
- }
2290
- /**
2291
- * Bundles typed clients for all three BlindBounty contracts plus the underlying
2292
- * ethers runner. Reads use provider (or signer's provider); writes require a
2293
- * signer. To keep the SDK's Signer abstraction decoupled from ethers at the
2294
- * call sites, we unwrap an EthersSigner's inner ethers.Signer lazily here.
2295
- */
2296
- declare class ChainClient {
2297
- readonly escrow: BlindEscrowClient;
2298
- readonly registry: TaskRegistryClient;
2299
- readonly reputation: BlindReputationClient;
2300
- readonly provider: ethers.Provider;
2301
- readonly network: Network;
2302
- constructor(opts: ChainClientOptions);
2303
- }
2304
-
2305
- export { BlindEscrow as BlindEscrowAbi, BlindEscrowClient, BlindReputation as BlindReputationAbi, BlindReputationClient, ChainClient, type ChainClientOptions, type ReputationSnapshot, TaskRegistry as TaskRegistryAbi, TaskRegistryClient, wrapChainError };