@vapi-network/core 0.15.1 → 0.16.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 (77) hide show
  1. package/README.md +6 -2
  2. package/dist/agent-link.js +73 -7
  3. package/dist/agent-link.js.map +1 -1
  4. package/dist/atomic-file.d.ts +1 -0
  5. package/dist/atomic-file.d.ts.map +1 -1
  6. package/dist/backup.js +6 -4
  7. package/dist/backup.js.map +1 -1
  8. package/dist/cloud-backup.js +79 -11
  9. package/dist/cloud-backup.js.map +2 -2
  10. package/dist/index.js +126 -16
  11. package/dist/index.js.map +2 -2
  12. package/dist/net-guard.d.ts +17 -0
  13. package/dist/net-guard.d.ts.map +1 -1
  14. package/dist/router-client.js +110 -16
  15. package/dist/router-client.js.map +2 -2
  16. package/dist/secrets.js +19 -8
  17. package/dist/secrets.js.map +1 -1
  18. package/dist/support-report.d.ts +1 -1
  19. package/dist/tasks/actions.d.ts +1 -0
  20. package/dist/tasks/actions.d.ts.map +1 -1
  21. package/dist/tasks/ballots.d.ts +43 -0
  22. package/dist/tasks/ballots.d.ts.map +1 -0
  23. package/dist/tasks/chain-port.d.ts +26 -0
  24. package/dist/tasks/chain-port.d.ts.map +1 -1
  25. package/dist/tasks/chain.d.ts +5 -0
  26. package/dist/tasks/chain.d.ts.map +1 -1
  27. package/dist/tasks/client.d.ts +33 -3
  28. package/dist/tasks/client.d.ts.map +1 -1
  29. package/dist/tasks/funding-attempts.d.ts +58 -0
  30. package/dist/tasks/funding-attempts.d.ts.map +1 -0
  31. package/dist/tasks/funding-intent.d.ts +11 -0
  32. package/dist/tasks/funding-intent.d.ts.map +1 -0
  33. package/dist/tasks/index.d.ts +13 -2
  34. package/dist/tasks/index.d.ts.map +1 -1
  35. package/dist/tasks/money.d.ts +2 -0
  36. package/dist/tasks/money.d.ts.map +1 -1
  37. package/dist/tasks/operation-support.d.ts +10 -2
  38. package/dist/tasks/operation-support.d.ts.map +1 -1
  39. package/dist/tasks/operations.d.ts +651 -13
  40. package/dist/tasks/operations.d.ts.map +1 -1
  41. package/dist/tasks/pending-transactions.d.ts +11 -0
  42. package/dist/tasks/pending-transactions.d.ts.map +1 -1
  43. package/dist/tasks/post-options.d.ts +144 -0
  44. package/dist/tasks/post-options.d.ts.map +1 -0
  45. package/dist/tasks/types.d.ts +5505 -74
  46. package/dist/tasks/types.d.ts.map +1 -1
  47. package/dist/tasks/v2-abi.d.ts +12 -0
  48. package/dist/tasks/v2-abi.d.ts.map +1 -0
  49. package/dist/tasks/v2-abi.generated.d.ts +5966 -0
  50. package/dist/tasks/v2-abi.generated.d.ts.map +1 -0
  51. package/dist/tasks/v2-events.d.ts +6460 -0
  52. package/dist/tasks/v2-events.d.ts.map +1 -0
  53. package/dist/tasks/v2-execution.d.ts +1070 -0
  54. package/dist/tasks/v2-execution.d.ts.map +1 -0
  55. package/dist/tasks/v2-jury.d.ts +863 -0
  56. package/dist/tasks/v2-jury.d.ts.map +1 -0
  57. package/dist/tasks/v2-plan-guard.d.ts +100 -0
  58. package/dist/tasks/v2-plan-guard.d.ts.map +1 -0
  59. package/dist/tasks/v2-public.d.ts +154 -0
  60. package/dist/tasks/v2-public.d.ts.map +1 -0
  61. package/dist/tasks/v2-trust.d.ts +27 -0
  62. package/dist/tasks/v2-trust.d.ts.map +1 -0
  63. package/dist/tasks/v2-write.d.ts +886 -0
  64. package/dist/tasks/v2-write.d.ts.map +1 -0
  65. package/dist/tasks/v2.d.ts +847 -0
  66. package/dist/tasks/v2.d.ts.map +1 -0
  67. package/dist/tasks/verbs.d.ts +1 -1
  68. package/dist/tasks/verbs.d.ts.map +1 -1
  69. package/dist/tasks/x402-funding.d.ts +49 -0
  70. package/dist/tasks/x402-funding.d.ts.map +1 -0
  71. package/dist/tasks.js +17541 -4184
  72. package/dist/tasks.js.map +3 -3
  73. package/dist/x402-pay.d.ts +11 -1
  74. package/dist/x402-pay.d.ts.map +1 -1
  75. package/dist/x402.d.ts +6 -0
  76. package/dist/x402.d.ts.map +1 -1
  77. package/package.json +1 -1
