@blindmarket/sdk 0.1.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.
Files changed (244) hide show
  1. package/README.md +72 -0
  2. package/biome.json +19 -0
  3. package/dist/BlindEscrowClient-CyPuKMge.d.cts +54 -0
  4. package/dist/BlindEscrowClient-R7iGpE-n.d.ts +54 -0
  5. package/dist/KeyStore-Be_SSpCt.d.cts +21 -0
  6. package/dist/KeyStore-k1JgYPJY.d.ts +21 -0
  7. package/dist/Signer-BnqH_qew.d.cts +38 -0
  8. package/dist/Signer-LColE0Uo.d.ts +38 -0
  9. package/dist/Storage-4QOrh7rm.d.ts +17 -0
  10. package/dist/Storage-Cf4IJRMk.d.cts +17 -0
  11. package/dist/TaskRegistryClient-Ch6lYqM_.d.ts +24 -0
  12. package/dist/TaskRegistryClient-CrQjddDc.d.cts +24 -0
  13. package/dist/aes-J-7HrHze.d.cts +17 -0
  14. package/dist/aes-J-7HrHze.d.ts +17 -0
  15. package/dist/agent/Agent.d.ts +59 -0
  16. package/dist/agent/Agent.js +73 -0
  17. package/dist/agent/index.cjs +425 -0
  18. package/dist/agent/index.cjs.map +1 -0
  19. package/dist/agent/index.d.cts +63 -0
  20. package/dist/agent/index.d.ts +1 -0
  21. package/dist/agent/index.js +1 -0
  22. package/dist/agent/index.js.map +1 -0
  23. package/dist/api/index.cjs +4 -0
  24. package/dist/api/index.cjs.map +1 -0
  25. package/dist/api/index.d.cts +2 -0
  26. package/dist/api/index.d.ts +1 -0
  27. package/dist/api/index.js +1 -0
  28. package/dist/api/index.js.map +1 -0
  29. package/dist/chain/BlindEscrowClient.d.ts +51 -0
  30. package/dist/chain/BlindEscrowClient.js +142 -0
  31. package/dist/chain/BlindReputationClient.d.ts +16 -0
  32. package/dist/chain/BlindReputationClient.js +45 -0
  33. package/dist/chain/ChainClient.d.ts +26 -0
  34. package/dist/chain/ChainClient.js +46 -0
  35. package/dist/chain/TaskRegistryClient.d.ts +21 -0
  36. package/dist/chain/TaskRegistryClient.js +70 -0
  37. package/dist/chain/abi/BlindEscrow.json +1113 -0
  38. package/dist/chain/abi/BlindReputation.json +447 -0
  39. package/dist/chain/abi/TaskRegistry.json +586 -0
  40. package/dist/chain/abi/index.d.ts +4 -0
  41. package/dist/chain/abi/index.js +4 -0
  42. package/dist/chain/errors.d.ts +8 -0
  43. package/dist/chain/errors.js +32 -0
  44. package/dist/chain/index.cjs +2484 -0
  45. package/dist/chain/index.cjs.map +1 -0
  46. package/dist/chain/index.d.cts +2305 -0
  47. package/dist/chain/index.d.ts +6 -0
  48. package/dist/chain/index.js +6 -0
  49. package/dist/chain/index.js.map +1 -0
  50. package/dist/compute/index.cjs +4 -0
  51. package/dist/compute/index.cjs.map +1 -0
  52. package/dist/compute/index.d.cts +2 -0
  53. package/dist/compute/index.d.ts +1 -0
  54. package/dist/compute/index.js +1 -0
  55. package/dist/compute/index.js.map +1 -0
  56. package/dist/crypto/aes.d.ts +15 -0
  57. package/dist/crypto/aes.js +81 -0
  58. package/dist/crypto/constants.d.ts +7 -0
  59. package/dist/crypto/constants.js +7 -0
  60. package/dist/crypto/ecies.d.ts +8 -0
  61. package/dist/crypto/ecies.js +51 -0
  62. package/dist/crypto/envelope.d.ts +35 -0
  63. package/dist/crypto/envelope.js +103 -0
  64. package/dist/crypto/hkdf.d.ts +5 -0
  65. package/dist/crypto/hkdf.js +34 -0
  66. package/dist/crypto/index.cjs +424 -0
  67. package/dist/crypto/index.cjs.map +1 -0
  68. package/dist/crypto/index.d.cts +74 -0
  69. package/dist/crypto/index.d.ts +6 -0
  70. package/dist/crypto/index.js +6 -0
  71. package/dist/crypto/index.js.map +1 -0
  72. package/dist/crypto/keys.d.ts +12 -0
  73. package/dist/crypto/keys.js +42 -0
  74. package/dist/errors/BlindBountyError.d.ts +14 -0
  75. package/dist/errors/BlindBountyError.js +30 -0
  76. package/dist/errors/codes.d.ts +19 -0
  77. package/dist/errors/codes.js +48 -0
  78. package/dist/errors/index.cjs +136 -0
  79. package/dist/errors/index.cjs.map +1 -0
  80. package/dist/errors/index.d.cts +60 -0
  81. package/dist/errors/index.d.ts +3 -0
  82. package/dist/errors/index.js +3 -0
  83. package/dist/errors/index.js.map +1 -0
  84. package/dist/errors/subclasses.d.ts +26 -0
  85. package/dist/errors/subclasses.js +41 -0
  86. package/dist/events/EventBus.d.ts +13 -0
  87. package/dist/events/EventBus.js +41 -0
  88. package/dist/events/index.cjs +41 -0
  89. package/dist/events/index.cjs.map +1 -0
  90. package/dist/events/index.d.cts +61 -0
  91. package/dist/events/index.d.ts +2 -0
  92. package/dist/events/index.js +2 -0
  93. package/dist/events/index.js.map +1 -0
  94. package/dist/events/types.d.ts +45 -0
  95. package/dist/events/types.js +1 -0
  96. package/dist/index.cjs +4 -0
  97. package/dist/index.cjs.map +1 -0
  98. package/dist/index.d.cts +2 -0
  99. package/dist/index.d.ts +129 -0
  100. package/dist/index.js +154 -0
  101. package/dist/index.js.map +1 -0
  102. package/dist/keystore/InMemoryKeyStore.d.ts +21 -0
  103. package/dist/keystore/InMemoryKeyStore.js +111 -0
  104. package/dist/keystore/KeyStore.d.ts +18 -0
  105. package/dist/keystore/KeyStore.js +1 -0
  106. package/dist/keystore/index.cjs +335 -0
  107. package/dist/keystore/index.cjs.map +1 -0
  108. package/dist/keystore/index.d.cts +23 -0
  109. package/dist/keystore/index.d.ts +2 -0
  110. package/dist/keystore/index.js +2 -0
  111. package/dist/keystore/index.js.map +1 -0
  112. package/dist/network/index.cjs +74 -0
  113. package/dist/network/index.cjs.map +1 -0
  114. package/dist/network/index.d.cts +36 -0
  115. package/dist/network/index.d.ts +3 -0
  116. package/dist/network/index.js +3 -0
  117. package/dist/network/index.js.map +1 -0
  118. package/dist/network/presets.d.ts +24 -0
  119. package/dist/network/presets.js +23 -0
  120. package/dist/network/resolve.d.ts +7 -0
  121. package/dist/network/resolve.js +17 -0
  122. package/dist/network/types.d.ts +16 -0
  123. package/dist/network/types.js +1 -0
  124. package/dist/signer/EthersSigner.d.ts +24 -0
  125. package/dist/signer/EthersSigner.js +68 -0
  126. package/dist/signer/PrivateKeySigner.d.ts +14 -0
  127. package/dist/signer/PrivateKeySigner.js +18 -0
  128. package/dist/signer/Signer.d.ts +35 -0
  129. package/dist/signer/Signer.js +1 -0
  130. package/dist/signer/index.cjs +121 -0
  131. package/dist/signer/index.cjs.map +1 -0
  132. package/dist/signer/index.d.cts +40 -0
  133. package/dist/signer/index.d.ts +3 -0
  134. package/dist/signer/index.js +3 -0
  135. package/dist/signer/index.js.map +1 -0
  136. package/dist/storage/MemoryStorage.d.ts +18 -0
  137. package/dist/storage/MemoryStorage.js +40 -0
  138. package/dist/storage/Storage.d.ts +14 -0
  139. package/dist/storage/Storage.js +1 -0
  140. package/dist/storage/ZgStorage.d.ts +24 -0
  141. package/dist/storage/ZgStorage.js +102 -0
  142. package/dist/storage/index.cjs +221 -0
  143. package/dist/storage/index.cjs.map +1 -0
  144. package/dist/storage/index.d.cts +44 -0
  145. package/dist/storage/index.d.ts +3 -0
  146. package/dist/storage/index.js +3 -0
  147. package/dist/storage/index.js.map +1 -0
  148. package/dist/testing/index.cjs +4 -0
  149. package/dist/testing/index.cjs.map +1 -0
  150. package/dist/testing/index.d.cts +2 -0
  151. package/dist/testing/index.d.ts +1 -0
  152. package/dist/testing/index.js +1 -0
  153. package/dist/testing/index.js.map +1 -0
  154. package/dist/types-BOG5Ub1z.d.cts +31 -0
  155. package/dist/types-BOG5Ub1z.d.ts +31 -0
  156. package/dist/types-V7_ZmUb-.d.cts +19 -0
  157. package/dist/types-hAsITUQ7.d.ts +19 -0
  158. package/dist/types.d.ts +58 -0
  159. package/dist/types.js +1 -0
  160. package/dist/verifier/index.cjs +4 -0
  161. package/dist/verifier/index.cjs.map +1 -0
  162. package/dist/verifier/index.d.cts +2 -0
  163. package/dist/verifier/index.d.ts +1 -0
  164. package/dist/verifier/index.js +1 -0
  165. package/dist/verifier/index.js.map +1 -0
  166. package/dist/worker/Worker.d.ts +53 -0
  167. package/dist/worker/Worker.js +53 -0
  168. package/dist/worker/index.cjs +382 -0
  169. package/dist/worker/index.cjs.map +1 -0
  170. package/dist/worker/index.d.cts +58 -0
  171. package/dist/worker/index.d.ts +1 -0
  172. package/dist/worker/index.js +1 -0
  173. package/dist/worker/index.js.map +1 -0
  174. package/examples/agent-demo.ts +121 -0
  175. package/package.json +46 -0
  176. package/scripts/gen-crypto-fixtures.mjs +72 -0
  177. package/src/agent/Agent.ts +122 -0
  178. package/src/agent/index.ts +1 -0
  179. package/src/api/index.ts +1 -0
  180. package/src/chain/BlindEscrowClient.ts +182 -0
  181. package/src/chain/BlindReputationClient.ts +55 -0
  182. package/src/chain/ChainClient.ts +59 -0
  183. package/src/chain/TaskRegistryClient.ts +82 -0
  184. package/src/chain/abi/BlindEscrow.json +1113 -0
  185. package/src/chain/abi/BlindReputation.json +447 -0
  186. package/src/chain/abi/TaskRegistry.json +586 -0
  187. package/src/chain/abi/index.ts +5 -0
  188. package/src/chain/errors.ts +43 -0
  189. package/src/chain/index.ts +6 -0
  190. package/src/compute/index.ts +1 -0
  191. package/src/crypto/aes.ts +104 -0
  192. package/src/crypto/constants.ts +7 -0
  193. package/src/crypto/ecies.ts +60 -0
  194. package/src/crypto/envelope.ts +131 -0
  195. package/src/crypto/hkdf.ts +45 -0
  196. package/src/crypto/index.ts +6 -0
  197. package/src/crypto/keys.ts +56 -0
  198. package/src/errors/BlindMarketError.ts +38 -0
  199. package/src/errors/codes.ts +67 -0
  200. package/src/errors/index.ts +3 -0
  201. package/src/errors/subclasses.ts +59 -0
  202. package/src/events/EventBus.ts +45 -0
  203. package/src/events/index.ts +2 -0
  204. package/src/events/types.ts +13 -0
  205. package/src/index.ts +222 -0
  206. package/src/keystore/InMemoryKeyStore.ts +146 -0
  207. package/src/keystore/KeyStore.ts +19 -0
  208. package/src/keystore/index.ts +2 -0
  209. package/src/network/index.ts +3 -0
  210. package/src/network/presets.ts +27 -0
  211. package/src/network/resolve.ts +19 -0
  212. package/src/network/types.ts +18 -0
  213. package/src/signer/EthersSigner.ts +82 -0
  214. package/src/signer/PrivateKeySigner.ts +19 -0
  215. package/src/signer/Signer.ts +40 -0
  216. package/src/signer/index.ts +3 -0
  217. package/src/storage/MemoryStorage.ts +49 -0
  218. package/src/storage/Storage.ts +15 -0
  219. package/src/storage/ZgStorage.ts +124 -0
  220. package/src/storage/index.ts +3 -0
  221. package/src/testing/index.ts +1 -0
  222. package/src/types.ts +76 -0
  223. package/src/verifier/index.ts +1 -0
  224. package/src/worker/Worker.ts +98 -0
  225. package/src/worker/index.ts +1 -0
  226. package/test/agent.test.ts +193 -0
  227. package/test/chain.test.ts +145 -0
  228. package/test/crypto.aes.test.ts +81 -0
  229. package/test/crypto.compat.test.ts +33 -0
  230. package/test/crypto.ecies.test.ts +64 -0
  231. package/test/envelope.test.ts +82 -0
  232. package/test/errors.test.ts +64 -0
  233. package/test/events.test.ts +59 -0
  234. package/test/fixtures/crypto.json +16 -0
  235. package/test/keystore.test.ts +103 -0
  236. package/test/network.test.ts +53 -0
  237. package/test/signer.test.ts +66 -0
  238. package/test/smoke.test.ts +7 -0
  239. package/test/storage.test.ts +55 -0
  240. package/test/worker.test.ts +181 -0
  241. package/tsconfig.build.json +1 -0
  242. package/tsconfig.json +13 -0
  243. package/tsup.config.ts +32 -0
  244. package/vitest.config.ts +17 -0
