@ottochain/sdk 2.0.0 → 2.2.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 (142) hide show
  1. package/dist/cjs/apps/contracts/index.js +1 -1
  2. package/dist/cjs/apps/contracts/state-machines/contract-agreement.js +272 -0
  3. package/dist/cjs/apps/contracts/state-machines/contract-escrow.js +284 -0
  4. package/dist/cjs/apps/contracts/state-machines/contract-universal.js +93 -0
  5. package/dist/cjs/apps/contracts/state-machines/index.js +177 -1
  6. package/dist/cjs/apps/corporate/state-machines/corp-board.js +1022 -0
  7. package/dist/cjs/apps/corporate/state-machines/corp-entity.js +671 -0
  8. package/dist/cjs/apps/corporate/state-machines/corp-securities.js +998 -0
  9. package/dist/cjs/apps/corporate/state-machines/corp-shareholders.js +1102 -0
  10. package/dist/cjs/apps/corporate/state-machines/index.js +20 -4440
  11. package/dist/cjs/apps/governance/index.js +7 -7
  12. package/dist/cjs/apps/governance/state-machines/dao-multisig.js +467 -0
  13. package/dist/cjs/apps/governance/state-machines/dao-reputation.js +458 -0
  14. package/dist/cjs/apps/governance/state-machines/dao-single.js +199 -0
  15. package/dist/cjs/apps/governance/state-machines/dao-token.js +503 -0
  16. package/dist/cjs/apps/governance/state-machines/governance-simple.js +482 -0
  17. package/dist/cjs/apps/governance/state-machines/governance-universal.js +138 -0
  18. package/dist/cjs/apps/governance/state-machines/index.js +16 -2934
  19. package/dist/cjs/apps/identity/constants.js +28 -14
  20. package/dist/cjs/apps/identity/index.js +27 -12
  21. package/dist/cjs/apps/identity/state-machines/identity-agent.js +256 -0
  22. package/dist/cjs/apps/identity/state-machines/identity-oracle.js +321 -0
  23. package/dist/cjs/apps/identity/state-machines/identity-universal.js +106 -0
  24. package/dist/cjs/apps/identity/state-machines/index.js +15 -784
  25. package/dist/cjs/apps/markets/index.js +1 -1
  26. package/dist/cjs/apps/markets/state-machines/index.js +14 -2298
  27. package/dist/cjs/apps/markets/state-machines/market-auction.js +283 -0
  28. package/dist/cjs/apps/markets/state-machines/market-crowdfund.js +312 -0
  29. package/dist/cjs/apps/markets/state-machines/market-group-buy.js +407 -0
  30. package/dist/cjs/apps/markets/state-machines/market-prediction.js +485 -0
  31. package/dist/cjs/apps/markets/state-machines/market-universal.js +129 -0
  32. package/dist/cjs/apps/oracles/index.js +36 -0
  33. package/dist/cjs/generated/google/protobuf/struct.js +1 -1
  34. package/dist/cjs/generated/google/protobuf/timestamp.js +1 -1
  35. package/dist/cjs/generated/index.js +26 -22
  36. package/dist/cjs/generated/ottochain/apps/contracts/v1/contract.js +1 -1
  37. package/dist/cjs/generated/ottochain/apps/corporate/v1/corporate.js +1 -1
  38. package/dist/cjs/generated/ottochain/apps/governance/v1/governance.js +1 -1
  39. package/dist/cjs/generated/ottochain/apps/identity/v1/attestation.js +12 -12
  40. package/dist/cjs/generated/ottochain/apps/identity/v1/identity.js +1688 -0
  41. package/dist/cjs/generated/ottochain/apps/markets/v1/market.js +1 -1
  42. package/dist/cjs/generated/ottochain/v1/common.js +1 -1
  43. package/dist/cjs/generated/ottochain/v1/fiber.js +1 -1
  44. package/dist/cjs/generated/ottochain/v1/messages.js +1 -1
  45. package/dist/cjs/generated/ottochain/v1/records.js +1 -1
  46. package/dist/cjs/schema/fiber-app.js +95 -0
  47. package/dist/cjs/schema/index.js +20 -0
  48. package/dist/esm/apps/contracts/index.js +3 -3
  49. package/dist/esm/apps/contracts/state-machines/contract-agreement.js +269 -0
  50. package/dist/esm/apps/contracts/state-machines/contract-escrow.js +281 -0
  51. package/dist/esm/apps/contracts/state-machines/contract-universal.js +90 -0
  52. package/dist/esm/apps/contracts/state-machines/index.js +177 -1
  53. package/dist/esm/apps/corporate/index.js +3 -3
  54. package/dist/esm/apps/corporate/state-machines/corp-board.js +1019 -0
  55. package/dist/esm/apps/corporate/state-machines/corp-entity.js +668 -0
  56. package/dist/esm/apps/corporate/state-machines/corp-securities.js +995 -0
  57. package/dist/esm/apps/corporate/state-machines/corp-shareholders.js +1099 -0
  58. package/dist/esm/apps/corporate/state-machines/index.js +15 -4439
  59. package/dist/esm/apps/governance/index.js +9 -9
  60. package/dist/esm/apps/governance/state-machines/dao-multisig.js +464 -0
  61. package/dist/esm/apps/governance/state-machines/dao-reputation.js +455 -0
  62. package/dist/esm/apps/governance/state-machines/dao-single.js +196 -0
  63. package/dist/esm/apps/governance/state-machines/dao-token.js +500 -0
  64. package/dist/esm/apps/governance/state-machines/governance-simple.js +479 -0
  65. package/dist/esm/apps/governance/state-machines/governance-universal.js +135 -0
  66. package/dist/esm/apps/governance/state-machines/index.js +9 -2933
  67. package/dist/esm/apps/identity/constants.js +28 -14
  68. package/dist/esm/apps/identity/index.js +7 -5
  69. package/dist/esm/apps/identity/state-machines/identity-agent.js +253 -0
  70. package/dist/esm/apps/identity/state-machines/identity-oracle.js +318 -0
  71. package/dist/esm/apps/identity/state-machines/identity-universal.js +103 -0
  72. package/dist/esm/apps/identity/state-machines/index.js +11 -783
  73. package/dist/esm/apps/index.js +5 -5
  74. package/dist/esm/apps/markets/index.js +3 -3
  75. package/dist/esm/apps/markets/state-machines/index.js +8 -2297
  76. package/dist/esm/apps/markets/state-machines/market-auction.js +280 -0
  77. package/dist/esm/apps/markets/state-machines/market-crowdfund.js +309 -0
  78. package/dist/esm/apps/markets/state-machines/market-group-buy.js +404 -0
  79. package/dist/esm/apps/markets/state-machines/market-prediction.js +482 -0
  80. package/dist/esm/apps/markets/state-machines/market-universal.js +126 -0
  81. package/dist/esm/apps/oracles/index.js +21 -0
  82. package/dist/esm/generated/google/protobuf/struct.js +1 -1
  83. package/dist/esm/generated/google/protobuf/timestamp.js +1 -1
  84. package/dist/esm/generated/index.js +8 -4
  85. package/dist/esm/generated/ottochain/apps/contracts/v1/contract.js +1 -1
  86. package/dist/esm/generated/ottochain/apps/corporate/v1/corporate.js +1 -1
  87. package/dist/esm/generated/ottochain/apps/governance/v1/governance.js +1 -1
  88. package/dist/esm/generated/ottochain/apps/identity/v1/attestation.js +2 -2
  89. package/dist/esm/generated/ottochain/apps/identity/v1/identity.js +1676 -0
  90. package/dist/esm/generated/ottochain/apps/markets/v1/market.js +1 -1
  91. package/dist/esm/generated/ottochain/v1/common.js +1 -1
  92. package/dist/esm/generated/ottochain/v1/fiber.js +1 -1
  93. package/dist/esm/generated/ottochain/v1/messages.js +1 -1
  94. package/dist/esm/generated/ottochain/v1/records.js +1 -1
  95. package/dist/esm/schema/fiber-app.js +86 -0
  96. package/dist/esm/schema/index.js +4 -0
  97. package/dist/types/apps/contracts/index.d.ts +151 -2
  98. package/dist/types/apps/contracts/state-machines/contract-agreement.d.ts +462 -0
  99. package/dist/types/apps/contracts/state-machines/contract-escrow.d.ts +511 -0
  100. package/dist/types/apps/contracts/state-machines/contract-universal.d.ts +147 -0
  101. package/dist/types/apps/contracts/state-machines/index.d.ts +149 -0
  102. package/dist/types/apps/corporate/index.d.ts +5263 -3825
  103. package/dist/types/apps/corporate/state-machines/corp-board.d.ts +1479 -0
  104. package/dist/types/apps/corporate/state-machines/corp-entity.d.ts +970 -0
  105. package/dist/types/apps/corporate/state-machines/corp-securities.d.ts +1381 -0
  106. package/dist/types/apps/corporate/state-machines/corp-shareholders.d.ts +1631 -0
  107. package/dist/types/apps/corporate/state-machines/index.d.ts +5245 -3802
  108. package/dist/types/apps/governance/index.d.ts +875 -37
  109. package/dist/types/apps/governance/state-machines/dao-multisig.d.ts +644 -0
  110. package/dist/types/apps/governance/state-machines/dao-reputation.d.ts +610 -0
  111. package/dist/types/apps/governance/state-machines/dao-single.d.ts +276 -0
  112. package/dist/types/apps/governance/state-machines/dao-token.d.ts +601 -0
  113. package/dist/types/apps/governance/state-machines/governance-simple.d.ts +652 -0
  114. package/dist/types/apps/governance/state-machines/governance-universal.d.ts +181 -0
  115. package/dist/types/apps/governance/state-machines/index.d.ts +9 -2136
  116. package/dist/types/apps/identity/constants.d.ts +8 -6
  117. package/dist/types/apps/identity/index.d.ts +1078 -577
  118. package/dist/types/apps/identity/state-machines/identity-agent.d.ts +401 -0
  119. package/dist/types/apps/identity/state-machines/identity-oracle.d.ts +550 -0
  120. package/dist/types/apps/identity/state-machines/identity-universal.d.ts +151 -0
  121. package/dist/types/apps/identity/state-machines/index.d.ts +1069 -567
  122. package/dist/types/apps/index.d.ts +5 -5
  123. package/dist/types/apps/markets/index.d.ts +535 -7
  124. package/dist/types/apps/markets/state-machines/index.d.ts +8 -1678
  125. package/dist/types/apps/markets/state-machines/market-auction.d.ts +392 -0
  126. package/dist/types/apps/markets/state-machines/market-crowdfund.d.ts +443 -0
  127. package/dist/types/apps/markets/state-machines/market-group-buy.d.ts +539 -0
  128. package/dist/types/apps/markets/state-machines/market-prediction.d.ts +651 -0
  129. package/dist/types/apps/markets/state-machines/market-universal.d.ts +191 -0
  130. package/dist/types/apps/oracles/index.d.ts +18 -0
  131. package/dist/types/generated/index.d.ts +3 -2
  132. package/dist/types/generated/ottochain/apps/identity/v1/attestation.d.ts +1 -1
  133. package/dist/types/generated/ottochain/apps/identity/v1/identity.d.ts +187 -0
  134. package/dist/types/schema/fiber-app.d.ts +172 -0
  135. package/dist/types/schema/index.d.ts +4 -0
  136. package/package.json +1 -1
  137. package/dist/cjs/generated/ottochain/apps/identity/v1/agent.js +0 -619
  138. package/dist/cjs/generated/ottochain/apps/oracles/v1/oracle.js +0 -1223
  139. package/dist/esm/generated/ottochain/apps/identity/v1/agent.js +0 -610
  140. package/dist/esm/generated/ottochain/apps/oracles/v1/oracle.js +0 -1217
  141. package/dist/types/generated/ottochain/apps/identity/v1/agent.d.ts +0 -94
  142. package/dist/types/generated/ottochain/apps/oracles/v1/oracle.d.ts +0 -150
