@ottochain/sdk 2.2.1 → 2.2.3

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 (28) hide show
  1. package/dist/cjs/apps/contracts/state-machines/index.js +8 -1016
  2. package/dist/cjs/apps/corporate/state-machines/index.js +7 -17
  3. package/dist/cjs/apps/governance/state-machines/index.js +11 -12
  4. package/dist/cjs/apps/identity/state-machines/index.js +3 -10
  5. package/dist/cjs/apps/markets/state-machines/index.js +7 -8
  6. package/dist/cjs/index.js +2 -1
  7. package/dist/cjs/ottochain/normalize.js +17 -1
  8. package/dist/cjs/schema/fiber-app.js +4 -3
  9. package/dist/esm/apps/contracts/state-machines/index.js +5 -1016
  10. package/dist/esm/apps/corporate/state-machines/index.js +6 -16
  11. package/dist/esm/apps/governance/state-machines/index.js +8 -9
  12. package/dist/esm/apps/identity/state-machines/index.js +5 -12
  13. package/dist/esm/apps/markets/state-machines/index.js +7 -8
  14. package/dist/esm/index.js +1 -1
  15. package/dist/esm/ottochain/normalize.js +17 -1
  16. package/dist/esm/schema/fiber-app.js +4 -3
  17. package/dist/types/apps/contracts/index.d.ts +1058 -743
  18. package/dist/types/apps/contracts/state-machines/index.d.ts +5 -799
  19. package/dist/types/apps/corporate/index.d.ts +5 -6
  20. package/dist/types/apps/corporate/state-machines/index.d.ts +6 -5447
  21. package/dist/types/apps/governance/index.d.ts +30 -36
  22. package/dist/types/apps/governance/state-machines/index.d.ts +8 -9
  23. package/dist/types/apps/identity/index.d.ts +3 -1
  24. package/dist/types/apps/identity/state-machines/index.d.ts +5 -1096
  25. package/dist/types/apps/markets/index.d.ts +8 -6
  26. package/dist/types/apps/markets/state-machines/index.d.ts +7 -8
  27. package/dist/types/index.d.ts +1 -1
  28. package/package.json +1 -1
@@ -20,805 +20,1120 @@
20
20
  */
21
21
  export { ContractState, Contract, ProposeContractRequest, AcceptContractRequest, CompleteContractRequest, RejectContractRequest, DisputeContractRequest, ContractDefinition, contractStateFromJSON, contractStateToJSON, } from "../../generated/ottochain/apps/contracts/v1/contract.js";
22
22
  import { contractUniversalDef, contractAgreementDef, contractEscrowDef } from "./state-machines/index.js";
23
+ import type { FiberAppDefinition } from "../../schema/fiber-app.js";
23
24
  export { contractUniversalDef, contractAgreementDef, contractEscrowDef };
24
25
  /** All contract state machine definitions */