@@ -0,0 +1,586 @@
1
+ [
2
+ {
3
+ "inputs": [],
4
+ "stateMutability": "nonpayable",
5
+ "type": "constructor"
6
+ },
7
+ {
8
+ "inputs": [],
9
+ "name": "EnforcedPause",
10
+ "type": "error"
11
+ },
12
+ {
13
+ "inputs": [],
14
+ "name": "ExpectedPause",
15
+ "type": "error"
16
+ },
17
+ {
18
+ "inputs": [],
19
+ "name": "NotAdmin",
20
+ "type": "error"
21
+ },
22
+ {
23
+ "inputs": [],
24
+ "name": "NotAuthorized",
25
+ "type": "error"
26
+ },
27
+ {
28
+ "inputs": [],
29
+ "name": "NotPendingAdmin",
30
+ "type": "error"
31
+ },
32
+ {
33
+ "inputs": [],
34
+ "name": "TaskAlreadyClosed",
35
+ "type": "error"
36
+ },
37
+ {
38
+ "inputs": [],
39
+ "name": "TaskAlreadyExists",
40
+ "type": "error"
41
+ },
42
+ {
43
+ "inputs": [],
44
+ "name": "TaskNotFound",
45
+ "type": "error"
46
+ },
47
+ {
48
+ "inputs": [],
49
+ "name": "ZeroAddress",
50
+ "type": "error"
51
+ },
52
+ {
53
+ "anonymous": false,
54
+ "inputs": [
55
+ {
56
+ "indexed": true,
57
+ "internalType": "address",
58
+ "name": "oldAdmin",
59
+ "type": "address"
60
+ },
61
+ {
62
+ "indexed": true,
63
+ "internalType": "address",
64
+ "name": "newAdmin",
65
+ "type": "address"
66
+ }
67
+ ],
68
+ "name": "AdminTransferCompleted",
69
+ "type": "event"
70
+ },
71
+ {
72
+ "anonymous": false,
73
+ "inputs": [
74
+ {
75
+ "indexed": true,
76
+ "internalType": "address",
77
+ "name": "currentAdmin",
78
+ "type": "address"
79
+ },
80
+ {
81
+ "indexed": true,
82
+ "internalType": "address",
83
+ "name": "pendingAdmin",
84
+ "type": "address"
85
+ }
86
+ ],
87
+ "name": "AdminTransferProposed",
88
+ "type": "event"
89
+ },
90
+ {
91
+ "anonymous": false,
92
+ "inputs": [
93
+ {
94
+ "indexed": false,
95
+ "internalType": "address",
96
+ "name": "account",
97
+ "type": "address"
98
+ }
99
+ ],
100
+ "name": "Paused",
101
+ "type": "event"
102
+ },
103
+ {
104
+ "anonymous": false,
105
+ "inputs": [
106
+ {
107
+ "indexed": true,
108
+ "internalType": "address",
109
+ "name": "publisher",
110
+ "type": "address"
111
+ }
112
+ ],
113
+ "name": "PublisherAuthorized",
114
+ "type": "event"
115
+ },
116
+ {
117
+ "anonymous": false,
118
+ "inputs": [
119
+ {
120
+ "indexed": true,
121
+ "internalType": "address",
122
+ "name": "publisher",
123
+ "type": "address"
124
+ }
125
+ ],
126
+ "name": "PublisherRevoked",
127
+ "type": "event"
128
+ },
129
+ {
130
+ "anonymous": false,
131
+ "inputs": [
132
+ {
133
+ "indexed": true,
134
+ "internalType": "uint256",
135
+ "name": "taskId",
136
+ "type": "uint256"
137
+ }
138
+ ],
139
+ "name": "TaskClosed",
140
+ "type": "event"
141
+ },
142
+ {
143
+ "anonymous": false,
144
+ "inputs": [
145
+ {
146
+ "indexed": true,
147
+ "internalType": "uint256",
148
+ "name": "taskId",
149
+ "type": "uint256"
150
+ },
151
+ {
152
+ "indexed": true,
153
+ "internalType": "address",
154
+ "name": "agent",
155
+ "type": "address"
156
+ },
157
+ {
158
+ "indexed": false,
159
+ "internalType": "string",
160
+ "name": "category",
161
+ "type": "string"
162
+ },
163
+ {
164
+ "indexed": false,
165
+ "internalType": "string",
166
+ "name": "locationZone",
167
+ "type": "string"
168
+ },
169
+ {
170
+ "indexed": false,
171
+ "internalType": "uint256",
172
+ "name": "reward",
173
+ "type": "uint256"
174
+ }
175
+ ],
176
+ "name": "TaskPublished",
177
+ "type": "event"
178
+ },
179
+ {
180
+ "anonymous": false,
181
+ "inputs": [
182
+ {
183
+ "indexed": false,
184
+ "internalType": "address",
185
+ "name": "account",
186
+ "type": "address"
187
+ }
188
+ ],
189
+ "name": "Unpaused",
190
+ "type": "event"
191
+ },
192
+ {
193
+ "inputs": [],
194
+ "name": "acceptAdmin",
195
+ "outputs": [],
196
+ "stateMutability": "nonpayable",
197
+ "type": "function"
198
+ },
199
+ {
200
+ "inputs": [],
201
+ "name": "admin",
202
+ "outputs": [
203
+ {
204
+ "internalType": "address",
205
+ "name": "",
206
+ "type": "address"
207
+ }
208
+ ],
209
+ "stateMutability": "view",
210
+ "type": "function"
211
+ },
212
+ {
213
+ "inputs": [
214
+ {
215
+ "internalType": "address",
216
+ "name": "publisher",
217
+ "type": "address"
218
+ }
219
+ ],
220
+ "name": "authorizePublisher",
221
+ "outputs": [],
222
+ "stateMutability": "nonpayable",
223
+ "type": "function"
224
+ },
225
+ {
226
+ "inputs": [
227
+ {
228
+ "internalType": "address",
229
+ "name": "",
230
+ "type": "address"
231
+ }
232
+ ],
233
+ "name": "authorizedPublishers",
234
+ "outputs": [
235
+ {
236
+ "internalType": "bool",
237
+ "name": "",
238
+ "type": "bool"
239
+ }
240
+ ],
241
+ "stateMutability": "view",
242
+ "type": "function"
243
+ },
244
+ {
245
+ "inputs": [
246
+ {
247
+ "internalType": "uint256",
248
+ "name": "taskId",
249
+ "type": "uint256"
250
+ }
251
+ ],
252
+ "name": "closeTask",
253
+ "outputs": [],
254
+ "stateMutability": "nonpayable",
255
+ "type": "function"
256
+ },
257
+ {
258
+ "inputs": [
259
+ {
260
+ "internalType": "uint256",
261
+ "name": "offset",
262
+ "type": "uint256"
263
+ },
264
+ {
265
+ "internalType": "uint256",
266
+ "name": "limit",
267
+ "type": "uint256"
268
+ }
269
+ ],
270
+ "name": "getOpenTasks",
271
+ "outputs": [
272
+ {
273
+ "components": [
274
+ {
275
+ "internalType": "uint256",
276
+ "name": "taskId",
277
+ "type": "uint256"
278
+ },
279
+ {
280
+ "internalType": "address",
281
+ "name": "agent",
282
+ "type": "address"
283
+ },
284
+ {
285
+ "internalType": "string",
286
+ "name": "category",
287
+ "type": "string"
288
+ },
289
+ {
290
+ "internalType": "string",
291
+ "name": "locationZone",
292
+ "type": "string"
293
+ },
294
+ {
295
+ "internalType": "uint256",
296
+ "name": "reward",
297
+ "type": "uint256"
298
+ },
299
+ {
300
+ "internalType": "uint256",
301
+ "name": "createdAt",
302
+ "type": "uint256"
303
+ },
304
+ {
305
+ "internalType": "bool",
306
+ "name": "isOpen",
307
+ "type": "bool"
308
+ }
309
+ ],
310
+ "internalType": "struct TaskRegistry.TaskMeta[]",
311
+ "name": "",
312
+ "type": "tuple[]"
313
+ }
314
+ ],
315
+ "stateMutability": "view",
316
+ "type": "function"
317
+ },
318
+ {
319
+ "inputs": [
320
+ {
321
+ "internalType": "uint256",
322
+ "name": "taskId",
323
+ "type": "uint256"
324
+ }
325
+ ],
326
+ "name": "getTaskMeta",
327
+ "outputs": [
328
+ {
329
+ "components": [
330
+ {
331
+ "internalType": "uint256",
332
+ "name": "taskId",
333
+ "type": "uint256"
334
+ },
335
+ {
336
+ "internalType": "address",
337
+ "name": "agent",
338
+ "type": "address"
339
+ },
340
+ {
341
+ "internalType": "string",
342
+ "name": "category",
343
+ "type": "string"
344
+ },
345
+ {
346
+ "internalType": "string",
347
+ "name": "locationZone",
348
+ "type": "string"
349
+ },
350
+ {
351
+ "internalType": "uint256",
352
+ "name": "reward",
353
+ "type": "uint256"
354
+ },
355
+ {
356
+ "internalType": "uint256",
357
+ "name": "createdAt",
358
+ "type": "uint256"
359
+ },
360
+ {
361
+ "internalType": "bool",
362
+ "name": "isOpen",
363
+ "type": "bool"
364
+ }
365
+ ],
366
+ "internalType": "struct TaskRegistry.TaskMeta",
367
+ "name": "",
368
+ "type": "tuple"
369
+ }
370
+ ],
371
+ "stateMutability": "view",
372
+ "type": "function"
373
+ },
374
+ {
375
+ "inputs": [],
376
+ "name": "openTaskCount",
377
+ "outputs": [
378
+ {
379
+ "internalType": "uint256",
380
+ "name": "",
381
+ "type": "uint256"
382
+ }
383
+ ],
384
+ "stateMutability": "view",
385
+ "type": "function"
386
+ },
387
+ {
388
+ "inputs": [],
389
+ "name": "pause",
390
+ "outputs": [],
391
+ "stateMutability": "nonpayable",
392
+ "type": "function"
393
+ },
394
+ {
395
+ "inputs": [],
396
+ "name": "paused",
397
+ "outputs": [
398
+ {
399
+ "internalType": "bool",
400
+ "name": "",
401
+ "type": "bool"
402
+ }
403
+ ],
404
+ "stateMutability": "view",
405
+ "type": "function"
406
+ },
407
+ {
408
+ "inputs": [],
409
+ "name": "pendingAdmin",
410
+ "outputs": [
411
+ {
412
+ "internalType": "address",
413
+ "name": "",
414
+ "type": "address"
415
+ }
416
+ ],
417
+ "stateMutability": "view",
418
+ "type": "function"
419
+ },
420
+ {
421
+ "inputs": [
422
+ {
423
+ "internalType": "address",
424
+ "name": "_newAdmin",
425
+ "type": "address"
426
+ }
427
+ ],
428
+ "name": "proposeAdmin",
429
+ "outputs": [],
430
+ "stateMutability": "nonpayable",
431
+ "type": "function"
432
+ },
433
+ {
434
+ "inputs": [
435
+ {
436
+ "internalType": "uint256",
437
+ "name": "taskId",
438
+ "type": "uint256"
439
+ },
440
+ {
441
+ "internalType": "address",
442
+ "name": "agent",
443
+ "type": "address"
444
+ },
445
+ {
446
+ "internalType": "string",
447
+ "name": "category",
448
+ "type": "string"
449
+ },
450
+ {
451
+ "internalType": "string",
452
+ "name": "locationZone",
453
+ "type": "string"
454
+ },
455
+ {
456
+ "internalType": "uint256",
457
+ "name": "reward",
458
+ "type": "uint256"
459
+ }
460
+ ],
461
+ "name": "publishTask",
462
+ "outputs": [],
463
+ "stateMutability": "nonpayable",
464
+ "type": "function"
465
+ },
466
+ {
467
+ "inputs": [
468
+ {
469
+ "internalType": "address",
470
+ "name": "publisher",
471
+ "type": "address"
472
+ }
473
+ ],
474
+ "name": "revokePublisher",
475
+ "outputs": [],
476
+ "stateMutability": "nonpayable",
477
+ "type": "function"
478
+ },
479
+ {
480
+ "inputs": [
481
+ {
482
+ "internalType": "uint256",
483
+ "name": "",
484
+ "type": "uint256"
485
+ }
486
+ ],
487
+ "name": "taskExists",
488
+ "outputs": [
489
+ {
490
+ "internalType": "bool",
491
+ "name": "",
492
+ "type": "bool"
493
+ }
494
+ ],
495
+ "stateMutability": "view",
496
+ "type": "function"
497
+ },
498
+ {
499
+ "inputs": [
500
+ {
501
+ "internalType": "uint256",
502
+ "name": "",
503
+ "type": "uint256"
504
+ }
505
+ ],
506
+ "name": "taskIdToIndex",
507
+ "outputs": [
508
+ {
509
+ "internalType": "uint256",
510
+ "name": "",
511
+ "type": "uint256"
512
+ }
513
+ ],
514
+ "stateMutability": "view",
515
+ "type": "function"
516
+ },
517
+ {
518
+ "inputs": [
519
+ {
520
+ "internalType": "uint256",
521
+ "name": "",
522
+ "type": "uint256"
523
+ }
524
+ ],
525
+ "name": "taskList",
526
+ "outputs": [
527
+ {
528
+ "internalType": "uint256",
529
+ "name": "taskId",
530
+ "type": "uint256"
531
+ },
532
+ {
533
+ "internalType": "address",
534
+ "name": "agent",
535
+ "type": "address"
536
+ },
537
+ {
538
+ "internalType": "string",
539
+ "name": "category",
540
+ "type": "string"
541
+ },
542
+ {
543
+ "internalType": "string",
544
+ "name": "locationZone",
545
+ "type": "string"
546
+ },
547
+ {
548
+ "internalType": "uint256",
549
+ "name": "reward",
550
+ "type": "uint256"
551
+ },
552
+ {
553
+ "internalType": "uint256",
554
+ "name": "createdAt",
555
+ "type": "uint256"
556
+ },
557
+ {
558
+ "internalType": "bool",
559
+ "name": "isOpen",
560
+ "type": "bool"
561
+ }
562
+ ],
563
+ "stateMutability": "view",
564
+ "type": "function"
565
+ },
566
+ {
567
+ "inputs": [],
568
+ "name": "totalTasks",
569
+ "outputs": [
570
+ {
571
+ "internalType": "uint256",
572
+ "name": "",
573
+ "type": "uint256"
574
+ }
575
+ ],
576
+ "stateMutability": "view",
577
+ "type": "function"
578
+ },
579
+ {
580
+ "inputs": [],
581
+ "name": "unpause",
582
+ "outputs": [],
583
+ "stateMutability": "nonpayable",
584
+ "type": "function"
585
+ }
586
+ ]
@@ -0,0 +1,4 @@
1
+ import BlindEscrowAbi from './BlindEscrow.json';
2
+ import BlindReputationAbi from './BlindReputation.json';
3
+ import TaskRegistryAbi from './TaskRegistry.json';
4
+ export { BlindEscrowAbi, BlindReputationAbi, TaskRegistryAbi };
@@ -0,0 +1,4 @@
1
+ import BlindEscrowAbi from './BlindEscrow.json' with { type: 'json' };
2
+ import BlindReputationAbi from './BlindReputation.json' with { type: 'json' };
3
+ import TaskRegistryAbi from './TaskRegistry.json' with { type: 'json' };
4
+ export { BlindEscrowAbi, BlindReputationAbi, TaskRegistryAbi };
@@ -0,0 +1,8 @@
1
+ import { ChainError } from '../errors/index.js';
2
+ /**
3
+ * Map an ethers-thrown error to a typed ChainError. Best-effort: walks the
4
+ * ethers error shape for a revert reason, maps common codes (INSUFFICIENT_FUNDS,
5
+ * NETWORK_ERROR, TIMEOUT), and falls back to TX_REVERTED with the original
6
+ * message in context.
7
+ */
8
+ export declare function wrapChainError(err: unknown, hint?: string): ChainError;
@@ -0,0 +1,32 @@
1
+ import { ChainError } from '../errors/index.js';
2
+ /**
3
+ * Map an ethers-thrown error to a typed ChainError. Best-effort: walks the
4
+ * ethers error shape for a revert reason, maps common codes (INSUFFICIENT_FUNDS,
5
+ * NETWORK_ERROR, TIMEOUT), and falls back to TX_REVERTED with the original
6
+ * message in context.
7
+ */
8
+ export function wrapChainError(err, hint) {
9
+ const e = (err ?? {});
10
+ const msg = e.shortMessage ?? e.reason ?? e.message ?? 'unknown chain error';
11
+ const withHint = hint ? `${hint}: ${msg}` : msg;
12
+ switch (e.code) {
13
+ case 'INSUFFICIENT_FUNDS':
14
+ return new ChainError('CHAIN/INSUFFICIENT_BALANCE', withHint, { cause: err, retriable: false });
15
+ case 'NONCE_EXPIRED':
16
+ case 'REPLACEMENT_UNDERPRICED':
17
+ return new ChainError('CHAIN/NONCE_CONFLICT', withHint, { cause: err, retriable: true });
18
+ case 'NETWORK_ERROR':
19
+ case 'SERVER_ERROR':
20
+ case 'TIMEOUT':
21
+ return new ChainError('CHAIN/TX_TIMED_OUT', withHint, { cause: err, retriable: true });
22
+ case 'UNSUPPORTED_OPERATION':
23
+ case 'UNKNOWN_ERROR':
24
+ case 'CALL_EXCEPTION':
25
+ return new ChainError('CHAIN/TX_REVERTED', withHint, {
26
+ cause: err,
27
+ ...(e.data !== undefined ? { context: { data: e.data } } : {}),
28
+ });
29
+ default:
30
+ return new ChainError('CHAIN/TX_REVERTED', withHint, { cause: err });
31
+ }
32
+ }