@@ -0,0 +1,1070 @@
1
+ import type { SpendCaps } from "../config.js";
2
+ import type { WalletName } from "../wallet-name.js";
3
+ import type { TaskFundingApproval } from "./actions.js";
4
+ import type { TasksChainOptions } from "./chain.js";
5
+ import { type TaskOperationContext } from "./operation-support.js";
6
+ import { type TaskMoney } from "./money.js";
7
+ import { type TaskV2Action, type TaskV2Consent, type TaskV2Prepared } from "./v2-write.js";
8
+ export type TaskV2ExecutionInput = {
9
+ id: string;
10
+ write?: TaskV2Action;
11
+ consent?: TaskV2Consent;
12
+ prepared?: TaskV2Prepared;
13
+ preparationKey?: string;
14
+ expectedGrossBaseUnits?: bigint;
15
+ policy: {
16
+ maxPerTaskUsd: number;
17
+ approveAboveUsd: number;
18
+ };
19
+ caps: SpendCaps;
20
+ wallet: WalletName;
21
+ ledgerPath: string;
22
+ approval?: TaskFundingApproval;
23
+ onMoney?: (money: TaskMoney & {
24
+ escrow: string;
25
+ }) => void | Promise<void>;
26
+ /**
27
+ * Runs right before each transaction is signed or a saved one is reused; a throw stops the
28
+ * step with nothing signed. A vote commit uses it to recheck its sealed dispute round.
29
+ */
30
+ beforeSigning?: () => Promise<void>;
31
+ };
32
+ /**
33
+ * Headroom on the node's gas estimate for every V2 write, in percent (e2e finding F4: jury and
34
+ * snapshot steps whose cost depends on state read at execution ran out of gas at the bare
35
+ * estimate). Unused gas is not charged.
36
+ */
37
+ export declare const TASK_V2_GAS_BUFFER_PERCENT = 25n;
38
+ export declare function bufferedV2Gas(estimate: bigint): bigint;
39
+ /** The API chooses V2, never a local calldata builder. Old adapters keep the V1 path. */
40
+ export declare function taskUsesV2(context: Pick<TaskOperationContext, "client">, id: string): Promise<boolean>;
41
+ export declare function executeTaskV2(context: TaskOperationContext, input: TaskV2ExecutionInput): Promise<{
42
+ operation: {
43
+ id: string;
44
+ kind: "tasks-v2-write";
45
+ state: "confirmed" | "prepared" | "submitted" | "abandoned";
46
+ step: "v2-fund" | "v2-approve-usdc" | "v2-create-pool" | "v2-create-escrow" | "v2-award" | "v2-award-bounty" | "v2-submit" | "v2-approve" | "v2-reject" | "v2-finalize" | "v2-close-rejected" | "v2-bump-consent-nonce" | "v2-prune-reviewer" | "v2-prune-reviewers" | "v2-cancel-offer" | "v2-cancel-remainder" | "v2-expire" | "v2-refund" | "v2-pay-claim" | "v2-raise-dispute" | "v2-counter-evidence" | "v2-resolve-unmatched" | "v2-split" | "v2-open-jury" | "v2-draw-jury" | "v2-rearm-draw" | "v2-resolve" | "v2-commit-vote" | "v2-reveal-vote" | "v2-claim-owed" | "v2-claim-reviewer-fee" | "v2-set-available" | "v2-reactivate";
47
+ expectedActor: `0x${string}`;
48
+ transactionHash: `0x${string}` | null;
49
+ plan: {
50
+ version: "work-transaction-plan-v2";
51
+ operationId: string;
52
+ step: "v2-fund" | "v2-approve-usdc" | "v2-create-pool" | "v2-create-escrow" | "v2-award" | "v2-award-bounty" | "v2-submit" | "v2-approve" | "v2-reject" | "v2-finalize" | "v2-close-rejected" | "v2-bump-consent-nonce" | "v2-prune-reviewer" | "v2-prune-reviewers" | "v2-cancel-offer" | "v2-cancel-remainder" | "v2-expire" | "v2-refund" | "v2-pay-claim" | "v2-raise-dispute" | "v2-counter-evidence" | "v2-resolve-unmatched" | "v2-split" | "v2-open-jury" | "v2-draw-jury" | "v2-rearm-draw" | "v2-resolve" | "v2-commit-vote" | "v2-reveal-vote" | "v2-claim-owed" | "v2-claim-reviewer-fee" | "v2-set-available" | "v2-reactivate";
53
+ chainId: number;
54
+ network: string;
55
+ from: `0x${string}`;
56
+ to: `0x${string}`;
57
+ data: `0x${string}`;
58
+ value: "0";
59
+ };
60
+ };
61
+ lifecycle: {
62
+ [x: string]: unknown;
63
+ state: "Draft" | "Open" | "Active" | "Settled" | "Refunded" | "Cancelled";
64
+ milestones: {
65
+ [x: string]: unknown;
66
+ id: string;
67
+ status: "split" | "released" | "pending" | "submitted" | "refunded" | "disputed";
68
+ amountBaseUnits: string;
69
+ dueAt?: string | undefined;
70
+ cause?: number | undefined;
71
+ disputed?: boolean | undefined;
72
+ disputeWinner?: number | undefined;
73
+ summary?: string | undefined;
74
+ }[];
75
+ shape: "task";
76
+ substate?: "InProgress" | "Submitted" | "Stalled" | "Disputed" | undefined;
77
+ cause?: number | undefined;
78
+ disputed?: boolean | undefined;
79
+ disputeWinner?: number | undefined;
80
+ summary?: string | undefined;
81
+ } | {
82
+ [x: string]: unknown;
83
+ shape: "bounty";
84
+ state: "Draft" | "Open" | "Refunded" | "Cancelled" | "Judging" | "Awarded";
85
+ amountBaseUnits?: string | undefined;
86
+ dueAt?: string | undefined;
87
+ } | {
88
+ [x: string]: unknown;
89
+ shape: "pool";
90
+ state: "Draft" | "Open" | "Paused" | "Closed";
91
+ } | null;
92
+ nextAction: {
93
+ [x: string]: unknown;
94
+ action: "none" | "release" | "award" | "deliver" | "counter-evidence" | "checkin" | "judge";
95
+ amountBaseUnits?: string | undefined;
96
+ dueAt?: string | undefined;
97
+ } | null;
98
+ orderId: string;
99
+ ok: false;
100
+ reason: string;
101
+ money: {
102
+ escrow: `0x${string}`;
103
+ line: string;
104
+ gross: import("./money.js").TaskMoneyAmount;
105
+ fee: import("./money.js").TaskMoneyAmount | null;
106
+ net: import("./money.js").TaskMoneyAmount | null;
107
+ feeBp: number | null;
108
+ };
109
+ } | {
110
+ operationId: string;
111
+ operationState: "prepared";
112
+ lifecycle: {
113
+ [x: string]: unknown;
114
+ state: "Draft" | "Open" | "Active" | "Settled" | "Refunded" | "Cancelled";
115
+ milestones: {
116
+ [x: string]: unknown;
117
+ id: string;
118
+ status: "split" | "released" | "pending" | "submitted" | "refunded" | "disputed";
119
+ amountBaseUnits: string;
120
+ dueAt?: string | undefined;
121
+ cause?: number | undefined;
122
+ disputed?: boolean | undefined;
123
+ disputeWinner?: number | undefined;
124
+ summary?: string | undefined;
125
+ }[];
126
+ shape: "task";
127
+ substate?: "InProgress" | "Submitted" | "Stalled" | "Disputed" | undefined;
128
+ cause?: number | undefined;
129
+ disputed?: boolean | undefined;
130
+ disputeWinner?: number | undefined;
131
+ summary?: string | undefined;
132
+ } | {
133
+ [x: string]: unknown;
134
+ shape: "bounty";
135
+ state: "Draft" | "Open" | "Refunded" | "Cancelled" | "Judging" | "Awarded";
136
+ amountBaseUnits?: string | undefined;
137
+ dueAt?: string | undefined;
138
+ } | {
139
+ [x: string]: unknown;
140
+ shape: "pool";
141
+ state: "Draft" | "Open" | "Paused" | "Closed";
142
+ } | null;
143
+ nextAction: {
144
+ [x: string]: unknown;
145
+ action: "none" | "release" | "award" | "deliver" | "counter-evidence" | "checkin" | "judge";
146
+ amountBaseUnits?: string | undefined;
147
+ dueAt?: string | undefined;
148
+ } | null;
149
+ orderId: string;
150
+ ok: false;
151
+ reason: string;
152
+ money: {
153
+ escrow: `0x${string}`;
154
+ line: string;
155
+ gross: import("./money.js").TaskMoneyAmount;
156
+ fee: import("./money.js").TaskMoneyAmount | null;
157
+ net: import("./money.js").TaskMoneyAmount | null;
158
+ feeBp: number | null;
159
+ };
160
+ } | {
161
+ operation: {
162
+ id: string;
163
+ kind: "tasks-v2-write";
164
+ state: "confirmed" | "prepared" | "submitted" | "abandoned";
165
+ step: "v2-fund" | "v2-approve-usdc" | "v2-create-pool" | "v2-create-escrow" | "v2-award" | "v2-award-bounty" | "v2-submit" | "v2-approve" | "v2-reject" | "v2-finalize" | "v2-close-rejected" | "v2-bump-consent-nonce" | "v2-prune-reviewer" | "v2-prune-reviewers" | "v2-cancel-offer" | "v2-cancel-remainder" | "v2-expire" | "v2-refund" | "v2-pay-claim" | "v2-raise-dispute" | "v2-counter-evidence" | "v2-resolve-unmatched" | "v2-split" | "v2-open-jury" | "v2-draw-jury" | "v2-rearm-draw" | "v2-resolve" | "v2-commit-vote" | "v2-reveal-vote" | "v2-claim-owed" | "v2-claim-reviewer-fee" | "v2-set-available" | "v2-reactivate";
166
+ expectedActor: `0x${string}`;
167
+ transactionHash: `0x${string}` | null;
168
+ plan: {
169
+ version: "work-transaction-plan-v2";
170
+ operationId: string;
171
+ step: "v2-fund" | "v2-approve-usdc" | "v2-create-pool" | "v2-create-escrow" | "v2-award" | "v2-award-bounty" | "v2-submit" | "v2-approve" | "v2-reject" | "v2-finalize" | "v2-close-rejected" | "v2-bump-consent-nonce" | "v2-prune-reviewer" | "v2-prune-reviewers" | "v2-cancel-offer" | "v2-cancel-remainder" | "v2-expire" | "v2-refund" | "v2-pay-claim" | "v2-raise-dispute" | "v2-counter-evidence" | "v2-resolve-unmatched" | "v2-split" | "v2-open-jury" | "v2-draw-jury" | "v2-rearm-draw" | "v2-resolve" | "v2-commit-vote" | "v2-reveal-vote" | "v2-claim-owed" | "v2-claim-reviewer-fee" | "v2-set-available" | "v2-reactivate";
172
+ chainId: number;
173
+ network: string;
174
+ from: `0x${string}`;
175
+ to: `0x${string}`;
176
+ data: `0x${string}`;
177
+ value: "0";
178
+ };
179
+ };
180
+ lifecycle: {
181
+ [x: string]: unknown;
182
+ state: "Draft" | "Open" | "Active" | "Settled" | "Refunded" | "Cancelled";
183
+ milestones: {
184
+ [x: string]: unknown;
185
+ id: string;
186
+ status: "split" | "released" | "pending" | "submitted" | "refunded" | "disputed";
187
+ amountBaseUnits: string;
188
+ dueAt?: string | undefined;
189
+ cause?: number | undefined;
190
+ disputed?: boolean | undefined;
191
+ disputeWinner?: number | undefined;
192
+ summary?: string | undefined;
193
+ }[];
194
+ shape: "task";
195
+ substate?: "InProgress" | "Submitted" | "Stalled" | "Disputed" | undefined;
196
+ cause?: number | undefined;
197
+ disputed?: boolean | undefined;
198
+ disputeWinner?: number | undefined;
199
+ summary?: string | undefined;
200
+ } | {
201
+ [x: string]: unknown;
202
+ shape: "bounty";
203
+ state: "Draft" | "Open" | "Refunded" | "Cancelled" | "Judging" | "Awarded";
204
+ amountBaseUnits?: string | undefined;
205
+ dueAt?: string | undefined;
206
+ } | {
207
+ [x: string]: unknown;
208
+ shape: "pool";
209
+ state: "Draft" | "Open" | "Paused" | "Closed";
210
+ } | null;
211
+ nextAction: {
212
+ [x: string]: unknown;
213
+ action: "none" | "release" | "award" | "deliver" | "counter-evidence" | "checkin" | "judge";
214
+ amountBaseUnits?: string | undefined;
215
+ dueAt?: string | undefined;
216
+ } | null;
217
+ orderId: string;
218
+ ok: false;
219
+ declined: true;
220
+ money: {
221
+ escrow: `0x${string}`;
222
+ line: string;
223
+ gross: import("./money.js").TaskMoneyAmount;
224
+ fee: import("./money.js").TaskMoneyAmount | null;
225
+ net: import("./money.js").TaskMoneyAmount | null;
226
+ feeBp: number | null;
227
+ };
228
+ } | {
229
+ operationId: string;
230
+ operationState: "prepared";
231
+ lifecycle: {
232
+ [x: string]: unknown;
233
+ state: "Draft" | "Open" | "Active" | "Settled" | "Refunded" | "Cancelled";
234
+ milestones: {
235
+ [x: string]: unknown;
236
+ id: string;
237
+ status: "split" | "released" | "pending" | "submitted" | "refunded" | "disputed";
238
+ amountBaseUnits: string;
239
+ dueAt?: string | undefined;
240
+ cause?: number | undefined;
241
+ disputed?: boolean | undefined;
242
+ disputeWinner?: number | undefined;
243
+ summary?: string | undefined;
244
+ }[];
245
+ shape: "task";
246
+ substate?: "InProgress" | "Submitted" | "Stalled" | "Disputed" | undefined;
247
+ cause?: number | undefined;
248
+ disputed?: boolean | undefined;
249
+ disputeWinner?: number | undefined;
250
+ summary?: string | undefined;
251
+ } | {
252
+ [x: string]: unknown;
253
+ shape: "bounty";
254
+ state: "Draft" | "Open" | "Refunded" | "Cancelled" | "Judging" | "Awarded";
255
+ amountBaseUnits?: string | undefined;
256
+ dueAt?: string | undefined;
257
+ } | {
258
+ [x: string]: unknown;
259
+ shape: "pool";
260
+ state: "Draft" | "Open" | "Paused" | "Closed";
261
+ } | null;
262
+ nextAction: {
263
+ [x: string]: unknown;
264
+ action: "none" | "release" | "award" | "deliver" | "counter-evidence" | "checkin" | "judge";
265
+ amountBaseUnits?: string | undefined;
266
+ dueAt?: string | undefined;
267
+ } | null;
268
+ orderId: string;
269
+ ok: false;
270
+ declined: true;
271
+ money: {
272
+ escrow: `0x${string}`;
273
+ line: string;
274
+ gross: import("./money.js").TaskMoneyAmount;
275
+ fee: import("./money.js").TaskMoneyAmount | null;
276
+ net: import("./money.js").TaskMoneyAmount | null;
277
+ feeBp: number | null;
278
+ };
279
+ } | {
280
+ operation: {
281
+ id: string;
282
+ kind: "tasks-v2-write";
283
+ state: "confirmed" | "prepared" | "submitted" | "abandoned";
284
+ step: "v2-fund" | "v2-approve-usdc" | "v2-create-pool" | "v2-create-escrow" | "v2-award" | "v2-award-bounty" | "v2-submit" | "v2-approve" | "v2-reject" | "v2-finalize" | "v2-close-rejected" | "v2-bump-consent-nonce" | "v2-prune-reviewer" | "v2-prune-reviewers" | "v2-cancel-offer" | "v2-cancel-remainder" | "v2-expire" | "v2-refund" | "v2-pay-claim" | "v2-raise-dispute" | "v2-counter-evidence" | "v2-resolve-unmatched" | "v2-split" | "v2-open-jury" | "v2-draw-jury" | "v2-rearm-draw" | "v2-resolve" | "v2-commit-vote" | "v2-reveal-vote" | "v2-claim-owed" | "v2-claim-reviewer-fee" | "v2-set-available" | "v2-reactivate";
285
+ expectedActor: `0x${string}`;
286
+ transactionHash: `0x${string}` | null;
287
+ plan: {
288
+ version: "work-transaction-plan-v2";
289
+ operationId: string;
290
+ step: "v2-fund" | "v2-approve-usdc" | "v2-create-pool" | "v2-create-escrow" | "v2-award" | "v2-award-bounty" | "v2-submit" | "v2-approve" | "v2-reject" | "v2-finalize" | "v2-close-rejected" | "v2-bump-consent-nonce" | "v2-prune-reviewer" | "v2-prune-reviewers" | "v2-cancel-offer" | "v2-cancel-remainder" | "v2-expire" | "v2-refund" | "v2-pay-claim" | "v2-raise-dispute" | "v2-counter-evidence" | "v2-resolve-unmatched" | "v2-split" | "v2-open-jury" | "v2-draw-jury" | "v2-rearm-draw" | "v2-resolve" | "v2-commit-vote" | "v2-reveal-vote" | "v2-claim-owed" | "v2-claim-reviewer-fee" | "v2-set-available" | "v2-reactivate";
291
+ chainId: number;
292
+ network: string;
293
+ from: `0x${string}`;
294
+ to: `0x${string}`;
295
+ data: `0x${string}`;
296
+ value: "0";
297
+ };
298
+ };
299
+ lifecycle: {
300
+ [x: string]: unknown;
301
+ state: "Draft" | "Open" | "Active" | "Settled" | "Refunded" | "Cancelled";
302
+ milestones: {
303
+ [x: string]: unknown;
304
+ id: string;
305
+ status: "split" | "released" | "pending" | "submitted" | "refunded" | "disputed";
306
+ amountBaseUnits: string;
307
+ dueAt?: string | undefined;
308
+ cause?: number | undefined;
309
+ disputed?: boolean | undefined;
310
+ disputeWinner?: number | undefined;
311
+ summary?: string | undefined;
312
+ }[];
313
+ shape: "task";
314
+ substate?: "InProgress" | "Submitted" | "Stalled" | "Disputed" | undefined;
315
+ cause?: number | undefined;
316
+ disputed?: boolean | undefined;
317
+ disputeWinner?: number | undefined;
318
+ summary?: string | undefined;
319
+ } | {
320
+ [x: string]: unknown;
321
+ shape: "bounty";
322
+ state: "Draft" | "Open" | "Refunded" | "Cancelled" | "Judging" | "Awarded";
323
+ amountBaseUnits?: string | undefined;
324
+ dueAt?: string | undefined;
325
+ } | {
326
+ [x: string]: unknown;
327
+ shape: "pool";
328
+ state: "Draft" | "Open" | "Paused" | "Closed";
329
+ } | null;
330
+ nextAction: {
331
+ [x: string]: unknown;
332
+ action: "none" | "release" | "award" | "deliver" | "counter-evidence" | "checkin" | "judge";
333
+ amountBaseUnits?: string | undefined;
334
+ dueAt?: string | undefined;
335
+ } | null;
336
+ orderId: string;
337
+ ok: false;
338
+ approval: true;
339
+ money: {
340
+ escrow: `0x${string}`;
341
+ line: string;
342
+ gross: import("./money.js").TaskMoneyAmount;
343
+ fee: import("./money.js").TaskMoneyAmount | null;
344
+ net: import("./money.js").TaskMoneyAmount | null;
345
+ feeBp: number | null;
346
+ };
347
+ } | {
348
+ operationId: string;
349
+ operationState: "prepared";
350
+ lifecycle: {
351
+ [x: string]: unknown;
352
+ state: "Draft" | "Open" | "Active" | "Settled" | "Refunded" | "Cancelled";
353
+ milestones: {
354
+ [x: string]: unknown;
355
+ id: string;
356
+ status: "split" | "released" | "pending" | "submitted" | "refunded" | "disputed";
357
+ amountBaseUnits: string;
358
+ dueAt?: string | undefined;
359
+ cause?: number | undefined;
360
+ disputed?: boolean | undefined;
361
+ disputeWinner?: number | undefined;
362
+ summary?: string | undefined;
363
+ }[];
364
+ shape: "task";
365
+ substate?: "InProgress" | "Submitted" | "Stalled" | "Disputed" | undefined;
366
+ cause?: number | undefined;
367
+ disputed?: boolean | undefined;
368
+ disputeWinner?: number | undefined;
369
+ summary?: string | undefined;
370
+ } | {
371
+ [x: string]: unknown;
372
+ shape: "bounty";
373
+ state: "Draft" | "Open" | "Refunded" | "Cancelled" | "Judging" | "Awarded";
374
+ amountBaseUnits?: string | undefined;
375
+ dueAt?: string | undefined;
376
+ } | {
377
+ [x: string]: unknown;
378
+ shape: "pool";
379
+ state: "Draft" | "Open" | "Paused" | "Closed";
380
+ } | null;
381
+ nextAction: {
382
+ [x: string]: unknown;
383
+ action: "none" | "release" | "award" | "deliver" | "counter-evidence" | "checkin" | "judge";
384
+ amountBaseUnits?: string | undefined;
385
+ dueAt?: string | undefined;
386
+ } | null;
387
+ orderId: string;
388
+ ok: false;
389
+ approval: true;
390
+ money: {
391
+ escrow: `0x${string}`;
392
+ line: string;
393
+ gross: import("./money.js").TaskMoneyAmount;
394
+ fee: import("./money.js").TaskMoneyAmount | null;
395
+ net: import("./money.js").TaskMoneyAmount | null;
396
+ feeBp: number | null;
397
+ };
398
+ } | {
399
+ lifecycle: {
400
+ [x: string]: unknown;
401
+ state: "Draft" | "Open" | "Active" | "Settled" | "Refunded" | "Cancelled";
402
+ milestones: {
403
+ [x: string]: unknown;
404
+ id: string;
405
+ status: "split" | "released" | "pending" | "submitted" | "refunded" | "disputed";
406
+ amountBaseUnits: string;
407
+ dueAt?: string | undefined;
408
+ cause?: number | undefined;
409
+ disputed?: boolean | undefined;
410
+ disputeWinner?: number | undefined;
411
+ summary?: string | undefined;
412
+ }[];
413
+ shape: "task";
414
+ substate?: "InProgress" | "Submitted" | "Stalled" | "Disputed" | undefined;
415
+ cause?: number | undefined;
416
+ disputed?: boolean | undefined;
417
+ disputeWinner?: number | undefined;
418
+ summary?: string | undefined;
419
+ } | {
420
+ [x: string]: unknown;
421
+ shape: "bounty";
422
+ state: "Draft" | "Open" | "Refunded" | "Cancelled" | "Judging" | "Awarded";
423
+ amountBaseUnits?: string | undefined;
424
+ dueAt?: string | undefined;
425
+ } | {
426
+ [x: string]: unknown;
427
+ shape: "pool";
428
+ state: "Draft" | "Open" | "Paused" | "Closed";
429
+ } | null;
430
+ nextAction: {
431
+ [x: string]: unknown;
432
+ action: "none" | "release" | "award" | "deliver" | "counter-evidence" | "checkin" | "judge";
433
+ amountBaseUnits?: string | undefined;
434
+ dueAt?: string | undefined;
435
+ } | null;
436
+ ok: true;
437
+ money: {
438
+ escrow: `0x${string}`;
439
+ line: string;
440
+ gross: import("./money.js").TaskMoneyAmount;
441
+ fee: import("./money.js").TaskMoneyAmount | null;
442
+ net: import("./money.js").TaskMoneyAmount | null;
443
+ feeBp: number | null;
444
+ };
445
+ kind: "consent";
446
+ workOrderId: string;
447
+ consent: "split" | "award";
448
+ signer: `0x${string}`;
449
+ expiry: string;
450
+ operationId: string;
451
+ operationState: "confirmed";
452
+ } | {
453
+ lifecycle: {
454
+ [x: string]: unknown;
455
+ state: "Draft" | "Open" | "Active" | "Settled" | "Refunded" | "Cancelled";
456
+ milestones: {
457
+ [x: string]: unknown;
458
+ id: string;
459
+ status: "split" | "released" | "pending" | "submitted" | "refunded" | "disputed";
460
+ amountBaseUnits: string;
461
+ dueAt?: string | undefined;
462
+ cause?: number | undefined;
463
+ disputed?: boolean | undefined;
464
+ disputeWinner?: number | undefined;
465
+ summary?: string | undefined;
466
+ }[];
467
+ shape: "task";
468
+ substate?: "InProgress" | "Submitted" | "Stalled" | "Disputed" | undefined;
469
+ cause?: number | undefined;
470
+ disputed?: boolean | undefined;
471
+ disputeWinner?: number | undefined;
472
+ summary?: string | undefined;
473
+ } | {
474
+ [x: string]: unknown;
475
+ shape: "bounty";
476
+ state: "Draft" | "Open" | "Refunded" | "Cancelled" | "Judging" | "Awarded";
477
+ amountBaseUnits?: string | undefined;
478
+ dueAt?: string | undefined;
479
+ } | {
480
+ [x: string]: unknown;
481
+ shape: "pool";
482
+ state: "Draft" | "Open" | "Paused" | "Closed";
483
+ } | null;
484
+ nextAction: {
485
+ [x: string]: unknown;
486
+ action: "none" | "release" | "award" | "deliver" | "counter-evidence" | "checkin" | "judge";
487
+ amountBaseUnits?: string | undefined;
488
+ dueAt?: string | undefined;
489
+ } | null;
490
+ ok: true;
491
+ money: {
492
+ escrow: `0x${string}`;
493
+ line: string;
494
+ gross: import("./money.js").TaskMoneyAmount;
495
+ fee: import("./money.js").TaskMoneyAmount | null;
496
+ net: import("./money.js").TaskMoneyAmount | null;
497
+ feeBp: number | null;
498
+ };
499
+ orderId: string;
500
+ operation: {
501
+ id: string;
502
+ kind: "tasks-v2-write";
503
+ state: "confirmed" | "prepared" | "submitted" | "abandoned";
504
+ step: "v2-fund" | "v2-approve-usdc" | "v2-create-pool" | "v2-create-escrow" | "v2-award" | "v2-award-bounty" | "v2-submit" | "v2-approve" | "v2-reject" | "v2-finalize" | "v2-close-rejected" | "v2-bump-consent-nonce" | "v2-prune-reviewer" | "v2-prune-reviewers" | "v2-cancel-offer" | "v2-cancel-remainder" | "v2-expire" | "v2-refund" | "v2-pay-claim" | "v2-raise-dispute" | "v2-counter-evidence" | "v2-resolve-unmatched" | "v2-split" | "v2-open-jury" | "v2-draw-jury" | "v2-rearm-draw" | "v2-resolve" | "v2-commit-vote" | "v2-reveal-vote" | "v2-claim-owed" | "v2-claim-reviewer-fee" | "v2-set-available" | "v2-reactivate";
505
+ expectedActor: `0x${string}`;
506
+ transactionHash: `0x${string}` | null;
507
+ plan: {
508
+ version: "work-transaction-plan-v2";
509
+ operationId: string;
510
+ step: "v2-fund" | "v2-approve-usdc" | "v2-create-pool" | "v2-create-escrow" | "v2-award" | "v2-award-bounty" | "v2-submit" | "v2-approve" | "v2-reject" | "v2-finalize" | "v2-close-rejected" | "v2-bump-consent-nonce" | "v2-prune-reviewer" | "v2-prune-reviewers" | "v2-cancel-offer" | "v2-cancel-remainder" | "v2-expire" | "v2-refund" | "v2-pay-claim" | "v2-raise-dispute" | "v2-counter-evidence" | "v2-resolve-unmatched" | "v2-split" | "v2-open-jury" | "v2-draw-jury" | "v2-rearm-draw" | "v2-resolve" | "v2-commit-vote" | "v2-reveal-vote" | "v2-claim-owed" | "v2-claim-reviewer-fee" | "v2-set-available" | "v2-reactivate";
511
+ chainId: number;
512
+ network: string;
513
+ from: `0x${string}`;
514
+ to: `0x${string}`;
515
+ data: `0x${string}`;
516
+ value: "0";
517
+ };
518
+ };
519
+ }>;
520
+ /** Exact hosted plans, durable signed bytes, and hosted finality. No ABI encoding occurs here. */
521
+ export declare function createTaskV2Executor(options: TasksChainOptions): (input: TaskV2ExecutionInput) => Promise<{
522
+ operation: {
523
+ id: string;
524
+ kind: "tasks-v2-write";
525
+ state: "confirmed" | "prepared" | "submitted" | "abandoned";
526
+ step: "v2-fund" | "v2-approve-usdc" | "v2-create-pool" | "v2-create-escrow" | "v2-award" | "v2-award-bounty" | "v2-submit" | "v2-approve" | "v2-reject" | "v2-finalize" | "v2-close-rejected" | "v2-bump-consent-nonce" | "v2-prune-reviewer" | "v2-prune-reviewers" | "v2-cancel-offer" | "v2-cancel-remainder" | "v2-expire" | "v2-refund" | "v2-pay-claim" | "v2-raise-dispute" | "v2-counter-evidence" | "v2-resolve-unmatched" | "v2-split" | "v2-open-jury" | "v2-draw-jury" | "v2-rearm-draw" | "v2-resolve" | "v2-commit-vote" | "v2-reveal-vote" | "v2-claim-owed" | "v2-claim-reviewer-fee" | "v2-set-available" | "v2-reactivate";
527
+ expectedActor: `0x${string}`;
528
+ transactionHash: `0x${string}` | null;
529
+ plan: {
530
+ version: "work-transaction-plan-v2";
531
+ operationId: string;
532
+ step: "v2-fund" | "v2-approve-usdc" | "v2-create-pool" | "v2-create-escrow" | "v2-award" | "v2-award-bounty" | "v2-submit" | "v2-approve" | "v2-reject" | "v2-finalize" | "v2-close-rejected" | "v2-bump-consent-nonce" | "v2-prune-reviewer" | "v2-prune-reviewers" | "v2-cancel-offer" | "v2-cancel-remainder" | "v2-expire" | "v2-refund" | "v2-pay-claim" | "v2-raise-dispute" | "v2-counter-evidence" | "v2-resolve-unmatched" | "v2-split" | "v2-open-jury" | "v2-draw-jury" | "v2-rearm-draw" | "v2-resolve" | "v2-commit-vote" | "v2-reveal-vote" | "v2-claim-owed" | "v2-claim-reviewer-fee" | "v2-set-available" | "v2-reactivate";
533
+ chainId: number;
534
+ network: string;
535
+ from: `0x${string}`;
536
+ to: `0x${string}`;
537
+ data: `0x${string}`;
538
+ value: "0";
539
+ };
540
+ };
541
+ lifecycle: {
542
+ [x: string]: unknown;
543
+ state: "Draft" | "Open" | "Active" | "Settled" | "Refunded" | "Cancelled";
544
+ milestones: {
545
+ [x: string]: unknown;
546
+ id: string;
547
+ status: "split" | "released" | "pending" | "submitted" | "refunded" | "disputed";
548
+ amountBaseUnits: string;
549
+ dueAt?: string | undefined;
550
+ cause?: number | undefined;
551
+ disputed?: boolean | undefined;
552
+ disputeWinner?: number | undefined;
553
+ summary?: string | undefined;
554
+ }[];
555
+ shape: "task";
556
+ substate?: "InProgress" | "Submitted" | "Stalled" | "Disputed" | undefined;
557
+ cause?: number | undefined;
558
+ disputed?: boolean | undefined;
559
+ disputeWinner?: number | undefined;
560
+ summary?: string | undefined;
561
+ } | {
562
+ [x: string]: unknown;
563
+ shape: "bounty";
564
+ state: "Draft" | "Open" | "Refunded" | "Cancelled" | "Judging" | "Awarded";
565
+ amountBaseUnits?: string | undefined;
566
+ dueAt?: string | undefined;
567
+ } | {
568
+ [x: string]: unknown;
569
+ shape: "pool";
570
+ state: "Draft" | "Open" | "Paused" | "Closed";
571
+ } | null;
572
+ nextAction: {
573
+ [x: string]: unknown;
574
+ action: "none" | "release" | "award" | "deliver" | "counter-evidence" | "checkin" | "judge";
575
+ amountBaseUnits?: string | undefined;
576
+ dueAt?: string | undefined;
577
+ } | null;
578
+ orderId: string;
579
+ ok: false;
580
+ reason: string;
581
+ money: {
582
+ escrow: `0x${string}`;
583
+ line: string;
584
+ gross: import("./money.js").TaskMoneyAmount;
585
+ fee: import("./money.js").TaskMoneyAmount | null;
586
+ net: import("./money.js").TaskMoneyAmount | null;
587
+ feeBp: number | null;
588
+ };
589
+ } | {
590
+ operationId: string;
591
+ operationState: "prepared";
592
+ lifecycle: {
593
+ [x: string]: unknown;
594
+ state: "Draft" | "Open" | "Active" | "Settled" | "Refunded" | "Cancelled";
595
+ milestones: {
596
+ [x: string]: unknown;
597
+ id: string;
598
+ status: "split" | "released" | "pending" | "submitted" | "refunded" | "disputed";
599
+ amountBaseUnits: string;
600
+ dueAt?: string | undefined;
601
+ cause?: number | undefined;
602
+ disputed?: boolean | undefined;
603
+ disputeWinner?: number | undefined;
604
+ summary?: string | undefined;
605
+ }[];
606
+ shape: "task";
607
+ substate?: "InProgress" | "Submitted" | "Stalled" | "Disputed" | undefined;
608
+ cause?: number | undefined;
609
+ disputed?: boolean | undefined;
610
+ disputeWinner?: number | undefined;
611
+ summary?: string | undefined;
612
+ } | {
613
+ [x: string]: unknown;
614
+ shape: "bounty";
615
+ state: "Draft" | "Open" | "Refunded" | "Cancelled" | "Judging" | "Awarded";
616
+ amountBaseUnits?: string | undefined;
617
+ dueAt?: string | undefined;
618
+ } | {
619
+ [x: string]: unknown;
620
+ shape: "pool";
621
+ state: "Draft" | "Open" | "Paused" | "Closed";
622
+ } | null;
623
+ nextAction: {
624
+ [x: string]: unknown;
625
+ action: "none" | "release" | "award" | "deliver" | "counter-evidence" | "checkin" | "judge";
626
+ amountBaseUnits?: string | undefined;
627
+ dueAt?: string | undefined;
628
+ } | null;
629
+ orderId: string;
630
+ ok: false;
631
+ reason: string;
632
+ money: {
633
+ escrow: `0x${string}`;
634
+ line: string;
635
+ gross: import("./money.js").TaskMoneyAmount;
636
+ fee: import("./money.js").TaskMoneyAmount | null;
637
+ net: import("./money.js").TaskMoneyAmount | null;
638
+ feeBp: number | null;
639
+ };
640
+ } | {
641
+ operation: {
642
+ id: string;
643
+ kind: "tasks-v2-write";
644
+ state: "confirmed" | "prepared" | "submitted" | "abandoned";
645
+ step: "v2-fund" | "v2-approve-usdc" | "v2-create-pool" | "v2-create-escrow" | "v2-award" | "v2-award-bounty" | "v2-submit" | "v2-approve" | "v2-reject" | "v2-finalize" | "v2-close-rejected" | "v2-bump-consent-nonce" | "v2-prune-reviewer" | "v2-prune-reviewers" | "v2-cancel-offer" | "v2-cancel-remainder" | "v2-expire" | "v2-refund" | "v2-pay-claim" | "v2-raise-dispute" | "v2-counter-evidence" | "v2-resolve-unmatched" | "v2-split" | "v2-open-jury" | "v2-draw-jury" | "v2-rearm-draw" | "v2-resolve" | "v2-commit-vote" | "v2-reveal-vote" | "v2-claim-owed" | "v2-claim-reviewer-fee" | "v2-set-available" | "v2-reactivate";
646
+ expectedActor: `0x${string}`;
647
+ transactionHash: `0x${string}` | null;
648
+ plan: {
649
+ version: "work-transaction-plan-v2";
650
+ operationId: string;
651
+ step: "v2-fund" | "v2-approve-usdc" | "v2-create-pool" | "v2-create-escrow" | "v2-award" | "v2-award-bounty" | "v2-submit" | "v2-approve" | "v2-reject" | "v2-finalize" | "v2-close-rejected" | "v2-bump-consent-nonce" | "v2-prune-reviewer" | "v2-prune-reviewers" | "v2-cancel-offer" | "v2-cancel-remainder" | "v2-expire" | "v2-refund" | "v2-pay-claim" | "v2-raise-dispute" | "v2-counter-evidence" | "v2-resolve-unmatched" | "v2-split" | "v2-open-jury" | "v2-draw-jury" | "v2-rearm-draw" | "v2-resolve" | "v2-commit-vote" | "v2-reveal-vote" | "v2-claim-owed" | "v2-claim-reviewer-fee" | "v2-set-available" | "v2-reactivate";
652
+ chainId: number;
653
+ network: string;
654
+ from: `0x${string}`;
655
+ to: `0x${string}`;
656
+ data: `0x${string}`;
657
+ value: "0";
658
+ };
659
+ };
660
+ lifecycle: {
661
+ [x: string]: unknown;
662
+ state: "Draft" | "Open" | "Active" | "Settled" | "Refunded" | "Cancelled";
663
+ milestones: {
664
+ [x: string]: unknown;
665
+ id: string;
666
+ status: "split" | "released" | "pending" | "submitted" | "refunded" | "disputed";
667
+ amountBaseUnits: string;
668
+ dueAt?: string | undefined;
669
+ cause?: number | undefined;
670
+ disputed?: boolean | undefined;
671
+ disputeWinner?: number | undefined;
672
+ summary?: string | undefined;
673
+ }[];
674
+ shape: "task";
675
+ substate?: "InProgress" | "Submitted" | "Stalled" | "Disputed" | undefined;
676
+ cause?: number | undefined;
677
+ disputed?: boolean | undefined;
678
+ disputeWinner?: number | undefined;
679
+ summary?: string | undefined;
680
+ } | {
681
+ [x: string]: unknown;
682
+ shape: "bounty";
683
+ state: "Draft" | "Open" | "Refunded" | "Cancelled" | "Judging" | "Awarded";
684
+ amountBaseUnits?: string | undefined;
685
+ dueAt?: string | undefined;
686
+ } | {
687
+ [x: string]: unknown;
688
+ shape: "pool";
689
+ state: "Draft" | "Open" | "Paused" | "Closed";
690
+ } | null;
691
+ nextAction: {
692
+ [x: string]: unknown;
693
+ action: "none" | "release" | "award" | "deliver" | "counter-evidence" | "checkin" | "judge";
694
+ amountBaseUnits?: string | undefined;
695
+ dueAt?: string | undefined;
696
+ } | null;
697
+ orderId: string;
698
+ ok: false;
699
+ declined: true;
700
+ money: {
701
+ escrow: `0x${string}`;
702
+ line: string;
703
+ gross: import("./money.js").TaskMoneyAmount;
704
+ fee: import("./money.js").TaskMoneyAmount | null;
705
+ net: import("./money.js").TaskMoneyAmount | null;
706
+ feeBp: number | null;
707
+ };
708
+ } | {
709
+ operationId: string;
710
+ operationState: "prepared";
711
+ lifecycle: {
712
+ [x: string]: unknown;
713
+ state: "Draft" | "Open" | "Active" | "Settled" | "Refunded" | "Cancelled";
714
+ milestones: {
715
+ [x: string]: unknown;
716
+ id: string;
717
+ status: "split" | "released" | "pending" | "submitted" | "refunded" | "disputed";
718
+ amountBaseUnits: string;
719
+ dueAt?: string | undefined;
720
+ cause?: number | undefined;
721
+ disputed?: boolean | undefined;
722
+ disputeWinner?: number | undefined;
723
+ summary?: string | undefined;
724
+ }[];
725
+ shape: "task";
726
+ substate?: "InProgress" | "Submitted" | "Stalled" | "Disputed" | undefined;
727
+ cause?: number | undefined;
728
+ disputed?: boolean | undefined;
729
+ disputeWinner?: number | undefined;
730
+ summary?: string | undefined;
731
+ } | {
732
+ [x: string]: unknown;
733
+ shape: "bounty";
734
+ state: "Draft" | "Open" | "Refunded" | "Cancelled" | "Judging" | "Awarded";
735
+ amountBaseUnits?: string | undefined;
736
+ dueAt?: string | undefined;
737
+ } | {
738
+ [x: string]: unknown;
739
+ shape: "pool";
740
+ state: "Draft" | "Open" | "Paused" | "Closed";
741
+ } | null;
742
+ nextAction: {
743
+ [x: string]: unknown;
744
+ action: "none" | "release" | "award" | "deliver" | "counter-evidence" | "checkin" | "judge";
745
+ amountBaseUnits?: string | undefined;
746
+ dueAt?: string | undefined;
747
+ } | null;
748
+ orderId: string;
749
+ ok: false;
750
+ declined: true;
751
+ money: {
752
+ escrow: `0x${string}`;
753
+ line: string;
754
+ gross: import("./money.js").TaskMoneyAmount;
755
+ fee: import("./money.js").TaskMoneyAmount | null;
756
+ net: import("./money.js").TaskMoneyAmount | null;
757
+ feeBp: number | null;
758
+ };
759
+ } | {
760
+ operation: {
761
+ id: string;
762
+ kind: "tasks-v2-write";
763
+ state: "confirmed" | "prepared" | "submitted" | "abandoned";
764
+ step: "v2-fund" | "v2-approve-usdc" | "v2-create-pool" | "v2-create-escrow" | "v2-award" | "v2-award-bounty" | "v2-submit" | "v2-approve" | "v2-reject" | "v2-finalize" | "v2-close-rejected" | "v2-bump-consent-nonce" | "v2-prune-reviewer" | "v2-prune-reviewers" | "v2-cancel-offer" | "v2-cancel-remainder" | "v2-expire" | "v2-refund" | "v2-pay-claim" | "v2-raise-dispute" | "v2-counter-evidence" | "v2-resolve-unmatched" | "v2-split" | "v2-open-jury" | "v2-draw-jury" | "v2-rearm-draw" | "v2-resolve" | "v2-commit-vote" | "v2-reveal-vote" | "v2-claim-owed" | "v2-claim-reviewer-fee" | "v2-set-available" | "v2-reactivate";
765
+ expectedActor: `0x${string}`;
766
+ transactionHash: `0x${string}` | null;
767
+ plan: {
768
+ version: "work-transaction-plan-v2";
769
+ operationId: string;
770
+ step: "v2-fund" | "v2-approve-usdc" | "v2-create-pool" | "v2-create-escrow" | "v2-award" | "v2-award-bounty" | "v2-submit" | "v2-approve" | "v2-reject" | "v2-finalize" | "v2-close-rejected" | "v2-bump-consent-nonce" | "v2-prune-reviewer" | "v2-prune-reviewers" | "v2-cancel-offer" | "v2-cancel-remainder" | "v2-expire" | "v2-refund" | "v2-pay-claim" | "v2-raise-dispute" | "v2-counter-evidence" | "v2-resolve-unmatched" | "v2-split" | "v2-open-jury" | "v2-draw-jury" | "v2-rearm-draw" | "v2-resolve" | "v2-commit-vote" | "v2-reveal-vote" | "v2-claim-owed" | "v2-claim-reviewer-fee" | "v2-set-available" | "v2-reactivate";
771
+ chainId: number;
772
+ network: string;
773
+ from: `0x${string}`;
774
+ to: `0x${string}`;
775
+ data: `0x${string}`;
776
+ value: "0";
777
+ };
778
+ };
779
+ lifecycle: {
780
+ [x: string]: unknown;
781
+ state: "Draft" | "Open" | "Active" | "Settled" | "Refunded" | "Cancelled";
782
+ milestones: {
783
+ [x: string]: unknown;
784
+ id: string;
785
+ status: "split" | "released" | "pending" | "submitted" | "refunded" | "disputed";
786
+ amountBaseUnits: string;
787
+ dueAt?: string | undefined;
788
+ cause?: number | undefined;
789
+ disputed?: boolean | undefined;
790
+ disputeWinner?: number | undefined;
791
+ summary?: string | undefined;
792
+ }[];
793
+ shape: "task";
794
+ substate?: "InProgress" | "Submitted" | "Stalled" | "Disputed" | undefined;
795
+ cause?: number | undefined;
796
+ disputed?: boolean | undefined;
797
+ disputeWinner?: number | undefined;
798
+ summary?: string | undefined;
799
+ } | {
800
+ [x: string]: unknown;
801
+ shape: "bounty";
802
+ state: "Draft" | "Open" | "Refunded" | "Cancelled" | "Judging" | "Awarded";
803
+ amountBaseUnits?: string | undefined;
804
+ dueAt?: string | undefined;
805
+ } | {
806
+ [x: string]: unknown;
807
+ shape: "pool";
808
+ state: "Draft" | "Open" | "Paused" | "Closed";
809
+ } | null;
810
+ nextAction: {
811
+ [x: string]: unknown;
812
+ action: "none" | "release" | "award" | "deliver" | "counter-evidence" | "checkin" | "judge";
813
+ amountBaseUnits?: string | undefined;
814
+ dueAt?: string | undefined;
815
+ } | null;
816
+ orderId: string;
817
+ ok: false;
818
+ approval: true;
819
+ money: {
820
+ escrow: `0x${string}`;
821
+ line: string;
822
+ gross: import("./money.js").TaskMoneyAmount;
823
+ fee: import("./money.js").TaskMoneyAmount | null;
824
+ net: import("./money.js").TaskMoneyAmount | null;
825
+ feeBp: number | null;
826
+ };
827
+ } | {
828
+ operationId: string;
829
+ operationState: "prepared";
830
+ lifecycle: {
831
+ [x: string]: unknown;
832
+ state: "Draft" | "Open" | "Active" | "Settled" | "Refunded" | "Cancelled";
833
+ milestones: {
834
+ [x: string]: unknown;
835
+ id: string;
836
+ status: "split" | "released" | "pending" | "submitted" | "refunded" | "disputed";
837
+ amountBaseUnits: string;
838
+ dueAt?: string | undefined;
839
+ cause?: number | undefined;
840
+ disputed?: boolean | undefined;
841
+ disputeWinner?: number | undefined;
842
+ summary?: string | undefined;
843
+ }[];
844
+ shape: "task";
845
+ substate?: "InProgress" | "Submitted" | "Stalled" | "Disputed" | undefined;
846
+ cause?: number | undefined;
847
+ disputed?: boolean | undefined;
848
+ disputeWinner?: number | undefined;
849
+ summary?: string | undefined;
850
+ } | {
851
+ [x: string]: unknown;
852
+ shape: "bounty";
853
+ state: "Draft" | "Open" | "Refunded" | "Cancelled" | "Judging" | "Awarded";
854
+ amountBaseUnits?: string | undefined;
855
+ dueAt?: string | undefined;
856
+ } | {
857
+ [x: string]: unknown;
858
+ shape: "pool";
859
+ state: "Draft" | "Open" | "Paused" | "Closed";
860
+ } | null;
861
+ nextAction: {
862
+ [x: string]: unknown;
863
+ action: "none" | "release" | "award" | "deliver" | "counter-evidence" | "checkin" | "judge";
864
+ amountBaseUnits?: string | undefined;
865
+ dueAt?: string | undefined;
866
+ } | null;
867
+ orderId: string;
868
+ ok: false;
869
+ approval: true;
870
+ money: {
871
+ escrow: `0x${string}`;
872
+ line: string;
873
+ gross: import("./money.js").TaskMoneyAmount;
874
+ fee: import("./money.js").TaskMoneyAmount | null;
875
+ net: import("./money.js").TaskMoneyAmount | null;
876
+ feeBp: number | null;
877
+ };
878
+ } | {
879
+ lifecycle: {
880
+ [x: string]: unknown;
881
+ state: "Draft" | "Open" | "Active" | "Settled" | "Refunded" | "Cancelled";
882
+ milestones: {
883
+ [x: string]: unknown;
884
+ id: string;
885
+ status: "split" | "released" | "pending" | "submitted" | "refunded" | "disputed";
886
+ amountBaseUnits: string;
887
+ dueAt?: string | undefined;
888
+ cause?: number | undefined;
889
+ disputed?: boolean | undefined;
890
+ disputeWinner?: number | undefined;
891
+ summary?: string | undefined;
892
+ }[];
893
+ shape: "task";
894
+ substate?: "InProgress" | "Submitted" | "Stalled" | "Disputed" | undefined;
895
+ cause?: number | undefined;
896
+ disputed?: boolean | undefined;
897
+ disputeWinner?: number | undefined;
898
+ summary?: string | undefined;
899
+ } | {
900
+ [x: string]: unknown;
901
+ shape: "bounty";
902
+ state: "Draft" | "Open" | "Refunded" | "Cancelled" | "Judging" | "Awarded";
903
+ amountBaseUnits?: string | undefined;
904
+ dueAt?: string | undefined;
905
+ } | {
906
+ [x: string]: unknown;
907
+ shape: "pool";
908
+ state: "Draft" | "Open" | "Paused" | "Closed";
909
+ } | null;
910
+ nextAction: {
911
+ [x: string]: unknown;
912
+ action: "none" | "release" | "award" | "deliver" | "counter-evidence" | "checkin" | "judge";
913
+ amountBaseUnits?: string | undefined;
914
+ dueAt?: string | undefined;
915
+ } | null;
916
+ ok: true;
917
+ money: {
918
+ escrow: `0x${string}`;
919
+ line: string;
920
+ gross: import("./money.js").TaskMoneyAmount;
921
+ fee: import("./money.js").TaskMoneyAmount | null;
922
+ net: import("./money.js").TaskMoneyAmount | null;
923
+ feeBp: number | null;
924
+ };
925
+ kind: "consent";
926
+ workOrderId: string;
927
+ consent: "split" | "award";
928
+ signer: `0x${string}`;
929
+ expiry: string;
930
+ operationId: string;
931
+ operationState: "confirmed";
932
+ } | {
933
+ lifecycle: {
934
+ [x: string]: unknown;
935
+ state: "Draft" | "Open" | "Active" | "Settled" | "Refunded" | "Cancelled";
936
+ milestones: {
937
+ [x: string]: unknown;
938
+ id: string;
939
+ status: "split" | "released" | "pending" | "submitted" | "refunded" | "disputed";
940
+ amountBaseUnits: string;
941
+ dueAt?: string | undefined;
942
+ cause?: number | undefined;
943
+ disputed?: boolean | undefined;
944
+ disputeWinner?: number | undefined;
945
+ summary?: string | undefined;
946
+ }[];
947
+ shape: "task";
948
+ substate?: "InProgress" | "Submitted" | "Stalled" | "Disputed" | undefined;
949
+ cause?: number | undefined;
950
+ disputed?: boolean | undefined;
951
+ disputeWinner?: number | undefined;
952
+ summary?: string | undefined;
953
+ } | {
954
+ [x: string]: unknown;
955
+ shape: "bounty";
956
+ state: "Draft" | "Open" | "Refunded" | "Cancelled" | "Judging" | "Awarded";
957
+ amountBaseUnits?: string | undefined;
958
+ dueAt?: string | undefined;
959
+ } | {
960
+ [x: string]: unknown;
961
+ shape: "pool";
962
+ state: "Draft" | "Open" | "Paused" | "Closed";
963
+ } | null;
964
+ nextAction: {
965
+ [x: string]: unknown;
966
+ action: "none" | "release" | "award" | "deliver" | "counter-evidence" | "checkin" | "judge";
967
+ amountBaseUnits?: string | undefined;
968
+ dueAt?: string | undefined;
969
+ } | null;
970
+ ok: true;
971
+ money: {
972
+ escrow: `0x${string}`;
973
+ line: string;
974
+ gross: import("./money.js").TaskMoneyAmount;
975
+ fee: import("./money.js").TaskMoneyAmount | null;
976
+ net: import("./money.js").TaskMoneyAmount | null;
977
+ feeBp: number | null;
978
+ };
979
+ orderId: string;
980
+ operation: {
981
+ id: string;
982
+ kind: "tasks-v2-write";
983
+ state: "confirmed" | "prepared" | "submitted" | "abandoned";
984
+ step: "v2-fund" | "v2-approve-usdc" | "v2-create-pool" | "v2-create-escrow" | "v2-award" | "v2-award-bounty" | "v2-submit" | "v2-approve" | "v2-reject" | "v2-finalize" | "v2-close-rejected" | "v2-bump-consent-nonce" | "v2-prune-reviewer" | "v2-prune-reviewers" | "v2-cancel-offer" | "v2-cancel-remainder" | "v2-expire" | "v2-refund" | "v2-pay-claim" | "v2-raise-dispute" | "v2-counter-evidence" | "v2-resolve-unmatched" | "v2-split" | "v2-open-jury" | "v2-draw-jury" | "v2-rearm-draw" | "v2-resolve" | "v2-commit-vote" | "v2-reveal-vote" | "v2-claim-owed" | "v2-claim-reviewer-fee" | "v2-set-available" | "v2-reactivate";
985
+ expectedActor: `0x${string}`;
986
+ transactionHash: `0x${string}` | null;
987
+ plan: {
988
+ version: "work-transaction-plan-v2";
989
+ operationId: string;
990
+ step: "v2-fund" | "v2-approve-usdc" | "v2-create-pool" | "v2-create-escrow" | "v2-award" | "v2-award-bounty" | "v2-submit" | "v2-approve" | "v2-reject" | "v2-finalize" | "v2-close-rejected" | "v2-bump-consent-nonce" | "v2-prune-reviewer" | "v2-prune-reviewers" | "v2-cancel-offer" | "v2-cancel-remainder" | "v2-expire" | "v2-refund" | "v2-pay-claim" | "v2-raise-dispute" | "v2-counter-evidence" | "v2-resolve-unmatched" | "v2-split" | "v2-open-jury" | "v2-draw-jury" | "v2-rearm-draw" | "v2-resolve" | "v2-commit-vote" | "v2-reveal-vote" | "v2-claim-owed" | "v2-claim-reviewer-fee" | "v2-set-available" | "v2-reactivate";
991
+ chainId: number;
992
+ network: string;
993
+ from: `0x${string}`;
994
+ to: `0x${string}`;
995
+ data: `0x${string}`;
996
+ value: "0";
997
+ };
998
+ };
999
+ }>;
1000
+ /** Resume bounded hosted scans without assuming a WorkMilestone row exists. */
1001
+ export declare function recoverTaskV2(context: TaskOperationContext & {
1002
+ sleep?: (ms: number) => Promise<void>;
1003
+ }, input: {
1004
+ id: string;
1005
+ operationId: string;
1006
+ step: string;
1007
+ abandon?: boolean;
1008
+ }): Promise<{
1009
+ lifecycle: {
1010
+ [x: string]: unknown;
1011
+ state: "Draft" | "Open" | "Active" | "Settled" | "Refunded" | "Cancelled";
1012
+ milestones: {
1013
+ [x: string]: unknown;
1014
+ id: string;
1015
+ status: "split" | "released" | "pending" | "submitted" | "refunded" | "disputed";
1016
+ amountBaseUnits: string;
1017
+ dueAt?: string | undefined;
1018
+ cause?: number | undefined;
1019
+ disputed?: boolean | undefined;
1020
+ disputeWinner?: number | undefined;
1021
+ summary?: string | undefined;
1022
+ }[];
1023
+ shape: "task";
1024
+ substate?: "InProgress" | "Submitted" | "Stalled" | "Disputed" | undefined;
1025
+ cause?: number | undefined;
1026
+ disputed?: boolean | undefined;
1027
+ disputeWinner?: number | undefined;
1028
+ summary?: string | undefined;
1029
+ } | {
1030
+ [x: string]: unknown;
1031
+ shape: "bounty";
1032
+ state: "Draft" | "Open" | "Refunded" | "Cancelled" | "Judging" | "Awarded";
1033
+ amountBaseUnits?: string | undefined;
1034
+ dueAt?: string | undefined;
1035
+ } | {
1036
+ [x: string]: unknown;
1037
+ shape: "pool";
1038
+ state: "Draft" | "Open" | "Paused" | "Closed";
1039
+ } | null;
1040
+ nextAction: {
1041
+ [x: string]: unknown;
1042
+ action: "none" | "release" | "award" | "deliver" | "counter-evidence" | "checkin" | "judge";
1043
+ amountBaseUnits?: string | undefined;
1044
+ dueAt?: string | undefined;
1045
+ } | null;
1046
+ outcome?: "recovered" | "abandoned" | "scanning" | undefined;
1047
+ scanComplete?: boolean | undefined;
1048
+ recovered?: boolean | undefined;
1049
+ operation?: {
1050
+ id: string;
1051
+ kind: "tasks-v2-write";
1052
+ state: "confirmed" | "prepared" | "submitted" | "abandoned";
1053
+ step: "v2-fund" | "v2-approve-usdc" | "v2-create-pool" | "v2-create-escrow" | "v2-award" | "v2-award-bounty" | "v2-submit" | "v2-approve" | "v2-reject" | "v2-finalize" | "v2-close-rejected" | "v2-bump-consent-nonce" | "v2-prune-reviewer" | "v2-prune-reviewers" | "v2-cancel-offer" | "v2-cancel-remainder" | "v2-expire" | "v2-refund" | "v2-pay-claim" | "v2-raise-dispute" | "v2-counter-evidence" | "v2-resolve-unmatched" | "v2-split" | "v2-open-jury" | "v2-draw-jury" | "v2-rearm-draw" | "v2-resolve" | "v2-commit-vote" | "v2-reveal-vote" | "v2-claim-owed" | "v2-claim-reviewer-fee" | "v2-set-available" | "v2-reactivate";
1054
+ expectedActor: `0x${string}`;
1055
+ transactionHash: `0x${string}` | null;
1056
+ plan: {
1057
+ version: "work-transaction-plan-v2";
1058
+ operationId: string;
1059
+ step: "v2-fund" | "v2-approve-usdc" | "v2-create-pool" | "v2-create-escrow" | "v2-award" | "v2-award-bounty" | "v2-submit" | "v2-approve" | "v2-reject" | "v2-finalize" | "v2-close-rejected" | "v2-bump-consent-nonce" | "v2-prune-reviewer" | "v2-prune-reviewers" | "v2-cancel-offer" | "v2-cancel-remainder" | "v2-expire" | "v2-refund" | "v2-pay-claim" | "v2-raise-dispute" | "v2-counter-evidence" | "v2-resolve-unmatched" | "v2-split" | "v2-open-jury" | "v2-draw-jury" | "v2-rearm-draw" | "v2-resolve" | "v2-commit-vote" | "v2-reveal-vote" | "v2-claim-owed" | "v2-claim-reviewer-fee" | "v2-set-available" | "v2-reactivate";
1060
+ chainId: number;
1061
+ network: string;
1062
+ from: `0x${string}`;
1063
+ to: `0x${string}`;
1064
+ data: `0x${string}`;
1065
+ value: "0";
1066
+ };
1067
+ } | null | undefined;
1068
+ orderId: string;
1069
+ }>;
1070
+ //# sourceMappingURL=v2-execution.d.ts.map