25
26
  export declare const CONTRACTS_DEFINITIONS: {
26
27
  readonly universal: {
27
- readonly metadata: {
28
- readonly name: "ContractUniversal";
29
- readonly description: "Minimal contract state machine - extend for custom use cases";
30
- readonly version: "1.0.0";
31
- readonly app: "contracts";
32
- readonly type: "universal";
28
+ metadata: {
29
+ name: string;
30
+ app: string;
31
+ type: string;
32
+ version: string;
33
+ description: string;
33
34
  };
34
- readonly createSchema: {
35
- readonly properties: {};
35
+ createSchema: {
36
+ properties: {};
36
37
  };
37
- readonly stateSchema: {
38
- readonly properties: {
39
- readonly status: {
40
- readonly type: "string";
38
+ stateSchema: {
39
+ properties: {
40
+ status: {
41
+ type: "string";
42
+ };
43
+ acceptedAt: {
44
+ type: "integer";
45
+ nullable: true;
46
+ };
47
+ cancelledAt: {
48
+ type: "integer";
49
+ nullable: true;
50
+ };
51
+ completedAt: {
52
+ type: "integer";
53
+ nullable: true;
41
54
  };
42
55
  };
43
56
  };
44
- readonly eventSchemas: {
45
- readonly accept: {};
46
- readonly cancel: {};
47
- readonly complete: {};
57
+ eventSchemas: {
58
+ accept: {};
59
+ cancel: {};
60
+ complete: {};
48
61
  };
49
- readonly states: {
50
- readonly PROPOSED: {
51
- readonly id: "PROPOSED";
52
- readonly isFinal: false;
53
- readonly metadata: null;
54
- };
55
- readonly ACTIVE: {
56
- readonly id: "ACTIVE";
57
- readonly isFinal: false;
58
- readonly metadata: null;
59
- };
60
- readonly COMPLETED: {
61
- readonly id: "COMPLETED";
62
- readonly isFinal: true;
63
- readonly metadata: null;
64
- };
65
- readonly CANCELLED: {
66
- readonly id: "CANCELLED";
67
- readonly isFinal: true;
68
- readonly metadata: null;
62
+ states: {
63
+ PROPOSED: {
64
+ id: string;
65
+ isFinal: false;
66
+ metadata: null;
67
+ };
68
+ ACTIVE: {
69
+ id: string;
70
+ isFinal: false;
71
+ metadata: null;
72
+ };
73
+ COMPLETED: {
74
+ id: string;
75
+ isFinal: true;
76
+ metadata: null;
77
+ };
78
+ CANCELLED: {
79
+ id: string;
80
+ isFinal: true;
81
+ metadata: null;
69
82
  };
70
83
  };
71
- readonly initialState: "PROPOSED";
72
- readonly transitions: readonly [{
73
- readonly from: "PROPOSED";
74
- readonly to: "ACTIVE";
75
- readonly eventName: "accept";
76
- readonly guard: {
77
- readonly "==": readonly [1, 1];
78
- };
79
- readonly effect: {
80
- readonly merge: readonly [{
81
- readonly var: "state";
82
- }, {
83
- readonly status: "ACTIVE";
84
- readonly acceptedAt: {
85
- readonly var: "$timestamp";
86
- };
87
- }];
88
- };
89
- readonly dependencies: readonly [];
90
- }, {
91
- readonly from: "PROPOSED";
92
- readonly to: "CANCELLED";
93
- readonly eventName: "cancel";
94
- readonly guard: {
95
- readonly "==": readonly [1, 1];
96
- };
97
- readonly effect: {
98
- readonly merge: readonly [{
99
- readonly var: "state";
100
- }, {
101
- readonly status: "CANCELLED";
102
- readonly cancelledAt: {
103
- readonly var: "$timestamp";
104
- };
105
- }];
106
- };
107
- readonly dependencies: readonly [];
108
- }, {
109
- readonly from: "ACTIVE";
110
- readonly to: "COMPLETED";
111
- readonly eventName: "complete";
112
- readonly guard: {
113
- readonly "==": readonly [1, 1];
114
- };
115
- readonly effect: {
116
- readonly merge: readonly [{
117
- readonly var: "state";
118
- }, {
119
- readonly status: "COMPLETED";
120
- readonly completedAt: {
121
- readonly var: "$timestamp";
122
- };
123
- }];
124
- };
125
- readonly dependencies: readonly [];
126
- }, {
127
- readonly from: "ACTIVE";
128
- readonly to: "CANCELLED";
129
- readonly eventName: "cancel";
130
- readonly guard: {
131
- readonly "==": readonly [1, 1];
132
- };
133
- readonly effect: {
134
- readonly merge: readonly [{
135
- readonly var: "state";
136
- }, {
137
- readonly status: "CANCELLED";
138
- readonly cancelledAt: {
139
- readonly var: "$timestamp";
140
- };
141
- }];
142
- };
143
- readonly dependencies: readonly [];
144
- }];
84
+ initialState: "PROPOSED";
85
+ transitions: ({
86
+ from: "PROPOSED";
87
+ to: "ACTIVE";
88
+ eventName: "accept";
89
+ guard: {
90
+ "==": number[];
91
+ };
92
+ effect: {
93
+ merge: ({
94
+ var: string;
95
+ status?: undefined;
96
+ acceptedAt?: undefined;
97
+ } | {
98
+ status: string;
99
+ acceptedAt: {
100
+ var: string;
101
+ };
102
+ var?: undefined;
103
+ })[];
104
+ };
105
+ dependencies: never[];
106
+ } | {
107
+ from: "PROPOSED";
108
+ to: "CANCELLED";
109
+ eventName: "cancel";
110
+ guard: {
111
+ "==": number[];
112
+ };
113
+ effect: {
114
+ merge: ({
115
+ var: string;
116
+ status?: undefined;
117
+ cancelledAt?: undefined;
118
+ } | {
119
+ status: string;
120
+ cancelledAt: {
121
+ var: string;
122
+ };
123
+ var?: undefined;
124
+ })[];
125
+ };
126
+ dependencies: never[];
127
+ } | {
128
+ from: "ACTIVE";
129
+ to: "COMPLETED";
130
+ eventName: "complete";
131
+ guard: {
132
+ "==": number[];
133
+ };
134
+ effect: {
135
+ merge: ({
136
+ var: string;
137
+ status?: undefined;
138
+ completedAt?: undefined;
139
+ } | {
140
+ status: string;
141
+ completedAt: {
142
+ var: string;
143
+ };
144
+ var?: undefined;
145
+ })[];
146
+ };
147
+ dependencies: never[];
148
+ } | {
149
+ from: "ACTIVE";
150
+ to: "CANCELLED";
151
+ eventName: "cancel";
152
+ guard: {
153
+ "==": number[];
154
+ };
155
+ effect: {
156
+ merge: ({
157
+ var: string;
158
+ status?: undefined;
159
+ cancelledAt?: undefined;
160
+ } | {
161
+ status: string;
162
+ cancelledAt: {
163
+ var: string;
164
+ };
165
+ var?: undefined;
166
+ })[];
167
+ };
168
+ dependencies: never[];
169
+ })[];
145
170
  };
146
171
  readonly agreement: {
147
- readonly metadata: {
148
- readonly name: "ContractAgreement";
149
- readonly description: "Two-party agreement with mutual completion attestation and dispute resolution";
150
- readonly version: "1.0.0";
151
- readonly app: "contracts";
152
- readonly type: "agreement";
153
- readonly crossReferences: {
154
- readonly proposerIdentityId: "Links to proposer's AgentIdentity fiber";
155
- readonly counterpartyIdentityId: "Links to counterparty's AgentIdentity fiber";
156
- readonly escrowId: "Links to Escrow if payment is escrowed";
157
- readonly arbitrationPoolId: "Links to ArbitrationPool for dispute resolution";
172
+ metadata: {
173
+ name: string;
174
+ app: string;
175
+ type: string;
176
+ version: string;
177
+ description: string;
178
+ crossReferences: {
179
+ proposerIdentityId: {
180
+ machine: string;
181
+ field: string;
182
+ description: string;
183
+ };
184
+ counterpartyIdentityId: {
185
+ machine: string;
186
+ field: string;
187
+ description: string;
188
+ };
189
+ escrowId: {
190
+ machine: string;
191
+ field: string;
192
+ description: string;
193
+ };
194
+ arbitrationPoolId: {
195
+ machine: string;
196
+ field: string;
197
+ description: string;
198
+ };
158
199
  };
159
200
  };
160
- readonly createSchema: {
161
- readonly required: readonly ["proposer", "counterparty"];
162
- readonly properties: {
163
- readonly proposer: {
164
- readonly type: "address";
165
- readonly description: "DAG address of the proposer";
166
- readonly immutable: true;
201
+ createSchema: {
202
+ required: readonly ["proposer", "counterparty"];
203
+ properties: {
204
+ proposer: {
205
+ type: "address";
206
+ description: string;
207
+ immutable: true;
167
208
  };
168
- readonly counterparty: {
169
- readonly type: "address";
170
- readonly description: "DAG address of the counterparty";
171
- readonly immutable: true;
209
+ counterparty: {
210
+ type: "address";
211
+ description: string;
212
+ immutable: true;
172
213
  };
173
214
  };
174
215
  };
175
- readonly stateSchema: {
176
- readonly properties: {
177
- readonly status: {
178
- readonly type: "string";
216
+ stateSchema: {
217
+ properties: {
218
+ status: {
219
+ type: "string";
220
+ };
221
+ proposer: {
222
+ type: "address";
223
+ };
224
+ counterparty: {
225
+ type: "address";
179
226
  };
180
- readonly proposer: {
181
- readonly type: "address";
227
+ completions: {
228
+ type: "array";
182
229
  };
183
- readonly counterparty: {
184
- readonly type: "address";
230
+ acceptedAt: {
231
+ type: "integer";
232
+ nullable: true;
185
233
  };
186
- readonly completions: {
187
- readonly type: "array";
234
+ rejectedAt: {
235
+ type: "integer";
236
+ nullable: true;
237
+ };
238
+ rejectReason: {
239
+ type: "string";
240
+ nullable: true;
241
+ };
242
+ cancelledAt: {
243
+ type: "integer";
244
+ nullable: true;
245
+ };
246
+ completedAt: {
247
+ type: "integer";
248
+ nullable: true;
249
+ };
250
+ disputedAt: {
251
+ type: "integer";
252
+ nullable: true;
253
+ };
254
+ disputeReason: {
255
+ type: "string";
256
+ nullable: true;
257
+ };
258
+ disputedBy: {
259
+ type: "address";
260
+ nullable: true;
261
+ };
262
+ resolvedAt: {
263
+ type: "integer";
264
+ nullable: true;
265
+ };
266
+ resolution: {
267
+ type: "string";
268
+ nullable: true;
269
+ };
270
+ rulingId: {
271
+ type: "string";
272
+ nullable: true;
188
273
  };
189
274
  };
190
275
  };
191
- readonly eventSchemas: {
192
- readonly accept: {};
193
- readonly reject: {};
194
- readonly cancel: {};
195
- readonly submit_completion: {};
196
- readonly finalize: {};
197
- readonly dispute: {};
198
- readonly resolve: {};
276
+ eventSchemas: {
277
+ accept: {};
278
+ reject: {
279
+ properties: {
280
+ reason: {
281
+ type: "string";
282
+ };
283
+ };
284
+ };
285
+ cancel: {};
286
+ submit_completion: {
287
+ properties: {
288
+ proof: {
289
+ type: "string";
290
+ };
291
+ };
292
+ };
293
+ finalize: {};
294
+ dispute: {
295
+ properties: {
296
+ reason: {
297
+ type: "string";
298
+ };
299
+ };
300
+ };
301
+ resolve: {
302
+ properties: {
303
+ judicialRuling: {
304
+ type: "boolean";
305
+ nullable: true;
306
+ };
307
+ proposerApproves: {
308
+ type: "boolean";
309
+ nullable: true;
310
+ };
311
+ counterpartyApproves: {
312
+ type: "boolean";
313
+ nullable: true;
314
+ };
315
+ resolution: {
316
+ type: "string";
317
+ };
318
+ rulingId: {
319
+ type: "string";
320
+ nullable: true;
321
+ };
322
+ };
323
+ };
199
324
  };
200
- readonly states: {
201
- readonly PROPOSED: {
202
- readonly id: "PROPOSED";
203
- readonly isFinal: false;
204
- readonly metadata: null;
205
- };
206
- readonly ACTIVE: {
207
- readonly id: "ACTIVE";
208
- readonly isFinal: false;
209
- readonly metadata: null;
210
- };
211
- readonly COMPLETED: {
212
- readonly id: "COMPLETED";
213
- readonly isFinal: true;
214
- readonly metadata: null;
215
- };
216
- readonly DISPUTED: {
217
- readonly id: "DISPUTED";
218
- readonly isFinal: false;
219
- readonly metadata: null;
220
- };
221
- readonly REJECTED: {
222
- readonly id: "REJECTED";
223
- readonly isFinal: true;
224
- readonly metadata: null;
225
- };
226
- readonly CANCELLED: {
227
- readonly id: "CANCELLED";
228
- readonly isFinal: true;
229
- readonly metadata: null;
325
+ states: {
326
+ PROPOSED: {
327
+ id: string;
328
+ isFinal: false;
329
+ metadata: null;
330
+ };
331
+ ACTIVE: {
332
+ id: string;
333
+ isFinal: false;
334
+ metadata: null;
335
+ };
336
+ COMPLETED: {
337
+ id: string;
338
+ isFinal: true;
339
+ metadata: null;
340
+ };
341
+ DISPUTED: {
342
+ id: string;
343
+ isFinal: false;
344
+ metadata: null;
345
+ };
346
+ REJECTED: {
347
+ id: string;
348
+ isFinal: true;
349
+ metadata: null;
350
+ };
351
+ CANCELLED: {
352
+ id: string;
353
+ isFinal: true;
354
+ metadata: null;
230
355
  };
231
356
  };
232
- readonly initialState: "PROPOSED";
233
- readonly transitions: readonly [{
234
- readonly from: "PROPOSED";
235
- readonly to: "ACTIVE";
236
- readonly eventName: "accept";
237
- readonly guard: {
238
- readonly "===": readonly [{
239
- readonly var: "event.agent";
240
- }, {
241
- readonly var: "state.counterparty";
242
- }];
243
- };
244
- readonly effect: {
245
- readonly merge: readonly [{
246
- readonly var: "state";
247
- }, {
248
- readonly status: "ACTIVE";
249
- readonly acceptedAt: {
250
- readonly var: "$timestamp";
251
- };
252
- }];
253
- };
254
- readonly dependencies: readonly [];
255
- }, {
256
- readonly from: "PROPOSED";
257
- readonly to: "REJECTED";
258
- readonly eventName: "reject";
259
- readonly guard: {
260
- readonly "===": readonly [{
261
- readonly var: "event.agent";
262
- }, {
263
- readonly var: "state.counterparty";
264
- }];
265
- };
266
- readonly effect: {
267
- readonly merge: readonly [{
268
- readonly var: "state";
269
- }, {
270
- readonly status: "REJECTED";
271
- readonly rejectedAt: {
272
- readonly var: "$timestamp";
273
- };
274
- readonly rejectReason: {
275
- readonly var: "event.reason";
276
- };
277
- }];
278
- };
279
- readonly dependencies: readonly [];
280
- }, {
281
- readonly from: "PROPOSED";
282
- readonly to: "CANCELLED";
283
- readonly eventName: "cancel";
284
- readonly guard: {
285
- readonly "===": readonly [{
286
- readonly var: "event.agent";
287
- }, {
288
- readonly var: "state.proposer";
289
- }];
290
- };
291
- readonly effect: {
292
- readonly merge: readonly [{
293
- readonly var: "state";
294
- }, {
295
- readonly status: "CANCELLED";
296
- readonly cancelledAt: {
297
- readonly var: "$timestamp";
298
- };
299
- }];
300
- };
301
- readonly dependencies: readonly [];
302
- }, {
303
- readonly from: "ACTIVE";
304
- readonly to: "ACTIVE";
305
- readonly eventName: "submit_completion";
306
- readonly guard: {
307
- readonly and: readonly [{
308
- readonly or: readonly [{
309
- readonly "===": readonly [{
310
- readonly var: "event.agent";
311
- }, {
312
- readonly var: "state.proposer";
313
- }];
314
- }, {
315
- readonly "===": readonly [{
316
- readonly var: "event.agent";
317
- }, {
318
- readonly var: "state.counterparty";
319
- }];
320
- }];
321
- }, {
322
- readonly "!": readonly [{
323
- readonly in: readonly [{
324
- readonly var: "event.agent";
325
- }, {
326
- readonly map: readonly [{
327
- readonly var: "state.completions";
328
- }, {
329
- readonly var: "agent";
330
- }];
331
- }];
332
- }];
333
- }];
334
- };
335
- readonly effect: {
336
- readonly merge: readonly [{
337
- readonly var: "state";
338
- }, {
339
- readonly completions: {
340
- readonly cat: readonly [{
341
- readonly var: "state.completions";
342
- }, readonly [{
343
- readonly agent: {
344
- readonly var: "event.agent";
357
+ initialState: "PROPOSED";
358
+ transitions: ({
359
+ from: "PROPOSED";
360
+ to: "ACTIVE";
361
+ eventName: "accept";
362
+ guard: {
363
+ "===": {
364
+ var: string;
365
+ }[];
366
+ and?: undefined;
367
+ ">="?: undefined;
368
+ or?: undefined;
369
+ };
370
+ effect: {
371
+ merge: ({
372
+ var: string;
373
+ status?: undefined;
374
+ acceptedAt?: undefined;
375
+ } | {
376
+ status: string;
377
+ acceptedAt: {
378
+ var: string;
379
+ };
380
+ var?: undefined;
381
+ })[];
382
+ };
383
+ dependencies: never[];
384
+ } | {
385
+ from: "PROPOSED";
386
+ to: "REJECTED";
387
+ eventName: "reject";
388
+ guard: {
389
+ "===": {
390
+ var: string;
391
+ }[];
392
+ and?: undefined;
393
+ ">="?: undefined;
394
+ or?: undefined;
395
+ };
396
+ effect: {
397
+ merge: ({
398
+ var: string;
399
+ status?: undefined;
400
+ rejectedAt?: undefined;
401
+ rejectReason?: undefined;
402
+ } | {
403
+ status: string;
404
+ rejectedAt: {
405
+ var: string;
406
+ };
407
+ rejectReason: {
408
+ var: string;
409
+ };
410
+ var?: undefined;
411
+ })[];
412
+ };
413
+ dependencies: never[];
414
+ } | {
415
+ from: "PROPOSED";
416
+ to: "CANCELLED";
417
+ eventName: "cancel";
418
+ guard: {
419
+ "===": {
420
+ var: string;
421
+ }[];
422
+ and?: undefined;
423
+ ">="?: undefined;
424
+ or?: undefined;
425
+ };
426
+ effect: {
427
+ merge: ({
428
+ var: string;
429
+ status?: undefined;
430
+ cancelledAt?: undefined;
431
+ } | {
432
+ status: string;
433
+ cancelledAt: {
434
+ var: string;
435
+ };
436
+ var?: undefined;
437
+ })[];
438
+ };
439
+ dependencies: never[];
440
+ } | {
441
+ from: "ACTIVE";
442
+ to: "ACTIVE";
443
+ eventName: "submit_completion";
444
+ guard: {
445
+ and: ({
446
+ or: {
447
+ "===": {
448
+ var: string;
449
+ }[];
450
+ }[];
451
+ "!"?: undefined;
452
+ } | {
453
+ "!": {
454
+ in: ({
455
+ var: string;
456
+ map?: undefined;
457
+ } | {
458
+ map: {
459
+ var: string;
460
+ }[];
461
+ var?: undefined;
462
+ })[];
463
+ }[];
464
+ or?: undefined;
465
+ })[];
466
+ "==="?: undefined;
467
+ ">="?: undefined;
468
+ or?: undefined;
469
+ };
470
+ effect: {
471
+ merge: ({
472
+ var: string;
473
+ completions?: undefined;
474
+ } | {
475
+ completions: {
476
+ cat: ({
477
+ var: string;
478
+ } | {
479
+ agent: {
480
+ var: string;
345
481
  };
346
- readonly proof: {
347
- readonly var: "event.proof";
482
+ proof: {
483
+ var: string;
348
484
  };
349
- readonly submittedAt: {
350
- readonly var: "$timestamp";
485
+ submittedAt: {
486
+ var: string;
351
487
  };
352
- }]];
353
- };
354
- }];
355
- };
356
- readonly dependencies: readonly [];
357
- }, {
358
- readonly from: "ACTIVE";
359
- readonly to: "COMPLETED";
360
- readonly eventName: "finalize";
361
- readonly guard: {
362
- readonly ">=": readonly [{
363
- readonly size: {
364
- readonly var: "state.completions";
365
- };
366
- }, 2];
367
- };
368
- readonly effect: {
369
- readonly merge: readonly [{
370
- readonly var: "state";
371
- }, {
372
- readonly status: "COMPLETED";
373
- readonly completedAt: {
374
- readonly var: "$timestamp";
375
- };
376
- }];
377
- };
378
- readonly dependencies: readonly [];
379
- }, {
380
- readonly from: "ACTIVE";
381
- readonly to: "DISPUTED";
382
- readonly eventName: "dispute";
383
- readonly guard: {
384
- readonly or: readonly [{
385
- readonly "===": readonly [{
386
- readonly var: "event.agent";
387
- }, {
388
- readonly var: "state.proposer";
389
- }];
390
- }, {
391
- readonly "===": readonly [{
392
- readonly var: "event.agent";
393
- }, {
394
- readonly var: "state.counterparty";
395
- }];
396
- }];
397
- };
398
- readonly effect: {
399
- readonly merge: readonly [{
400
- readonly var: "state";
401
- }, {
402
- readonly status: "DISPUTED";
403
- readonly disputedAt: {
404
- readonly var: "$timestamp";
405
- };
406
- readonly disputeReason: {
407
- readonly var: "event.reason";
408
- };
409
- readonly disputedBy: {
410
- readonly var: "event.agent";
411
- };
412
- }];
413
- };
414
- readonly dependencies: readonly [];
415
- }, {
416
- readonly from: "DISPUTED";
417
- readonly to: "COMPLETED";
418
- readonly eventName: "resolve";
419
- readonly guard: {
420
- readonly or: readonly [{
421
- readonly var: "event.judicialRuling";
422
- }, {
423
- readonly and: readonly [{
424
- readonly "===": readonly [{
425
- readonly var: "event.proposerApproves";
426
- }, true];
427
- }, {
428
- readonly "===": readonly [{
429
- readonly var: "event.counterpartyApproves";
430
- }, true];
431
- }];
432
- }];
433
- };
434
- readonly effect: {
435
- readonly merge: readonly [{
436
- readonly var: "state";
437
- }, {
438
- readonly status: "COMPLETED";
439
- readonly resolvedAt: {
440
- readonly var: "$timestamp";
441
- };
442
- readonly resolution: {
443
- readonly var: "event.resolution";
444
- };
445
- readonly rulingId: {
446
- readonly var: "event.rulingId";
447
- };
448
- }];
449
- };
450
- readonly dependencies: readonly [];
451
- }, {
452
- readonly from: "ACTIVE";
453
- readonly to: "CANCELLED";
454
- readonly eventName: "cancel";
455
- readonly guard: {
456
- readonly or: readonly [{
457
- readonly "===": readonly [{
458
- readonly var: "event.agent";
459
- }, {
460
- readonly var: "state.proposer";
461
- }];
462
- }, {
463
- readonly "===": readonly [{
464
- readonly var: "event.agent";
465
- }, {
466
- readonly var: "state.counterparty";
467
- }];
468
- }];
469
- };
470
- readonly effect: {
471
- readonly merge: readonly [{
472
- readonly var: "state";
473
- }, {
474
- readonly status: "CANCELLED";
475
- readonly cancelledAt: {
476
- readonly var: "$timestamp";
477
- };
478
- }];
479
- };
480
- readonly dependencies: readonly [];
481
- }];
488
+ }[])[];
489
+ };
490
+ var?: undefined;
491
+ })[];
492
+ };
493
+ dependencies: never[];
494
+ } | {
495
+ from: "ACTIVE";
496
+ to: "COMPLETED";
497
+ eventName: "finalize";
498
+ guard: {
499
+ ">=": (number | {
500
+ size: {
501
+ var: string;
502
+ };
503
+ })[];
504
+ "==="?: undefined;
505
+ and?: undefined;
506
+ or?: undefined;
507
+ };
508
+ effect: {
509
+ merge: ({
510
+ var: string;
511
+ status?: undefined;
512
+ completedAt?: undefined;
513
+ } | {
514
+ status: string;
515
+ completedAt: {
516
+ var: string;
517
+ };
518
+ var?: undefined;
519
+ })[];
520
+ };
521
+ dependencies: never[];
522
+ } | {
523
+ from: "ACTIVE";
524
+ to: "DISPUTED";
525
+ eventName: "dispute";
526
+ guard: {
527
+ or: {
528
+ "===": {
529
+ var: string;
530
+ }[];
531
+ }[];
532
+ "==="?: undefined;
533
+ and?: undefined;
534
+ ">="?: undefined;
535
+ };
536
+ effect: {
537
+ merge: ({
538
+ var: string;
539
+ status?: undefined;
540
+ disputedAt?: undefined;
541
+ disputeReason?: undefined;
542
+ disputedBy?: undefined;
543
+ } | {
544
+ status: string;
545
+ disputedAt: {
546
+ var: string;
547
+ };
548
+ disputeReason: {
549
+ var: string;
550
+ };
551
+ disputedBy: {
552
+ var: string;
553
+ };
554
+ var?: undefined;
555
+ })[];
556
+ };
557
+ dependencies: never[];
558
+ } | {
559
+ from: "DISPUTED";
560
+ to: "COMPLETED";
561
+ eventName: "resolve";
562
+ guard: {
563
+ or: ({
564
+ var: string;
565
+ and?: undefined;
566
+ } | {
567
+ and: {
568
+ "===": (boolean | {
569
+ var: string;
570
+ })[];
571
+ }[];
572
+ var?: undefined;
573
+ })[];
574
+ "==="?: undefined;
575
+ and?: undefined;
576
+ ">="?: undefined;
577
+ };
578
+ effect: {
579
+ merge: ({
580
+ var: string;
581
+ status?: undefined;
582
+ resolvedAt?: undefined;
583
+ resolution?: undefined;
584
+ rulingId?: undefined;
585
+ } | {
586
+ status: string;
587
+ resolvedAt: {
588
+ var: string;
589
+ };
590
+ resolution: {
591
+ var: string;
592
+ };
593
+ rulingId: {
594
+ var: string;
595
+ };
596
+ var?: undefined;
597
+ })[];
598
+ };
599
+ dependencies: never[];
600
+ } | {
601
+ from: "ACTIVE";
602
+ to: "CANCELLED";
603
+ eventName: "cancel";
604
+ guard: {
605
+ or: {
606
+ "===": {
607
+ var: string;
608
+ }[];
609
+ }[];
610
+ "==="?: undefined;
611
+ and?: undefined;
612
+ ">="?: undefined;
613
+ };
614
+ effect: {
615
+ merge: ({
616
+ var: string;
617
+ status?: undefined;
618
+ cancelledAt?: undefined;
619
+ } | {
620
+ status: string;
621
+ cancelledAt: {
622
+ var: string;
623
+ };
624
+ var?: undefined;
625
+ })[];
626
+ };
627
+ dependencies: never[];
628
+ })[];
482
629
  };
483
630
  readonly escrow: {
484
- readonly metadata: {
485
- readonly name: "ContractEscrow";
486
- readonly description: "Asset custody with conditional release, dispute resolution, and split payments";
487
- readonly version: "1.0.0";
488
- readonly app: "contracts";
489
- readonly type: "escrow";
490
- readonly crossReferences: {
491
- readonly contractId: "Links to Contract SM that created this escrow";
492
- readonly marketId: "Links to Market SM for market-based escrow";
493
- readonly insuranceId: "Links to Insurance SM for protected escrow";
494
- readonly arbitrationPoolId: "Links to ArbitrationPool for dispute resolution";
495
- readonly treasuryId: "Links to Treasury for fee collection";
631
+ metadata: {
632
+ name: string;
633
+ app: string;
634
+ type: string;
635
+ version: string;
636
+ description: string;
637
+ crossReferences: {
638
+ contractId: {
639
+ machine: string;
640
+ field: string;
641
+ description: string;
642
+ };
643
+ marketId: {
644
+ machine: string;
645
+ field: string;
646
+ description: string;
647
+ };
648
+ insuranceId: {
649
+ machine: string;
650
+ field: string;
651
+ description: string;
652
+ };
653
+ arbitrationPoolId: {
654
+ machine: string;
655
+ field: string;
656
+ description: string;
657
+ };
658
+ treasuryId: {
659
+ machine: string;
660
+ field: string;
661
+ description: string;
662
+ };
496
663
  };
497
664
  };
498
- readonly createSchema: {
499
- readonly required: readonly ["depositor", "beneficiary", "requiredAmount"];
500
- readonly properties: {
501
- readonly depositor: {
502
- readonly type: "address";
503
- readonly description: "DAG address of the depositor";
665
+ createSchema: {
666
+ required: readonly ["depositor", "beneficiary", "requiredAmount"];
667
+ properties: {
668
+ depositor: {
669
+ type: "address";
670
+ description: string;
671
+ };
672
+ beneficiary: {
673
+ type: "address";
674
+ description: string;
504
675
  };
505
- readonly beneficiary: {
506
- readonly type: "address";
507
- readonly description: "DAG address of the beneficiary";
676
+ requiredAmount: {
677
+ type: "number";
678
+ minimum: number;
679
+ description: string;
508
680
  };
509
- readonly requiredAmount: {
510
- readonly type: "number";
511
- readonly minimum: 0;
512
- readonly description: "Required escrow amount";
681
+ releaseWindowMs: {
682
+ type: "integer";
683
+ description: string;
684
+ nullable: true;
685
+ };
686
+ expiresAt: {
687
+ type: "integer";
688
+ description: string;
689
+ nullable: true;
690
+ };
691
+ autoActivate: {
692
+ type: "boolean";
693
+ description: string;
694
+ nullable: true;
513
695
  };
514
696
  };
515
697
  };
516
- readonly stateSchema: {
517
- readonly properties: {
518
- readonly balance: {
519
- readonly type: "number";
698
+ stateSchema: {
699
+ properties: {
700
+ depositor: {
701
+ type: "address";
702
+ };
703
+ beneficiary: {
704
+ type: "address";
705
+ };
706
+ requiredAmount: {
707
+ type: "number";
708
+ };
709
+ balance: {
710
+ type: "number";
711
+ };
712
+ fundedAt: {
713
+ type: "integer";
714
+ nullable: true;
715
+ };
716
+ activatedAt: {
717
+ type: "integer";
718
+ nullable: true;
520
719
  };
521
- readonly releaseRequest: {
522
- readonly type: "object";
720
+ releaseRequest: {
721
+ type: "object";
722
+ nullable: true;
723
+ };
724
+ releaseDeadline: {
725
+ type: "integer";
726
+ nullable: true;
727
+ };
728
+ releasedAt: {
729
+ type: "integer";
730
+ nullable: true;
731
+ };
732
+ releasedTo: {
733
+ type: "address";
734
+ nullable: true;
735
+ };
736
+ disputedAt: {
737
+ type: "integer";
738
+ nullable: true;
739
+ };
740
+ refundedAt: {
741
+ type: "integer";
742
+ nullable: true;
743
+ };
744
+ splits: {
745
+ type: "array";
746
+ nullable: true;
747
+ };
748
+ rulingId: {
749
+ type: "string";
750
+ nullable: true;
751
+ };
752
+ releaseWindowMs: {
753
+ type: "integer";
754
+ nullable: true;
755
+ };
756
+ expiresAt: {
757
+ type: "integer";
758
+ nullable: true;
759
+ };
760
+ autoActivate: {
761
+ type: "boolean";
762
+ nullable: true;
523
763
  };
524
764
  };
525
765
  };
526
- readonly eventSchemas: {
527
- readonly deposit: {};
528
- readonly activate: {};
529
- readonly request_release: {};
530
- readonly approve_release: {};
531
- readonly dispute: {};
532
- readonly ruling: {};
533
- readonly refund: {};
766
+ eventSchemas: {
767
+ deposit: {
768
+ properties: {
769
+ amount: {
770
+ type: "number";
771
+ };
772
+ };
773
+ };
774
+ activate: {};
775
+ request_release: {
776
+ properties: {
777
+ amount: {
778
+ type: "number";
779
+ };
780
+ reason: {
781
+ type: "string";
782
+ nullable: true;
783
+ };
784
+ };
785
+ };
786
+ approve_release: {};
787
+ dispute: {};
788
+ ruling: {
789
+ properties: {
790
+ judicialRuling: {
791
+ type: "boolean";
792
+ };
793
+ splits: {
794
+ type: "array";
795
+ };
796
+ rulingId: {
797
+ type: "string";
798
+ };
799
+ };
800
+ };
801
+ refund: {
802
+ properties: {
803
+ mutualConsent: {
804
+ type: "boolean";
805
+ nullable: true;
806
+ };
807
+ };
808
+ };
809
+ cancel: {};
534
810
  };
535
- readonly states: {
536
- readonly CREATED: {
537
- readonly id: "CREATED";
538
- readonly isFinal: false;
539
- readonly metadata: null;
540
- };
541
- readonly FUNDED: {
542
- readonly id: "FUNDED";
543
- readonly isFinal: false;
544
- readonly metadata: null;
545
- };
546
- readonly ACTIVE: {
547
- readonly id: "ACTIVE";
548
- readonly isFinal: false;
549
- readonly metadata: null;
550
- };
551
- readonly RELEASING: {
552
- readonly id: "RELEASING";
553
- readonly isFinal: false;
554
- readonly metadata: null;
555
- };
556
- readonly DISPUTED: {
557
- readonly id: "DISPUTED";
558
- readonly isFinal: false;
559
- readonly metadata: null;
560
- };
561
- readonly RELEASED: {
562
- readonly id: "RELEASED";
563
- readonly isFinal: true;
564
- readonly metadata: null;
565
- };
566
- readonly REFUNDED: {
567
- readonly id: "REFUNDED";
568
- readonly isFinal: true;
569
- readonly metadata: null;
570
- };
571
- readonly SPLIT: {
572
- readonly id: "SPLIT";
573
- readonly isFinal: true;
574
- readonly metadata: null;
811
+ states: {
812
+ CREATED: {
813
+ id: string;
814
+ isFinal: false;
815
+ metadata: null;
816
+ };
817
+ FUNDED: {
818
+ id: string;
819
+ isFinal: false;
820
+ metadata: null;
821
+ };
822
+ ACTIVE: {
823
+ id: string;
824
+ isFinal: false;
825
+ metadata: null;
826
+ };
827
+ RELEASING: {
828
+ id: string;
829
+ isFinal: false;
830
+ metadata: null;
831
+ };
832
+ DISPUTED: {
833
+ id: string;
834
+ isFinal: false;
835
+ metadata: null;
836
+ };
837
+ RELEASED: {
838
+ id: string;
839
+ isFinal: true;
840
+ metadata: null;
841
+ };
842
+ REFUNDED: {
843
+ id: string;
844
+ isFinal: true;
845
+ metadata: null;
846
+ };
847
+ SPLIT: {
848
+ id: string;
849
+ isFinal: true;
850
+ metadata: null;
575
851
  };
576
852
  };
577
- readonly initialState: "CREATED";
578
- readonly transitions: readonly [{
579
- readonly from: "CREATED";
580
- readonly to: "FUNDED";
581
- readonly eventName: "deposit";
582
- readonly guard: {
583
- readonly and: readonly [{
584
- readonly "===": readonly [{
585
- readonly var: "event.agent";
586
- }, {
587
- readonly var: "state.depositor";
588
- }];
589
- }, {
590
- readonly ">=": readonly [{
591
- readonly var: "event.amount";
592
- }, {
593
- readonly var: "state.requiredAmount";
594
- }];
595
- }];
596
- };
597
- readonly effect: {
598
- readonly merge: readonly [{
599
- readonly var: "state";
600
- }, {
601
- readonly balance: {
602
- readonly var: "event.amount";
603
- };
604
- readonly fundedAt: {
605
- readonly var: "$timestamp";
606
- };
607
- }];
608
- };
609
- readonly dependencies: readonly [];
610
- }, {
611
- readonly from: "FUNDED";
612
- readonly to: "ACTIVE";
613
- readonly eventName: "activate";
614
- readonly guard: {
615
- readonly or: readonly [{
616
- readonly "===": readonly [{
617
- readonly var: "event.agent";
618
- }, {
619
- readonly var: "state.beneficiary";
620
- }];
621
- }, {
622
- readonly var: "state.autoActivate";
623
- }];
624
- };
625
- readonly effect: {
626
- readonly merge: readonly [{
627
- readonly var: "state";
628
- }, {
629
- readonly activatedAt: {
630
- readonly var: "$timestamp";
631
- };
632
- }];
633
- };
634
- readonly dependencies: readonly [];
635
- }, {
636
- readonly from: "ACTIVE";
637
- readonly to: "RELEASING";
638
- readonly eventName: "request_release";
639
- readonly guard: {
640
- readonly "===": readonly [{
641
- readonly var: "event.agent";
642
- }, {
643
- readonly var: "state.beneficiary";
644
- }];
645
- };
646
- readonly effect: {
647
- readonly merge: readonly [{
648
- readonly var: "state";
649
- }, {
650
- readonly releaseRequest: {
651
- readonly requestedBy: {
652
- readonly var: "event.agent";
853
+ initialState: "CREATED";
854
+ transitions: ({
855
+ from: "CREATED";
856
+ to: "FUNDED";
857
+ eventName: "deposit";
858
+ guard: {
859
+ and: ({
860
+ "===": {
861
+ var: string;
862
+ }[];
863
+ ">="?: undefined;
864
+ } | {
865
+ ">=": {
866
+ var: string;
867
+ }[];
868
+ "==="?: undefined;
869
+ })[];
870
+ or?: undefined;
871
+ "==="?: undefined;
872
+ var?: undefined;
873
+ };
874
+ effect: {
875
+ merge: ({
876
+ var: string;
877
+ balance?: undefined;
878
+ fundedAt?: undefined;
879
+ } | {
880
+ balance: {
881
+ var: string;
882
+ };
883
+ fundedAt: {
884
+ var: string;
885
+ };
886
+ var?: undefined;
887
+ })[];
888
+ };
889
+ dependencies: never[];
890
+ spawns?: undefined;
891
+ } | {
892
+ from: "FUNDED";
893
+ to: "ACTIVE";
894
+ eventName: "activate";
895
+ guard: {
896
+ or: ({
897
+ "===": {
898
+ var: string;
899
+ }[];
900
+ var?: undefined;
901
+ } | {
902
+ var: string;
903
+ "==="?: undefined;
904
+ })[];
905
+ and?: undefined;
906
+ "==="?: undefined;
907
+ var?: undefined;
908
+ };
909
+ effect: {
910
+ merge: ({
911
+ var: string;
912
+ activatedAt?: undefined;
913
+ } | {
914
+ activatedAt: {
915
+ var: string;
916
+ };
917
+ var?: undefined;
918
+ })[];
919
+ };
920
+ dependencies: never[];
921
+ spawns?: undefined;
922
+ } | {
923
+ from: "ACTIVE";
924
+ to: "RELEASING";
925
+ eventName: "request_release";
926
+ guard: {
927
+ "===": {
928
+ var: string;
929
+ }[];
930
+ and?: undefined;
931
+ or?: undefined;
932
+ var?: undefined;
933
+ };
934
+ effect: {
935
+ merge: ({
936
+ var: string;
937
+ releaseRequest?: undefined;
938
+ releaseDeadline?: undefined;
939
+ } | {
940
+ releaseRequest: {
941
+ requestedBy: {
942
+ var: string;
653
943
  };
654
- readonly amount: {
655
- readonly var: "event.amount";
944
+ amount: {
945
+ var: string;
656
946
  };
657
- readonly reason: {
658
- readonly var: "event.reason";
947
+ reason: {
948
+ var: string;
659
949
  };
660
- readonly requestedAt: {
661
- readonly var: "$timestamp";
950
+ requestedAt: {
951
+ var: string;
662
952
  };
663
953
  };
664
- readonly releaseDeadline: {
665
- readonly "+": readonly [{
666
- readonly var: "$timestamp";
667
- }, {
668
- readonly var: "state.releaseWindowMs";
669
- }];
670
- };
671
- }];
672
- };
673
- readonly dependencies: readonly [];
674
- }, {
675
- readonly from: "RELEASING";
676
- readonly to: "RELEASED";
677
- readonly eventName: "approve_release";
678
- readonly guard: {
679
- readonly or: readonly [{
680
- readonly "===": readonly [{
681
- readonly var: "event.agent";
682
- }, {
683
- readonly var: "state.depositor";
684
- }];
685
- }, {
686
- readonly ">=": readonly [{
687
- readonly var: "$timestamp";
688
- }, {
689
- readonly var: "state.releaseDeadline";
690
- }];
691
- }];
692
- };
693
- readonly effect: {
694
- readonly merge: readonly [{
695
- readonly var: "state";
696
- }, {
697
- readonly releasedAt: {
698
- readonly var: "$timestamp";
699
- };
700
- readonly releasedTo: {
701
- readonly var: "state.beneficiary";
702
- };
703
- }];
704
- };
705
- readonly dependencies: readonly [];
706
- }, {
707
- readonly from: "RELEASING";
708
- readonly to: "DISPUTED";
709
- readonly eventName: "dispute";
710
- readonly guard: {
711
- readonly and: readonly [{
712
- readonly "===": readonly [{
713
- readonly var: "event.agent";
714
- }, {
715
- readonly var: "state.depositor";
716
- }];
717
- }, {
718
- readonly "<": readonly [{
719
- readonly var: "$timestamp";
720
- }, {
721
- readonly var: "state.releaseDeadline";
722
- }];
723
- }];
724
- };
725
- readonly effect: {
726
- readonly merge: readonly [{
727
- readonly var: "state";
728
- }, {
729
- readonly disputedAt: {
730
- readonly var: "$timestamp";
731
- };
732
- }];
733
- };
734
- readonly spawns: {
735
- readonly sm: "Judiciary";
736
- readonly initialData: {
737
- readonly caseType: "escrow_dispute";
738
- readonly plaintiff: {
739
- readonly var: "state.depositor";
740
- };
741
- readonly defendant: {
742
- readonly var: "state.beneficiary";
743
- };
744
- readonly claim: {
745
- readonly escrowId: {
746
- readonly var: "fiberId";
954
+ releaseDeadline: {
955
+ "+": {
956
+ var: string;
957
+ }[];
958
+ };
959
+ var?: undefined;
960
+ })[];
961
+ };
962
+ dependencies: never[];
963
+ spawns?: undefined;
964
+ } | {
965
+ from: "RELEASING";
966
+ to: "RELEASED";
967
+ eventName: "approve_release";
968
+ guard: {
969
+ or: ({
970
+ "===": {
971
+ var: string;
972
+ }[];
973
+ ">="?: undefined;
974
+ } | {
975
+ ">=": {
976
+ var: string;
977
+ }[];
978
+ "==="?: undefined;
979
+ })[];
980
+ and?: undefined;
981
+ "==="?: undefined;
982
+ var?: undefined;
983
+ };
984
+ effect: {
985
+ merge: ({
986
+ var: string;
987
+ releasedAt?: undefined;
988
+ releasedTo?: undefined;
989
+ } | {
990
+ releasedAt: {
991
+ var: string;
992
+ };
993
+ releasedTo: {
994
+ var: string;
995
+ };
996
+ var?: undefined;
997
+ })[];
998
+ };
999
+ dependencies: never[];
1000
+ spawns?: undefined;
1001
+ } | {
1002
+ from: "RELEASING";
1003
+ to: "DISPUTED";
1004
+ eventName: "dispute";
1005
+ guard: {
1006
+ and: ({
1007
+ "===": {
1008
+ var: string;
1009
+ }[];
1010
+ "<"?: undefined;
1011
+ } | {
1012
+ "<": {
1013
+ var: string;
1014
+ }[];
1015
+ "==="?: undefined;
1016
+ })[];
1017
+ or?: undefined;
1018
+ "==="?: undefined;
1019
+ var?: undefined;
1020
+ };
1021
+ effect: {
1022
+ merge: ({
1023
+ var: string;
1024
+ disputedAt?: undefined;
1025
+ } | {
1026
+ disputedAt: {
1027
+ var: string;
1028
+ };
1029
+ var?: undefined;
1030
+ })[];
1031
+ };
1032
+ spawns: {
1033
+ sm: string;
1034
+ initialData: {
1035
+ caseType: string;
1036
+ plaintiff: {
1037
+ var: string;
1038
+ };
1039
+ defendant: {
1040
+ var: string;
1041
+ };
1042
+ claim: {
1043
+ escrowId: {
1044
+ var: string;
747
1045
  };
748
- readonly amount: {
749
- readonly var: "state.balance";
1046
+ amount: {
1047
+ var: string;
750
1048
  };
751
1049
  };
752
1050
  };
753
1051
  };
754
- readonly dependencies: readonly [];
755
- }, {
756
- readonly from: "DISPUTED";
757
- readonly to: "SPLIT";
758
- readonly eventName: "ruling";
759
- readonly guard: {
760
- readonly var: "event.judicialRuling";
761
- };
762
- readonly effect: {
763
- readonly merge: readonly [{
764
- readonly var: "state";
765
- }, {
766
- readonly splits: {
767
- readonly var: "event.splits";
768
- };
769
- readonly rulingId: {
770
- readonly var: "event.rulingId";
771
- };
772
- }];
773
- };
774
- readonly dependencies: readonly [];
775
- }, {
776
- readonly from: "ACTIVE";
777
- readonly to: "REFUNDED";
778
- readonly eventName: "refund";
779
- readonly guard: {
780
- readonly or: readonly [{
781
- readonly var: "event.mutualConsent";
782
- }, {
783
- readonly ">=": readonly [{
784
- readonly var: "$timestamp";
785
- }, {
786
- readonly var: "state.expiresAt";
787
- }];
788
- }];
789
- };
790
- readonly effect: {
791
- readonly merge: readonly [{
792
- readonly var: "state";
793
- }, {
794
- readonly refundedAt: {
795
- readonly var: "$timestamp";
796
- };
797
- }];
798
- };
799
- readonly dependencies: readonly [];
800
- }, {
801
- readonly from: "CREATED";
802
- readonly to: "REFUNDED";
803
- readonly eventName: "cancel";
804
- readonly guard: {
805
- readonly "===": readonly [{
806
- readonly var: "event.agent";
807
- }, {
808
- readonly var: "state.depositor";
809
- }];
810
- };
811
- readonly effect: {
812
- readonly merge: readonly [{
813
- readonly var: "state";
814
- }, {
815
- readonly refundedAt: {
816
- readonly var: "$timestamp";
817
- };
818
- }];
819
- };
820
- readonly dependencies: readonly [];
821
- }];
1052
+ dependencies: never[];
1053
+ } | {
1054
+ from: "DISPUTED";
1055
+ to: "SPLIT";
1056
+ eventName: "ruling";
1057
+ guard: {
1058
+ var: string;
1059
+ and?: undefined;
1060
+ or?: undefined;
1061
+ "==="?: undefined;
1062
+ };
1063
+ effect: {
1064
+ merge: ({
1065
+ var: string;
1066
+ splits?: undefined;
1067
+ rulingId?: undefined;
1068
+ } | {
1069
+ splits: {
1070
+ var: string;
1071
+ };
1072
+ rulingId: {
1073
+ var: string;
1074
+ };
1075
+ var?: undefined;
1076
+ })[];
1077
+ };
1078
+ dependencies: never[];
1079
+ spawns?: undefined;
1080
+ } | {
1081
+ from: "ACTIVE";
1082
+ to: "REFUNDED";
1083
+ eventName: "refund";
1084
+ guard: {
1085
+ or: ({
1086
+ var: string;
1087
+ ">="?: undefined;
1088
+ } | {
1089
+ ">=": {
1090
+ var: string;
1091
+ }[];
1092
+ var?: undefined;
1093
+ })[];
1094
+ and?: undefined;
1095
+ "==="?: undefined;
1096
+ var?: undefined;
1097
+ };
1098
+ effect: {
1099
+ merge: ({
1100
+ var: string;
1101
+ refundedAt?: undefined;
1102
+ } | {
1103
+ refundedAt: {
1104
+ var: string;
1105
+ };
1106
+ var?: undefined;
1107
+ })[];
1108
+ };
1109
+ dependencies: never[];
1110
+ spawns?: undefined;
1111
+ } | {
1112
+ from: "CREATED";
1113
+ to: "REFUNDED";
1114
+ eventName: "cancel";
1115
+ guard: {
1116
+ "===": {
1117
+ var: string;
1118
+ }[];
1119
+ and?: undefined;
1120
+ or?: undefined;
1121
+ var?: undefined;
1122
+ };
1123
+ effect: {
1124
+ merge: ({
1125
+ var: string;
1126
+ refundedAt?: undefined;
1127
+ } | {
1128
+ refundedAt: {
1129
+ var: string;
1130
+ };
1131
+ var?: undefined;
1132
+ })[];
1133
+ };
1134
+ dependencies: never[];
1135
+ spawns?: undefined;
1136
+ })[];
822
1137
  };
823
1138
  };
824
1139
  export type ContractType = keyof typeof CONTRACTS_DEFINITIONS;
@@ -826,6 +1141,6 @@ export type ContractType = keyof typeof CONTRACTS_DEFINITIONS;
826
1141
  * Get a contract state machine definition by type.
827
1142
  * @param type - 'universal' | 'agreement' | 'escrow' (default: 'agreement')
828
1143
  */
829
- export declare function getContractDefinition(type?: ContractType): unknown;
1144
+ export declare function getContractDefinition(type?: ContractType): FiberAppDefinition;
830
1145
  /** @deprecated Use getContractDefinition('escrow') */
831
- export declare function getEscrowDefinition(): unknown;
1146
+ export declare function getEscrowDefinition(): FiberAppDefinition;