@@ -0,0 +1,651 @@
1
+ /**
2
+ * Binary or multi-outcome prediction market with oracle resolution and position staking.
3
+ */
4
+ export declare const marketPredictionDef: {
5
+ readonly metadata: {
6
+ readonly name: "MarketPrediction";
7
+ readonly app: "markets";
8
+ readonly type: "prediction";
9
+ readonly version: "1.0.0";
10
+ readonly description: "Binary or multi-outcome prediction market with oracle resolution and position staking";
11
+ readonly crossReferences: {
12
+ readonly oracleId: "Links to IdentityOracle that resolves the outcome";
13
+ readonly creatorIdentityId: "Links to creator's IdentityAgent";
14
+ };
15
+ };
16
+ readonly createSchema: {
17
+ readonly required: readonly ["creator", "outcomes", "oracles", "quorum"];
18
+ readonly properties: {
19
+ readonly creator: {
20
+ readonly type: "address";
21
+ readonly description: "DAG address of the market creator";
22
+ readonly immutable: true;
23
+ };
24
+ readonly outcomes: {
25
+ readonly type: "array";
26
+ readonly description: "Valid outcome identifiers";
27
+ readonly immutable: true;
28
+ };
29
+ readonly oracles: {
30
+ readonly type: "array";
31
+ readonly description: "Authorized oracle addresses";
32
+ readonly immutable: true;
33
+ };
34
+ readonly quorum: {
35
+ readonly type: "number";
36
+ readonly description: "Minimum oracle submissions needed to resolve";
37
+ readonly immutable: true;
38
+ };
39
+ readonly deadline: {
40
+ readonly type: "timestamp";
41
+ readonly description: "Optional trading deadline";
42
+ };
43
+ };
44
+ };
45
+ readonly stateSchema: {
46
+ readonly properties: {
47
+ readonly status: {
48
+ readonly type: "string";
49
+ readonly computed: true;
50
+ };
51
+ readonly creator: {
52
+ readonly type: "address";
53
+ readonly immutable: true;
54
+ };
55
+ readonly outcomes: {
56
+ readonly type: "array";
57
+ readonly immutable: true;
58
+ };
59
+ readonly oracles: {
60
+ readonly type: "array";
61
+ readonly immutable: true;
62
+ };
63
+ readonly quorum: {
64
+ readonly type: "number";
65
+ readonly immutable: true;
66
+ };
67
+ readonly deadline: {
68
+ readonly type: "timestamp";
69
+ };
70
+ readonly positions: {
71
+ readonly type: "object";
72
+ readonly computed: true;
73
+ };
74
+ readonly totalPool: {
75
+ readonly type: "number";
76
+ readonly computed: true;
77
+ };
78
+ readonly resolutions: {
79
+ readonly type: "array";
80
+ readonly computed: true;
81
+ };
82
+ readonly finalOutcome: {
83
+ readonly type: "string";
84
+ readonly computed: true;
85
+ };
86
+ readonly claims: {
87
+ readonly type: "array";
88
+ readonly computed: true;
89
+ };
90
+ };
91
+ };
92
+ readonly eventSchemas: {
93
+ readonly open: {
94
+ readonly description: "Open the market for trading";
95
+ };
96
+ readonly cancel: {
97
+ readonly description: "Cancel the market before opening";
98
+ readonly properties: {
99
+ readonly reason: {
100
+ readonly type: "string";
101
+ };
102
+ };
103
+ };
104
+ readonly take_position: {
105
+ readonly description: "Take a position on an outcome";
106
+ readonly required: readonly ["outcome", "amount"];
107
+ readonly properties: {
108
+ readonly outcome: {
109
+ readonly type: "string";
110
+ };
111
+ readonly amount: {
112
+ readonly type: "number";
113
+ readonly minimum: 0;
114
+ };
115
+ };
116
+ };
117
+ readonly close: {
118
+ readonly description: "Close trading";
119
+ };
120
+ readonly submit_resolution: {
121
+ readonly description: "Submit oracle resolution";
122
+ readonly required: readonly ["outcome", "proof"];
123
+ readonly properties: {
124
+ readonly outcome: {
125
+ readonly type: "string";
126
+ };
127
+ readonly proof: {
128
+ readonly type: "string";
129
+ };
130
+ };
131
+ };
132
+ readonly finalize: {
133
+ readonly description: "Finalize market after quorum reached";
134
+ readonly properties: {
135
+ readonly outcome: {
136
+ readonly type: "string";
137
+ };
138
+ };
139
+ };
140
+ readonly dispute: {
141
+ readonly description: "Dispute the resolution";
142
+ readonly required: readonly ["stake"];
143
+ readonly properties: {
144
+ readonly stake: {
145
+ readonly type: "number";
146
+ readonly minimum: 0;
147
+ };
148
+ readonly reason: {
149
+ readonly type: "string";
150
+ };
151
+ };
152
+ };
153
+ readonly ruling: {
154
+ readonly description: "Judicial ruling on dispute";
155
+ readonly properties: {
156
+ readonly judicialRuling: {
157
+ readonly type: "boolean";
158
+ };
159
+ readonly outcome: {
160
+ readonly type: "string";
161
+ };
162
+ readonly rulingId: {
163
+ readonly type: "string";
164
+ };
165
+ };
166
+ };
167
+ readonly invalidate: {
168
+ readonly description: "Invalidate market by oracle consensus";
169
+ };
170
+ readonly claim: {
171
+ readonly description: "Claim payout after settlement";
172
+ readonly properties: {
173
+ readonly amount: {
174
+ readonly type: "number";
175
+ };
176
+ };
177
+ };
178
+ };
179
+ readonly states: {
180
+ readonly PROPOSED: {
181
+ readonly id: "PROPOSED";
182
+ readonly isFinal: false;
183
+ readonly metadata: {
184
+ readonly description: "Market created but not yet open for trading";
185
+ };
186
+ };
187
+ readonly OPEN: {
188
+ readonly id: "OPEN";
189
+ readonly isFinal: false;
190
+ readonly metadata: {
191
+ readonly description: "Accepting positions on outcomes";
192
+ };
193
+ };
194
+ readonly CLOSED: {
195
+ readonly id: "CLOSED";
196
+ readonly isFinal: false;
197
+ readonly metadata: {
198
+ readonly description: "No more positions, awaiting resolution";
199
+ };
200
+ };
201
+ readonly RESOLVING: {
202
+ readonly id: "RESOLVING";
203
+ readonly isFinal: false;
204
+ readonly metadata: {
205
+ readonly description: "Oracle(s) submitting resolution";
206
+ };
207
+ };
208
+ readonly DISPUTED: {
209
+ readonly id: "DISPUTED";
210
+ readonly isFinal: false;
211
+ readonly metadata: {
212
+ readonly description: "Resolution challenged, awaiting arbitration";
213
+ };
214
+ };
215
+ readonly SETTLED: {
216
+ readonly id: "SETTLED";
217
+ readonly isFinal: true;
218
+ readonly metadata: {
219
+ readonly description: "Outcome finalized, payouts available";
220
+ };
221
+ };
222
+ readonly REFUNDED: {
223
+ readonly id: "REFUNDED";
224
+ readonly isFinal: true;
225
+ readonly metadata: {
226
+ readonly description: "Market invalidated, all positions refunded";
227
+ };
228
+ };
229
+ readonly CANCELLED: {
230
+ readonly id: "CANCELLED";
231
+ readonly isFinal: true;
232
+ readonly metadata: {
233
+ readonly description: "Market cancelled before opening";
234
+ };
235
+ };
236
+ };
237
+ readonly initialState: "PROPOSED";
238
+ readonly transitions: readonly [{
239
+ readonly from: "PROPOSED";
240
+ readonly to: "OPEN";
241
+ readonly eventName: "open";
242
+ readonly guard: {
243
+ readonly "===": readonly [{
244
+ readonly var: "event.agent";
245
+ }, {
246
+ readonly var: "state.creator";
247
+ }];
248
+ };
249
+ readonly effect: {
250
+ readonly merge: readonly [{
251
+ readonly var: "state";
252
+ }, {
253
+ readonly status: "OPEN";
254
+ readonly openedAt: {
255
+ readonly var: "$timestamp";
256
+ };
257
+ readonly positions: {};
258
+ readonly totalPool: 0;
259
+ }];
260
+ };
261
+ readonly dependencies: readonly [];
262
+ }, {
263
+ readonly from: "PROPOSED";
264
+ readonly to: "CANCELLED";
265
+ readonly eventName: "cancel";
266
+ readonly guard: {
267
+ readonly "===": readonly [{
268
+ readonly var: "event.agent";
269
+ }, {
270
+ readonly var: "state.creator";
271
+ }];
272
+ };
273
+ readonly effect: {
274
+ readonly merge: readonly [{
275
+ readonly var: "state";
276
+ }, {
277
+ readonly status: "CANCELLED";
278
+ readonly cancelledAt: {
279
+ readonly var: "$timestamp";
280
+ };
281
+ readonly reason: {
282
+ readonly var: "event.reason";
283
+ };
284
+ }];
285
+ };
286
+ readonly dependencies: readonly [];
287
+ }, {
288
+ readonly from: "OPEN";
289
+ readonly to: "OPEN";
290
+ readonly eventName: "take_position";
291
+ readonly guard: {
292
+ readonly and: readonly [{
293
+ readonly ">": readonly [{
294
+ readonly var: "event.amount";
295
+ }, 0];
296
+ }, {
297
+ readonly in: readonly [{
298
+ readonly var: "event.outcome";
299
+ }, {
300
+ readonly var: "state.outcomes";
301
+ }];
302
+ }, {
303
+ readonly or: readonly [{
304
+ readonly "!": readonly [{
305
+ readonly var: "state.deadline";
306
+ }];
307
+ }, {
308
+ readonly "<=": readonly [{
309
+ readonly var: "$timestamp";
310
+ }, {
311
+ readonly var: "state.deadline";
312
+ }];
313
+ }];
314
+ }];
315
+ };
316
+ readonly effect: {
317
+ readonly merge: readonly [{
318
+ readonly var: "state";
319
+ }, {
320
+ readonly positions: {
321
+ readonly merge: readonly [{
322
+ readonly var: "state.positions";
323
+ }, {
324
+ readonly __computed: {
325
+ readonly cat: readonly [{
326
+ readonly var: "event.agent";
327
+ }, "_", {
328
+ readonly var: "event.outcome";
329
+ }];
330
+ };
331
+ }];
332
+ };
333
+ readonly totalPool: {
334
+ readonly "+": readonly [{
335
+ readonly var: "state.totalPool";
336
+ }, {
337
+ readonly var: "event.amount";
338
+ }];
339
+ };
340
+ }];
341
+ };
342
+ readonly dependencies: readonly [];
343
+ }, {
344
+ readonly from: "OPEN";
345
+ readonly to: "CLOSED";
346
+ readonly eventName: "close";
347
+ readonly guard: {
348
+ readonly or: readonly [{
349
+ readonly "===": readonly [{
350
+ readonly var: "event.agent";
351
+ }, {
352
+ readonly var: "state.creator";
353
+ }];
354
+ }, {
355
+ readonly and: readonly [{
356
+ readonly var: "state.deadline";
357
+ }, {
358
+ readonly ">=": readonly [{
359
+ readonly var: "$timestamp";
360
+ }, {
361
+ readonly var: "state.deadline";
362
+ }];
363
+ }];
364
+ }];
365
+ };
366
+ readonly effect: {
367
+ readonly merge: readonly [{
368
+ readonly var: "state";
369
+ }, {
370
+ readonly status: "CLOSED";
371
+ readonly closedAt: {
372
+ readonly var: "$timestamp";
373
+ };
374
+ }];
375
+ };
376
+ readonly dependencies: readonly [];
377
+ }, {
378
+ readonly from: "CLOSED";
379
+ readonly to: "RESOLVING";
380
+ readonly eventName: "submit_resolution";
381
+ readonly guard: {
382
+ readonly in: readonly [{
383
+ readonly var: "event.agent";
384
+ }, {
385
+ readonly var: "state.oracles";
386
+ }];
387
+ };
388
+ readonly effect: {
389
+ readonly merge: readonly [{
390
+ readonly var: "state";
391
+ }, {
392
+ readonly status: "RESOLVING";
393
+ readonly resolutions: readonly [{
394
+ readonly oracle: {
395
+ readonly var: "event.agent";
396
+ };
397
+ readonly outcome: {
398
+ readonly var: "event.outcome";
399
+ };
400
+ readonly proof: {
401
+ readonly var: "event.proof";
402
+ };
403
+ readonly submittedAt: {
404
+ readonly var: "$timestamp";
405
+ };
406
+ }];
407
+ }];
408
+ };
409
+ readonly dependencies: readonly [];
410
+ }, {
411
+ readonly from: "RESOLVING";
412
+ readonly to: "RESOLVING";
413
+ readonly eventName: "submit_resolution";
414
+ readonly guard: {
415
+ readonly and: readonly [{
416
+ readonly in: readonly [{
417
+ readonly var: "event.agent";
418
+ }, {
419
+ readonly var: "state.oracles";
420
+ }];
421
+ }, {
422
+ readonly "!": readonly [{
423
+ readonly in: readonly [{
424
+ readonly var: "event.agent";
425
+ }, {
426
+ readonly map: readonly [{
427
+ readonly var: "state.resolutions";
428
+ }, {
429
+ readonly var: "oracle";
430
+ }];
431
+ }];
432
+ }];
433
+ }];
434
+ };
435
+ readonly effect: {
436
+ readonly merge: readonly [{
437
+ readonly var: "state";
438
+ }, {
439
+ readonly resolutions: {
440
+ readonly cat: readonly [{
441
+ readonly var: "state.resolutions";
442
+ }, readonly [{
443
+ readonly oracle: {
444
+ readonly var: "event.agent";
445
+ };
446
+ readonly outcome: {
447
+ readonly var: "event.outcome";
448
+ };
449
+ readonly proof: {
450
+ readonly var: "event.proof";
451
+ };
452
+ readonly submittedAt: {
453
+ readonly var: "$timestamp";
454
+ };
455
+ }]];
456
+ };
457
+ }];
458
+ };
459
+ readonly dependencies: readonly [];
460
+ }, {
461
+ readonly from: "RESOLVING";
462
+ readonly to: "SETTLED";
463
+ readonly eventName: "finalize";
464
+ readonly guard: {
465
+ readonly ">=": readonly [{
466
+ readonly size: {
467
+ readonly var: "state.resolutions";
468
+ };
469
+ }, {
470
+ readonly var: "state.quorum";
471
+ }];
472
+ };
473
+ readonly effect: {
474
+ readonly merge: readonly [{
475
+ readonly var: "state";
476
+ }, {
477
+ readonly status: "SETTLED";
478
+ readonly settledAt: {
479
+ readonly var: "$timestamp";
480
+ };
481
+ readonly finalOutcome: {
482
+ readonly var: "event.outcome";
483
+ };
484
+ readonly claims: readonly [];
485
+ }];
486
+ };
487
+ readonly dependencies: readonly [];
488
+ }, {
489
+ readonly from: "RESOLVING";
490
+ readonly to: "DISPUTED";
491
+ readonly eventName: "dispute";
492
+ readonly guard: {
493
+ readonly and: readonly [{
494
+ readonly ">": readonly [{
495
+ readonly size: {
496
+ readonly filter: readonly [{
497
+ readonly var: "state.positions";
498
+ }, {
499
+ readonly "===": readonly [{
500
+ readonly var: "agent";
501
+ }, {
502
+ readonly var: "event.agent";
503
+ }];
504
+ }];
505
+ };
506
+ }, 0];
507
+ }, {
508
+ readonly var: "event.stake";
509
+ }];
510
+ };
511
+ readonly effect: {
512
+ readonly merge: readonly [{
513
+ readonly var: "state";
514
+ }, {
515
+ readonly status: "DISPUTED";
516
+ readonly disputedAt: {
517
+ readonly var: "$timestamp";
518
+ };
519
+ readonly disputedBy: {
520
+ readonly var: "event.agent";
521
+ };
522
+ readonly disputeStake: {
523
+ readonly var: "event.stake";
524
+ };
525
+ readonly disputeReason: {
526
+ readonly var: "event.reason";
527
+ };
528
+ }];
529
+ };
530
+ readonly dependencies: readonly [];
531
+ }, {
532
+ readonly from: "DISPUTED";
533
+ readonly to: "SETTLED";
534
+ readonly eventName: "ruling";
535
+ readonly guard: {
536
+ readonly var: "event.judicialRuling";
537
+ };
538
+ readonly effect: {
539
+ readonly merge: readonly [{
540
+ readonly var: "state";
541
+ }, {
542
+ readonly status: "SETTLED";
543
+ readonly settledAt: {
544
+ readonly var: "$timestamp";
545
+ };
546
+ readonly finalOutcome: {
547
+ readonly var: "event.outcome";
548
+ };
549
+ readonly rulingId: {
550
+ readonly var: "event.rulingId";
551
+ };
552
+ readonly claims: readonly [];
553
+ }];
554
+ };
555
+ readonly dependencies: readonly [];
556
+ }, {
557
+ readonly from: "RESOLVING";
558
+ readonly to: "REFUNDED";
559
+ readonly eventName: "invalidate";
560
+ readonly guard: {
561
+ readonly ">=": readonly [{
562
+ readonly size: {
563
+ readonly filter: readonly [{
564
+ readonly var: "state.resolutions";
565
+ }, {
566
+ readonly "===": readonly [{
567
+ readonly var: "outcome";
568
+ }, "INVALID"];
569
+ }];
570
+ };
571
+ }, {
572
+ readonly var: "state.quorum";
573
+ }];
574
+ };
575
+ readonly effect: {
576
+ readonly merge: readonly [{
577
+ readonly var: "state";
578
+ }, {
579
+ readonly status: "REFUNDED";
580
+ readonly refundedAt: {
581
+ readonly var: "$timestamp";
582
+ };
583
+ readonly reason: "oracle_invalidation";
584
+ }];
585
+ };
586
+ readonly dependencies: readonly [];
587
+ }, {
588
+ readonly from: "SETTLED";
589
+ readonly to: "SETTLED";
590
+ readonly eventName: "claim";
591
+ readonly guard: {
592
+ readonly and: readonly [{
593
+ readonly ">": readonly [{
594
+ readonly size: {
595
+ readonly filter: readonly [{
596
+ readonly var: "state.positions";
597
+ }, {
598
+ readonly and: readonly [{
599
+ readonly "===": readonly [{
600
+ readonly var: "agent";
601
+ }, {
602
+ readonly var: "event.agent";
603
+ }];
604
+ }, {
605
+ readonly "===": readonly [{
606
+ readonly var: "outcome";
607
+ }, {
608
+ readonly var: "state.finalOutcome";
609
+ }];
610
+ }];
611
+ }];
612
+ };
613
+ }, 0];
614
+ }, {
615
+ readonly "!": readonly [{
616
+ readonly in: readonly [{
617
+ readonly var: "event.agent";
618
+ }, {
619
+ readonly map: readonly [{
620
+ readonly var: "state.claims";
621
+ }, {
622
+ readonly var: "agent";
623
+ }];
624
+ }];
625
+ }];
626
+ }];
627
+ };
628
+ readonly effect: {
629
+ readonly merge: readonly [{
630
+ readonly var: "state";
631
+ }, {
632
+ readonly claims: {
633
+ readonly cat: readonly [{
634
+ readonly var: "state.claims";
635
+ }, readonly [{
636
+ readonly agent: {
637
+ readonly var: "event.agent";
638
+ };
639
+ readonly amount: {
640
+ readonly var: "event.amount";
641
+ };
642
+ readonly claimedAt: {
643
+ readonly var: "$timestamp";
644
+ };
645
+ }]];
646
+ };
647
+ }];
648
+ };
649
+ readonly dependencies: readonly [];
650
+ }];
651
+ };