@ottochain/sdk 2.0.0 → 2.1.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 +55 -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 +47 -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 +139 -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
@@ -1,1680 +1,10 @@
1
1
  /**
2
- * Auto-generated from JSON state machine definitions.
3
- * DO NOT EDIT - regenerate with: npm run prebuild
2
+ * Markets State Machine Definitions
3
+ *
4
+ * TypeScript-first definitions using defineFiberApp() - no JSON, no code generation.
4
5
  */
5
- export declare const marketAuctionDef: {
6
- readonly metadata: {
7
- readonly name: "MarketAuction";
8
- readonly description: "Auction market supporting English, Dutch, and sealed-bid variants";
9
- readonly version: "1.0.0";
10
- readonly crossReferences: {
11
- readonly sellerIdentityId: "Links to seller's IdentityAgent";
12
- readonly escrowId: "Links to ContractEscrow for asset custody";
13
- };
14
- };
15
- readonly states: {
16
- readonly PROPOSED: {
17
- readonly id: "PROPOSED";
18
- readonly isFinal: false;
19
- readonly metadata: {
20
- readonly description: "Auction created but not yet open";
21
- };
22
- };
23
- readonly OPEN: {
24
- readonly id: "OPEN";
25
- readonly isFinal: false;
26
- readonly metadata: {
27
- readonly description: "Accepting bids";
28
- };
29
- };
30
- readonly CLOSING: {
31
- readonly id: "CLOSING";
32
- readonly isFinal: false;
33
- readonly metadata: {
34
- readonly description: "Bid period ended, determining winner";
35
- };
36
- };
37
- readonly SETTLED: {
38
- readonly id: "SETTLED";
39
- readonly isFinal: true;
40
- readonly metadata: {
41
- readonly description: "Winner determined, transfer complete";
42
- };
43
- };
44
- readonly NO_SALE: {
45
- readonly id: "NO_SALE";
46
- readonly isFinal: true;
47
- readonly metadata: {
48
- readonly description: "Reserve not met or no valid bids";
49
- };
50
- };
51
- readonly CANCELLED: {
52
- readonly id: "CANCELLED";
53
- readonly isFinal: true;
54
- readonly metadata: {
55
- readonly description: "Auction cancelled by seller";
56
- };
57
- };
58
- };
59
- readonly initialState: "PROPOSED";
60
- readonly transitions: readonly [{
61
- readonly from: "PROPOSED";
62
- readonly to: "OPEN";
63
- readonly eventName: "open";
64
- readonly guard: {
65
- readonly "===": readonly [{
66
- readonly var: "event.agent";
67
- }, {
68
- readonly var: "state.seller";
69
- }];
70
- };
71
- readonly effect: {
72
- readonly merge: readonly [{
73
- readonly var: "state";
74
- }, {
75
- readonly status: "OPEN";
76
- readonly openedAt: {
77
- readonly var: "$timestamp";
78
- };
79
- readonly bids: readonly [];
80
- readonly highBid: null;
81
- readonly highBidder: null;
82
- }];
83
- };
84
- readonly dependencies: readonly [];
85
- }, {
86
- readonly from: "PROPOSED";
87
- readonly to: "CANCELLED";
88
- readonly eventName: "cancel";
89
- readonly guard: {
90
- readonly "===": readonly [{
91
- readonly var: "event.agent";
92
- }, {
93
- readonly var: "state.seller";
94
- }];
95
- };
96
- readonly effect: {
97
- readonly merge: readonly [{
98
- readonly var: "state";
99
- }, {
100
- readonly status: "CANCELLED";
101
- readonly cancelledAt: {
102
- readonly var: "$timestamp";
103
- };
104
- }];
105
- };
106
- readonly dependencies: readonly [];
107
- }, {
108
- readonly from: "OPEN";
109
- readonly to: "OPEN";
110
- readonly eventName: "bid";
111
- readonly guard: {
112
- readonly and: readonly [{
113
- readonly "!==": readonly [{
114
- readonly var: "event.agent";
115
- }, {
116
- readonly var: "state.seller";
117
- }];
118
- }, {
119
- readonly ">=": readonly [{
120
- readonly var: "event.amount";
121
- }, {
122
- readonly var: "state.minBid";
123
- }];
124
- }, {
125
- readonly or: readonly [{
126
- readonly "!": readonly [{
127
- readonly var: "state.highBid";
128
- }];
129
- }, {
130
- readonly ">=": readonly [{
131
- readonly var: "event.amount";
132
- }, {
133
- readonly "+": readonly [{
134
- readonly var: "state.highBid";
135
- }, {
136
- readonly var: "state.bidIncrement";
137
- }];
138
- }];
139
- }];
140
- }, {
141
- readonly or: readonly [{
142
- readonly "!": readonly [{
143
- readonly var: "state.deadline";
144
- }];
145
- }, {
146
- readonly "<=": readonly [{
147
- readonly var: "$timestamp";
148
- }, {
149
- readonly var: "state.deadline";
150
- }];
151
- }];
152
- }];
153
- };
154
- readonly effect: {
155
- readonly merge: readonly [{
156
- readonly var: "state";
157
- }, {
158
- readonly bids: {
159
- readonly cat: readonly [{
160
- readonly var: "state.bids";
161
- }, readonly [{
162
- readonly bidder: {
163
- readonly var: "event.agent";
164
- };
165
- readonly amount: {
166
- readonly var: "event.amount";
167
- };
168
- readonly bidAt: {
169
- readonly var: "$timestamp";
170
- };
171
- }]];
172
- };
173
- readonly highBid: {
174
- readonly var: "event.amount";
175
- };
176
- readonly highBidder: {
177
- readonly var: "event.agent";
178
- };
179
- readonly lastBidAt: {
180
- readonly var: "$timestamp";
181
- };
182
- }];
183
- };
184
- readonly dependencies: readonly [];
185
- }, {
186
- readonly from: "OPEN";
187
- readonly to: "CLOSING";
188
- readonly eventName: "close";
189
- readonly guard: {
190
- readonly or: readonly [{
191
- readonly "===": readonly [{
192
- readonly var: "event.agent";
193
- }, {
194
- readonly var: "state.seller";
195
- }];
196
- }, {
197
- readonly and: readonly [{
198
- readonly var: "state.deadline";
199
- }, {
200
- readonly ">=": readonly [{
201
- readonly var: "$timestamp";
202
- }, {
203
- readonly var: "state.deadline";
204
- }];
205
- }];
206
- }];
207
- };
208
- readonly effect: {
209
- readonly merge: readonly [{
210
- readonly var: "state";
211
- }, {
212
- readonly status: "CLOSING";
213
- readonly closedAt: {
214
- readonly var: "$timestamp";
215
- };
216
- }];
217
- };
218
- readonly dependencies: readonly [];
219
- }, {
220
- readonly from: "CLOSING";
221
- readonly to: "SETTLED";
222
- readonly eventName: "settle";
223
- readonly guard: {
224
- readonly and: readonly [{
225
- readonly var: "state.highBidder";
226
- }, {
227
- readonly or: readonly [{
228
- readonly "!": readonly [{
229
- readonly var: "state.reservePrice";
230
- }];
231
- }, {
232
- readonly ">=": readonly [{
233
- readonly var: "state.highBid";
234
- }, {
235
- readonly var: "state.reservePrice";
236
- }];
237
- }];
238
- }];
239
- };
240
- readonly effect: {
241
- readonly merge: readonly [{
242
- readonly var: "state";
243
- }, {
244
- readonly status: "SETTLED";
245
- readonly settledAt: {
246
- readonly var: "$timestamp";
247
- };
248
- readonly winner: {
249
- readonly var: "state.highBidder";
250
- };
251
- readonly finalPrice: {
252
- readonly var: "state.highBid";
253
- };
254
- }];
255
- };
256
- readonly dependencies: readonly [];
257
- }, {
258
- readonly from: "CLOSING";
259
- readonly to: "NO_SALE";
260
- readonly eventName: "no_sale";
261
- readonly guard: {
262
- readonly or: readonly [{
263
- readonly "!": readonly [{
264
- readonly var: "state.highBidder";
265
- }];
266
- }, {
267
- readonly and: readonly [{
268
- readonly var: "state.reservePrice";
269
- }, {
270
- readonly "<": readonly [{
271
- readonly var: "state.highBid";
272
- }, {
273
- readonly var: "state.reservePrice";
274
- }];
275
- }];
276
- }];
277
- };
278
- readonly effect: {
279
- readonly merge: readonly [{
280
- readonly var: "state";
281
- }, {
282
- readonly status: "NO_SALE";
283
- readonly closedAt: {
284
- readonly var: "$timestamp";
285
- };
286
- readonly reason: {
287
- readonly if: readonly [{
288
- readonly "!": readonly [{
289
- readonly var: "state.highBidder";
290
- }];
291
- }, "no_bids", "reserve_not_met"];
292
- };
293
- }];
294
- };
295
- readonly dependencies: readonly [];
296
- }];
297
- };
298
- export declare const marketCrowdfundDef: {
299
- readonly metadata: {
300
- readonly name: "MarketCrowdfund";
301
- readonly description: "All-or-nothing crowdfunding with threshold, deadline, and stretch goals";
302
- readonly version: "1.0.0";
303
- readonly crossReferences: {
304
- readonly creatorIdentityId: "Links to creator's IdentityAgent";
305
- readonly treasuryId: "Links to Treasury for fund custody";
306
- };
307
- };
308
- readonly states: {
309
- readonly PROPOSED: {
310
- readonly id: "PROPOSED";
311
- readonly isFinal: false;
312
- readonly metadata: {
313
- readonly description: "Campaign created but not yet open";
314
- };
315
- };
316
- readonly OPEN: {
317
- readonly id: "OPEN";
318
- readonly isFinal: false;
319
- readonly metadata: {
320
- readonly description: "Accepting pledges";
321
- };
322
- };
323
- readonly FUNDED: {
324
- readonly id: "FUNDED";
325
- readonly isFinal: true;
326
- readonly metadata: {
327
- readonly description: "Threshold met, funds released to creator";
328
- };
329
- };
330
- readonly REFUNDED: {
331
- readonly id: "REFUNDED";
332
- readonly isFinal: true;
333
- readonly metadata: {
334
- readonly description: "Threshold not met, all pledges refunded";
335
- };
336
- };
337
- readonly CANCELLED: {
338
- readonly id: "CANCELLED";
339
- readonly isFinal: true;
340
- readonly metadata: {
341
- readonly description: "Campaign cancelled by creator";
342
- };
343
- };
344
- };
345
- readonly initialState: "PROPOSED";
346
- readonly transitions: readonly [{
347
- readonly from: "PROPOSED";
348
- readonly to: "OPEN";
349
- readonly eventName: "launch";
350
- readonly guard: {
351
- readonly "===": readonly [{
352
- readonly var: "event.agent";
353
- }, {
354
- readonly var: "state.creator";
355
- }];
356
- };
357
- readonly effect: {
358
- readonly merge: readonly [{
359
- readonly var: "state";
360
- }, {
361
- readonly status: "OPEN";
362
- readonly launchedAt: {
363
- readonly var: "$timestamp";
364
- };
365
- readonly pledges: readonly [];
366
- readonly totalPledged: 0;
367
- readonly backerCount: 0;
368
- }];
369
- };
370
- readonly dependencies: readonly [];
371
- }, {
372
- readonly from: "PROPOSED";
373
- readonly to: "CANCELLED";
374
- readonly eventName: "cancel";
375
- readonly guard: {
376
- readonly "===": readonly [{
377
- readonly var: "event.agent";
378
- }, {
379
- readonly var: "state.creator";
380
- }];
381
- };
382
- readonly effect: {
383
- readonly merge: readonly [{
384
- readonly var: "state";
385
- }, {
386
- readonly status: "CANCELLED";
387
- readonly cancelledAt: {
388
- readonly var: "$timestamp";
389
- };
390
- }];
391
- };
392
- readonly dependencies: readonly [];
393
- }, {
394
- readonly from: "OPEN";
395
- readonly to: "OPEN";
396
- readonly eventName: "pledge";
397
- readonly guard: {
398
- readonly and: readonly [{
399
- readonly ">": readonly [{
400
- readonly var: "event.amount";
401
- }, 0];
402
- }, {
403
- readonly "!==": readonly [{
404
- readonly var: "event.agent";
405
- }, {
406
- readonly var: "state.creator";
407
- }];
408
- }, {
409
- readonly or: readonly [{
410
- readonly "!": readonly [{
411
- readonly var: "state.minPledge";
412
- }];
413
- }, {
414
- readonly ">=": readonly [{
415
- readonly var: "event.amount";
416
- }, {
417
- readonly var: "state.minPledge";
418
- }];
419
- }];
420
- }, {
421
- readonly "<=": readonly [{
422
- readonly var: "$timestamp";
423
- }, {
424
- readonly var: "state.deadline";
425
- }];
426
- }];
427
- };
428
- readonly effect: {
429
- readonly merge: readonly [{
430
- readonly var: "state";
431
- }, {
432
- readonly pledges: {
433
- readonly cat: readonly [{
434
- readonly var: "state.pledges";
435
- }, readonly [{
436
- readonly backer: {
437
- readonly var: "event.agent";
438
- };
439
- readonly amount: {
440
- readonly var: "event.amount";
441
- };
442
- readonly rewardTier: {
443
- readonly var: "event.rewardTier";
444
- };
445
- readonly pledgedAt: {
446
- readonly var: "$timestamp";
447
- };
448
- }]];
449
- };
450
- readonly totalPledged: {
451
- readonly "+": readonly [{
452
- readonly var: "state.totalPledged";
453
- }, {
454
- readonly var: "event.amount";
455
- }];
456
- };
457
- readonly backerCount: {
458
- readonly "+": readonly [{
459
- readonly var: "state.backerCount";
460
- }, 1];
461
- };
462
- }];
463
- };
464
- readonly dependencies: readonly [];
465
- }, {
466
- readonly from: "OPEN";
467
- readonly to: "OPEN";
468
- readonly eventName: "increase_pledge";
469
- readonly guard: {
470
- readonly and: readonly [{
471
- readonly ">": readonly [{
472
- readonly var: "event.additionalAmount";
473
- }, 0];
474
- }, {
475
- readonly "<=": readonly [{
476
- readonly var: "$timestamp";
477
- }, {
478
- readonly var: "state.deadline";
479
- }];
480
- }, {
481
- readonly ">": readonly [{
482
- readonly size: {
483
- readonly filter: readonly [{
484
- readonly var: "state.pledges";
485
- }, {
486
- readonly "===": readonly [{
487
- readonly var: "backer";
488
- }, {
489
- readonly var: "event.agent";
490
- }];
491
- }];
492
- };
493
- }, 0];
494
- }];
495
- };
496
- readonly effect: {
497
- readonly merge: readonly [{
498
- readonly var: "state";
499
- }, {
500
- readonly totalPledged: {
501
- readonly "+": readonly [{
502
- readonly var: "state.totalPledged";
503
- }, {
504
- readonly var: "event.additionalAmount";
505
- }];
506
- };
507
- }];
508
- };
509
- readonly dependencies: readonly [];
510
- }, {
511
- readonly from: "OPEN";
512
- readonly to: "FUNDED";
513
- readonly eventName: "finalize";
514
- readonly guard: {
515
- readonly and: readonly [{
516
- readonly ">=": readonly [{
517
- readonly var: "state.totalPledged";
518
- }, {
519
- readonly var: "state.threshold";
520
- }];
521
- }, {
522
- readonly ">=": readonly [{
523
- readonly var: "$timestamp";
524
- }, {
525
- readonly var: "state.deadline";
526
- }];
527
- }];
528
- };
529
- readonly effect: {
530
- readonly merge: readonly [{
531
- readonly var: "state";
532
- }, {
533
- readonly status: "FUNDED";
534
- readonly fundedAt: {
535
- readonly var: "$timestamp";
536
- };
537
- readonly stretchGoalsReached: {
538
- readonly filter: readonly [{
539
- readonly var: "state.stretchGoals";
540
- }, {
541
- readonly "<=": readonly [{
542
- readonly var: "target";
543
- }, {
544
- readonly var: "state.totalPledged";
545
- }];
546
- }];
547
- };
548
- }];
549
- };
550
- readonly dependencies: readonly [];
551
- }, {
552
- readonly from: "OPEN";
553
- readonly to: "REFUNDED";
554
- readonly eventName: "finalize";
555
- readonly guard: {
556
- readonly and: readonly [{
557
- readonly "<": readonly [{
558
- readonly var: "state.totalPledged";
559
- }, {
560
- readonly var: "state.threshold";
561
- }];
562
- }, {
563
- readonly ">=": readonly [{
564
- readonly var: "$timestamp";
565
- }, {
566
- readonly var: "state.deadline";
567
- }];
568
- }];
569
- };
570
- readonly effect: {
571
- readonly merge: readonly [{
572
- readonly var: "state";
573
- }, {
574
- readonly status: "REFUNDED";
575
- readonly refundedAt: {
576
- readonly var: "$timestamp";
577
- };
578
- readonly reason: "threshold_not_met";
579
- }];
580
- };
581
- readonly dependencies: readonly [];
582
- }, {
583
- readonly from: "REFUNDED";
584
- readonly to: "REFUNDED";
585
- readonly eventName: "claim_refund";
586
- readonly guard: {
587
- readonly and: readonly [{
588
- readonly ">": readonly [{
589
- readonly size: {
590
- readonly filter: readonly [{
591
- readonly var: "state.pledges";
592
- }, {
593
- readonly "===": readonly [{
594
- readonly var: "backer";
595
- }, {
596
- readonly var: "event.agent";
597
- }];
598
- }];
599
- };
600
- }, 0];
601
- }, {
602
- readonly "!": readonly [{
603
- readonly in: readonly [{
604
- readonly var: "event.agent";
605
- }, {
606
- readonly var: "state.refundsClaimed";
607
- }];
608
- }];
609
- }];
610
- };
611
- readonly effect: {
612
- readonly merge: readonly [{
613
- readonly var: "state";
614
- }, {
615
- readonly refundsClaimed: {
616
- readonly cat: readonly [{
617
- readonly var: "state.refundsClaimed";
618
- }, readonly [{
619
- readonly var: "event.agent";
620
- }]];
621
- };
622
- }];
623
- };
624
- readonly dependencies: readonly [];
625
- }];
626
- };
627
- export declare const marketGroupBuyDef: {
628
- readonly metadata: {
629
- readonly name: "MarketGroupBuy";
630
- readonly description: "Collective purchasing with quantity thresholds and tiered pricing";
631
- readonly version: "1.0.0";
632
- readonly crossReferences: {
633
- readonly vendorIdentityId: "Links to vendor's IdentityAgent";
634
- readonly escrowId: "Links to ContractEscrow for payment custody";
635
- };
636
- };
637
- readonly states: {
638
- readonly PROPOSED: {
639
- readonly id: "PROPOSED";
640
- readonly isFinal: false;
641
- readonly metadata: {
642
- readonly description: "Group buy created but not yet open";
643
- };
644
- };
645
- readonly OPEN: {
646
- readonly id: "OPEN";
647
- readonly isFinal: false;
648
- readonly metadata: {
649
- readonly description: "Accepting orders";
650
- };
651
- };
652
- readonly THRESHOLD_MET: {
653
- readonly id: "THRESHOLD_MET";
654
- readonly isFinal: false;
655
- readonly metadata: {
656
- readonly description: "Minimum quantity reached, continuing for better tier";
657
- };
658
- };
659
- readonly PROCESSING: {
660
- readonly id: "PROCESSING";
661
- readonly isFinal: false;
662
- readonly metadata: {
663
- readonly description: "Order placed with vendor, awaiting fulfillment";
664
- };
665
- };
666
- readonly FULFILLED: {
667
- readonly id: "FULFILLED";
668
- readonly isFinal: true;
669
- readonly metadata: {
670
- readonly description: "All items delivered to buyers";
671
- };
672
- };
673
- readonly REFUNDED: {
674
- readonly id: "REFUNDED";
675
- readonly isFinal: true;
676
- readonly metadata: {
677
- readonly description: "Threshold not met, all orders refunded";
678
- };
679
- };
680
- readonly CANCELLED: {
681
- readonly id: "CANCELLED";
682
- readonly isFinal: true;
683
- readonly metadata: {
684
- readonly description: "Group buy cancelled";
685
- };
686
- };
687
- };
688
- readonly initialState: "PROPOSED";
689
- readonly transitions: readonly [{
690
- readonly from: "PROPOSED";
691
- readonly to: "OPEN";
692
- readonly eventName: "open";
693
- readonly guard: {
694
- readonly "===": readonly [{
695
- readonly var: "event.agent";
696
- }, {
697
- readonly var: "state.organizer";
698
- }];
699
- };
700
- readonly effect: {
701
- readonly merge: readonly [{
702
- readonly var: "state";
703
- }, {
704
- readonly status: "OPEN";
705
- readonly openedAt: {
706
- readonly var: "$timestamp";
707
- };
708
- readonly orders: readonly [];
709
- readonly totalQuantity: 0;
710
- readonly currentTier: 0;
711
- }];
712
- };
713
- readonly dependencies: readonly [];
714
- }, {
715
- readonly from: "PROPOSED";
716
- readonly to: "CANCELLED";
717
- readonly eventName: "cancel";
718
- readonly guard: {
719
- readonly "===": readonly [{
720
- readonly var: "event.agent";
721
- }, {
722
- readonly var: "state.organizer";
723
- }];
724
- };
725
- readonly effect: {
726
- readonly merge: readonly [{
727
- readonly var: "state";
728
- }, {
729
- readonly status: "CANCELLED";
730
- readonly cancelledAt: {
731
- readonly var: "$timestamp";
732
- };
733
- }];
734
- };
735
- readonly dependencies: readonly [];
736
- }, {
737
- readonly from: "OPEN";
738
- readonly to: "OPEN";
739
- readonly eventName: "order";
740
- readonly guard: {
741
- readonly and: readonly [{
742
- readonly ">": readonly [{
743
- readonly var: "event.quantity";
744
- }, 0];
745
- }, {
746
- readonly or: readonly [{
747
- readonly "!": readonly [{
748
- readonly var: "state.maxPerBuyer";
749
- }];
750
- }, {
751
- readonly "<=": readonly [{
752
- readonly var: "event.quantity";
753
- }, {
754
- readonly var: "state.maxPerBuyer";
755
- }];
756
- }];
757
- }, {
758
- readonly "<=": readonly [{
759
- readonly var: "$timestamp";
760
- }, {
761
- readonly var: "state.deadline";
762
- }];
763
- }];
764
- };
765
- readonly effect: {
766
- readonly merge: readonly [{
767
- readonly var: "state";
768
- }, {
769
- readonly orders: {
770
- readonly cat: readonly [{
771
- readonly var: "state.orders";
772
- }, readonly [{
773
- readonly buyer: {
774
- readonly var: "event.agent";
775
- };
776
- readonly quantity: {
777
- readonly var: "event.quantity";
778
- };
779
- readonly shippingInfo: {
780
- readonly var: "event.shippingInfo";
781
- };
782
- readonly orderedAt: {
783
- readonly var: "$timestamp";
784
- };
785
- }]];
786
- };
787
- readonly totalQuantity: {
788
- readonly "+": readonly [{
789
- readonly var: "state.totalQuantity";
790
- }, {
791
- readonly var: "event.quantity";
792
- }];
793
- };
794
- }];
795
- };
796
- readonly dependencies: readonly [];
797
- }, {
798
- readonly from: "OPEN";
799
- readonly to: "THRESHOLD_MET";
800
- readonly eventName: "check_threshold";
801
- readonly guard: {
802
- readonly ">=": readonly [{
803
- readonly var: "state.totalQuantity";
804
- }, {
805
- readonly var: "state.minQuantity";
806
- }];
807
- };
808
- readonly effect: {
809
- readonly merge: readonly [{
810
- readonly var: "state";
811
- }, {
812
- readonly status: "THRESHOLD_MET";
813
- readonly thresholdMetAt: {
814
- readonly var: "$timestamp";
815
- };
816
- readonly currentTier: {
817
- readonly reduce: readonly [{
818
- readonly var: "state.priceTiers";
819
- }, {
820
- readonly if: readonly [{
821
- readonly "<=": readonly [{
822
- readonly var: "current.minQuantity";
823
- }, {
824
- readonly var: "state.totalQuantity";
825
- }];
826
- }, {
827
- readonly var: "current.tier";
828
- }, {
829
- readonly var: "accumulator";
830
- }];
831
- }, 0];
832
- };
833
- }];
834
- };
835
- readonly dependencies: readonly [];
836
- }, {
837
- readonly from: "THRESHOLD_MET";
838
- readonly to: "THRESHOLD_MET";
839
- readonly eventName: "order";
840
- readonly guard: {
841
- readonly and: readonly [{
842
- readonly ">": readonly [{
843
- readonly var: "event.quantity";
844
- }, 0];
845
- }, {
846
- readonly "<=": readonly [{
847
- readonly var: "$timestamp";
848
- }, {
849
- readonly var: "state.deadline";
850
- }];
851
- }];
852
- };
853
- readonly effect: {
854
- readonly merge: readonly [{
855
- readonly var: "state";
856
- }, {
857
- readonly orders: {
858
- readonly cat: readonly [{
859
- readonly var: "state.orders";
860
- }, readonly [{
861
- readonly buyer: {
862
- readonly var: "event.agent";
863
- };
864
- readonly quantity: {
865
- readonly var: "event.quantity";
866
- };
867
- readonly shippingInfo: {
868
- readonly var: "event.shippingInfo";
869
- };
870
- readonly orderedAt: {
871
- readonly var: "$timestamp";
872
- };
873
- }]];
874
- };
875
- readonly totalQuantity: {
876
- readonly "+": readonly [{
877
- readonly var: "state.totalQuantity";
878
- }, {
879
- readonly var: "event.quantity";
880
- }];
881
- };
882
- readonly currentTier: {
883
- readonly reduce: readonly [{
884
- readonly var: "state.priceTiers";
885
- }, {
886
- readonly if: readonly [{
887
- readonly "<=": readonly [{
888
- readonly var: "current.minQuantity";
889
- }, {
890
- readonly "+": readonly [{
891
- readonly var: "state.totalQuantity";
892
- }, {
893
- readonly var: "event.quantity";
894
- }];
895
- }];
896
- }, {
897
- readonly var: "current.tier";
898
- }, {
899
- readonly var: "accumulator";
900
- }];
901
- }, {
902
- readonly var: "state.currentTier";
903
- }];
904
- };
905
- }];
906
- };
907
- readonly dependencies: readonly [];
908
- }, {
909
- readonly from: "THRESHOLD_MET";
910
- readonly to: "PROCESSING";
911
- readonly eventName: "finalize";
912
- readonly guard: {
913
- readonly ">=": readonly [{
914
- readonly var: "$timestamp";
915
- }, {
916
- readonly var: "state.deadline";
917
- }];
918
- };
919
- readonly effect: {
920
- readonly merge: readonly [{
921
- readonly var: "state";
922
- }, {
923
- readonly status: "PROCESSING";
924
- readonly finalizedAt: {
925
- readonly var: "$timestamp";
926
- };
927
- readonly finalTier: {
928
- readonly var: "state.currentTier";
929
- };
930
- readonly finalPricePerUnit: {
931
- readonly var: {
932
- readonly cat: readonly ["state.priceTiers.", {
933
- readonly var: "state.currentTier";
934
- }, ".pricePerUnit"];
935
- };
936
- };
937
- }];
938
- };
939
- readonly dependencies: readonly [];
940
- }, {
941
- readonly from: "PROCESSING";
942
- readonly to: "FULFILLED";
943
- readonly eventName: "fulfill";
944
- readonly guard: {
945
- readonly or: readonly [{
946
- readonly "===": readonly [{
947
- readonly var: "event.agent";
948
- }, {
949
- readonly var: "state.vendor";
950
- }];
951
- }, {
952
- readonly "===": readonly [{
953
- readonly var: "event.agent";
954
- }, {
955
- readonly var: "state.organizer";
956
- }];
957
- }];
958
- };
959
- readonly effect: {
960
- readonly merge: readonly [{
961
- readonly var: "state";
962
- }, {
963
- readonly status: "FULFILLED";
964
- readonly fulfilledAt: {
965
- readonly var: "$timestamp";
966
- };
967
- readonly trackingInfo: {
968
- readonly var: "event.trackingInfo";
969
- };
970
- }];
971
- };
972
- readonly dependencies: readonly [];
973
- }, {
974
- readonly from: "OPEN";
975
- readonly to: "REFUNDED";
976
- readonly eventName: "finalize";
977
- readonly guard: {
978
- readonly and: readonly [{
979
- readonly "<": readonly [{
980
- readonly var: "state.totalQuantity";
981
- }, {
982
- readonly var: "state.minQuantity";
983
- }];
984
- }, {
985
- readonly ">=": readonly [{
986
- readonly var: "$timestamp";
987
- }, {
988
- readonly var: "state.deadline";
989
- }];
990
- }];
991
- };
992
- readonly effect: {
993
- readonly merge: readonly [{
994
- readonly var: "state";
995
- }, {
996
- readonly status: "REFUNDED";
997
- readonly refundedAt: {
998
- readonly var: "$timestamp";
999
- };
1000
- readonly reason: "threshold_not_met";
1001
- }];
1002
- };
1003
- readonly dependencies: readonly [];
1004
- }, {
1005
- readonly from: "REFUNDED";
1006
- readonly to: "REFUNDED";
1007
- readonly eventName: "claim_refund";
1008
- readonly guard: {
1009
- readonly and: readonly [{
1010
- readonly ">": readonly [{
1011
- readonly size: {
1012
- readonly filter: readonly [{
1013
- readonly var: "state.orders";
1014
- }, {
1015
- readonly "===": readonly [{
1016
- readonly var: "buyer";
1017
- }, {
1018
- readonly var: "event.agent";
1019
- }];
1020
- }];
1021
- };
1022
- }, 0];
1023
- }, {
1024
- readonly "!": readonly [{
1025
- readonly in: readonly [{
1026
- readonly var: "event.agent";
1027
- }, {
1028
- readonly var: "state.refundsClaimed";
1029
- }];
1030
- }];
1031
- }];
1032
- };
1033
- readonly effect: {
1034
- readonly merge: readonly [{
1035
- readonly var: "state";
1036
- }, {
1037
- readonly refundsClaimed: {
1038
- readonly cat: readonly [{
1039
- readonly var: "state.refundsClaimed";
1040
- }, readonly [{
1041
- readonly var: "event.agent";
1042
- }]];
1043
- };
1044
- }];
1045
- };
1046
- readonly dependencies: readonly [];
1047
- }];
1048
- };
1049
- export declare const marketPredictionDef: {
1050
- readonly metadata: {
1051
- readonly name: "MarketPrediction";
1052
- readonly description: "Binary or multi-outcome prediction market with oracle resolution and position staking";
1053
- readonly version: "1.0.0";
1054
- readonly crossReferences: {
1055
- readonly oracleId: "Links to IdentityOracle that resolves the outcome";
1056
- readonly creatorIdentityId: "Links to creator's IdentityAgent";
1057
- };
1058
- };
1059
- readonly states: {
1060
- readonly PROPOSED: {
1061
- readonly id: "PROPOSED";
1062
- readonly isFinal: false;
1063
- readonly metadata: {
1064
- readonly description: "Market created but not yet open for trading";
1065
- };
1066
- };
1067
- readonly OPEN: {
1068
- readonly id: "OPEN";
1069
- readonly isFinal: false;
1070
- readonly metadata: {
1071
- readonly description: "Accepting positions on outcomes";
1072
- };
1073
- };
1074
- readonly CLOSED: {
1075
- readonly id: "CLOSED";
1076
- readonly isFinal: false;
1077
- readonly metadata: {
1078
- readonly description: "No more positions, awaiting resolution";
1079
- };
1080
- };
1081
- readonly RESOLVING: {
1082
- readonly id: "RESOLVING";
1083
- readonly isFinal: false;
1084
- readonly metadata: {
1085
- readonly description: "Oracle(s) submitting resolution";
1086
- };
1087
- };
1088
- readonly DISPUTED: {
1089
- readonly id: "DISPUTED";
1090
- readonly isFinal: false;
1091
- readonly metadata: {
1092
- readonly description: "Resolution challenged, awaiting arbitration";
1093
- };
1094
- };
1095
- readonly SETTLED: {
1096
- readonly id: "SETTLED";
1097
- readonly isFinal: true;
1098
- readonly metadata: {
1099
- readonly description: "Outcome finalized, payouts available";
1100
- };
1101
- };
1102
- readonly REFUNDED: {
1103
- readonly id: "REFUNDED";
1104
- readonly isFinal: true;
1105
- readonly metadata: {
1106
- readonly description: "Market invalidated, all positions refunded";
1107
- };
1108
- };
1109
- readonly CANCELLED: {
1110
- readonly id: "CANCELLED";
1111
- readonly isFinal: true;
1112
- readonly metadata: {
1113
- readonly description: "Market cancelled before opening";
1114
- };
1115
- };
1116
- };
1117
- readonly initialState: "PROPOSED";
1118
- readonly transitions: readonly [{
1119
- readonly from: "PROPOSED";
1120
- readonly to: "OPEN";
1121
- readonly eventName: "open";
1122
- readonly guard: {
1123
- readonly "===": readonly [{
1124
- readonly var: "event.agent";
1125
- }, {
1126
- readonly var: "state.creator";
1127
- }];
1128
- };
1129
- readonly effect: {
1130
- readonly merge: readonly [{
1131
- readonly var: "state";
1132
- }, {
1133
- readonly status: "OPEN";
1134
- readonly openedAt: {
1135
- readonly var: "$timestamp";
1136
- };
1137
- readonly positions: {};
1138
- readonly totalPool: 0;
1139
- }];
1140
- };
1141
- readonly dependencies: readonly [];
1142
- }, {
1143
- readonly from: "PROPOSED";
1144
- readonly to: "CANCELLED";
1145
- readonly eventName: "cancel";
1146
- readonly guard: {
1147
- readonly "===": readonly [{
1148
- readonly var: "event.agent";
1149
- }, {
1150
- readonly var: "state.creator";
1151
- }];
1152
- };
1153
- readonly effect: {
1154
- readonly merge: readonly [{
1155
- readonly var: "state";
1156
- }, {
1157
- readonly status: "CANCELLED";
1158
- readonly cancelledAt: {
1159
- readonly var: "$timestamp";
1160
- };
1161
- readonly reason: {
1162
- readonly var: "event.reason";
1163
- };
1164
- }];
1165
- };
1166
- readonly dependencies: readonly [];
1167
- }, {
1168
- readonly from: "OPEN";
1169
- readonly to: "OPEN";
1170
- readonly eventName: "take_position";
1171
- readonly guard: {
1172
- readonly and: readonly [{
1173
- readonly ">": readonly [{
1174
- readonly var: "event.amount";
1175
- }, 0];
1176
- }, {
1177
- readonly in: readonly [{
1178
- readonly var: "event.outcome";
1179
- }, {
1180
- readonly var: "state.outcomes";
1181
- }];
1182
- }, {
1183
- readonly or: readonly [{
1184
- readonly "!": readonly [{
1185
- readonly var: "state.deadline";
1186
- }];
1187
- }, {
1188
- readonly "<=": readonly [{
1189
- readonly var: "$timestamp";
1190
- }, {
1191
- readonly var: "state.deadline";
1192
- }];
1193
- }];
1194
- }];
1195
- };
1196
- readonly effect: {
1197
- readonly merge: readonly [{
1198
- readonly var: "state";
1199
- }, {
1200
- readonly positions: {
1201
- readonly merge: readonly [{
1202
- readonly var: "state.positions";
1203
- }, {
1204
- readonly __computed: {
1205
- readonly cat: readonly [{
1206
- readonly var: "event.agent";
1207
- }, "_", {
1208
- readonly var: "event.outcome";
1209
- }];
1210
- };
1211
- }];
1212
- };
1213
- readonly totalPool: {
1214
- readonly "+": readonly [{
1215
- readonly var: "state.totalPool";
1216
- }, {
1217
- readonly var: "event.amount";
1218
- }];
1219
- };
1220
- }];
1221
- };
1222
- readonly dependencies: readonly [];
1223
- }, {
1224
- readonly from: "OPEN";
1225
- readonly to: "CLOSED";
1226
- readonly eventName: "close";
1227
- readonly guard: {
1228
- readonly or: readonly [{
1229
- readonly "===": readonly [{
1230
- readonly var: "event.agent";
1231
- }, {
1232
- readonly var: "state.creator";
1233
- }];
1234
- }, {
1235
- readonly and: readonly [{
1236
- readonly var: "state.deadline";
1237
- }, {
1238
- readonly ">=": readonly [{
1239
- readonly var: "$timestamp";
1240
- }, {
1241
- readonly var: "state.deadline";
1242
- }];
1243
- }];
1244
- }];
1245
- };
1246
- readonly effect: {
1247
- readonly merge: readonly [{
1248
- readonly var: "state";
1249
- }, {
1250
- readonly status: "CLOSED";
1251
- readonly closedAt: {
1252
- readonly var: "$timestamp";
1253
- };
1254
- }];
1255
- };
1256
- readonly dependencies: readonly [];
1257
- }, {
1258
- readonly from: "CLOSED";
1259
- readonly to: "RESOLVING";
1260
- readonly eventName: "submit_resolution";
1261
- readonly guard: {
1262
- readonly in: readonly [{
1263
- readonly var: "event.agent";
1264
- }, {
1265
- readonly var: "state.oracles";
1266
- }];
1267
- };
1268
- readonly effect: {
1269
- readonly merge: readonly [{
1270
- readonly var: "state";
1271
- }, {
1272
- readonly status: "RESOLVING";
1273
- readonly resolutions: readonly [{
1274
- readonly oracle: {
1275
- readonly var: "event.agent";
1276
- };
1277
- readonly outcome: {
1278
- readonly var: "event.outcome";
1279
- };
1280
- readonly proof: {
1281
- readonly var: "event.proof";
1282
- };
1283
- readonly submittedAt: {
1284
- readonly var: "$timestamp";
1285
- };
1286
- }];
1287
- }];
1288
- };
1289
- readonly dependencies: readonly [];
1290
- }, {
1291
- readonly from: "RESOLVING";
1292
- readonly to: "RESOLVING";
1293
- readonly eventName: "submit_resolution";
1294
- readonly guard: {
1295
- readonly and: readonly [{
1296
- readonly in: readonly [{
1297
- readonly var: "event.agent";
1298
- }, {
1299
- readonly var: "state.oracles";
1300
- }];
1301
- }, {
1302
- readonly "!": readonly [{
1303
- readonly in: readonly [{
1304
- readonly var: "event.agent";
1305
- }, {
1306
- readonly map: readonly [{
1307
- readonly var: "state.resolutions";
1308
- }, {
1309
- readonly var: "oracle";
1310
- }];
1311
- }];
1312
- }];
1313
- }];
1314
- };
1315
- readonly effect: {
1316
- readonly merge: readonly [{
1317
- readonly var: "state";
1318
- }, {
1319
- readonly resolutions: {
1320
- readonly cat: readonly [{
1321
- readonly var: "state.resolutions";
1322
- }, readonly [{
1323
- readonly oracle: {
1324
- readonly var: "event.agent";
1325
- };
1326
- readonly outcome: {
1327
- readonly var: "event.outcome";
1328
- };
1329
- readonly proof: {
1330
- readonly var: "event.proof";
1331
- };
1332
- readonly submittedAt: {
1333
- readonly var: "$timestamp";
1334
- };
1335
- }]];
1336
- };
1337
- }];
1338
- };
1339
- readonly dependencies: readonly [];
1340
- }, {
1341
- readonly from: "RESOLVING";
1342
- readonly to: "SETTLED";
1343
- readonly eventName: "finalize";
1344
- readonly guard: {
1345
- readonly ">=": readonly [{
1346
- readonly size: {
1347
- readonly var: "state.resolutions";
1348
- };
1349
- }, {
1350
- readonly var: "state.quorum";
1351
- }];
1352
- };
1353
- readonly effect: {
1354
- readonly merge: readonly [{
1355
- readonly var: "state";
1356
- }, {
1357
- readonly status: "SETTLED";
1358
- readonly settledAt: {
1359
- readonly var: "$timestamp";
1360
- };
1361
- readonly finalOutcome: {
1362
- readonly var: "event.outcome";
1363
- };
1364
- readonly claims: readonly [];
1365
- }];
1366
- };
1367
- readonly dependencies: readonly [];
1368
- }, {
1369
- readonly from: "RESOLVING";
1370
- readonly to: "DISPUTED";
1371
- readonly eventName: "dispute";
1372
- readonly guard: {
1373
- readonly and: readonly [{
1374
- readonly ">": readonly [{
1375
- readonly size: {
1376
- readonly filter: readonly [{
1377
- readonly var: "state.positions";
1378
- }, {
1379
- readonly "===": readonly [{
1380
- readonly var: "agent";
1381
- }, {
1382
- readonly var: "event.agent";
1383
- }];
1384
- }];
1385
- };
1386
- }, 0];
1387
- }, {
1388
- readonly var: "event.stake";
1389
- }];
1390
- };
1391
- readonly effect: {
1392
- readonly merge: readonly [{
1393
- readonly var: "state";
1394
- }, {
1395
- readonly status: "DISPUTED";
1396
- readonly disputedAt: {
1397
- readonly var: "$timestamp";
1398
- };
1399
- readonly disputedBy: {
1400
- readonly var: "event.agent";
1401
- };
1402
- readonly disputeStake: {
1403
- readonly var: "event.stake";
1404
- };
1405
- readonly disputeReason: {
1406
- readonly var: "event.reason";
1407
- };
1408
- }];
1409
- };
1410
- readonly dependencies: readonly [];
1411
- }, {
1412
- readonly from: "DISPUTED";
1413
- readonly to: "SETTLED";
1414
- readonly eventName: "ruling";
1415
- readonly guard: {
1416
- readonly var: "event.judicialRuling";
1417
- };
1418
- readonly effect: {
1419
- readonly merge: readonly [{
1420
- readonly var: "state";
1421
- }, {
1422
- readonly status: "SETTLED";
1423
- readonly settledAt: {
1424
- readonly var: "$timestamp";
1425
- };
1426
- readonly finalOutcome: {
1427
- readonly var: "event.outcome";
1428
- };
1429
- readonly rulingId: {
1430
- readonly var: "event.rulingId";
1431
- };
1432
- readonly claims: readonly [];
1433
- }];
1434
- };
1435
- readonly dependencies: readonly [];
1436
- }, {
1437
- readonly from: "RESOLVING";
1438
- readonly to: "REFUNDED";
1439
- readonly eventName: "invalidate";
1440
- readonly guard: {
1441
- readonly ">=": readonly [{
1442
- readonly size: {
1443
- readonly filter: readonly [{
1444
- readonly var: "state.resolutions";
1445
- }, {
1446
- readonly "===": readonly [{
1447
- readonly var: "outcome";
1448
- }, "INVALID"];
1449
- }];
1450
- };
1451
- }, {
1452
- readonly var: "state.quorum";
1453
- }];
1454
- };
1455
- readonly effect: {
1456
- readonly merge: readonly [{
1457
- readonly var: "state";
1458
- }, {
1459
- readonly status: "REFUNDED";
1460
- readonly refundedAt: {
1461
- readonly var: "$timestamp";
1462
- };
1463
- readonly reason: "oracle_invalidation";
1464
- }];
1465
- };
1466
- readonly dependencies: readonly [];
1467
- }, {
1468
- readonly from: "SETTLED";
1469
- readonly to: "SETTLED";
1470
- readonly eventName: "claim";
1471
- readonly guard: {
1472
- readonly and: readonly [{
1473
- readonly ">": readonly [{
1474
- readonly size: {
1475
- readonly filter: readonly [{
1476
- readonly var: "state.positions";
1477
- }, {
1478
- readonly and: readonly [{
1479
- readonly "===": readonly [{
1480
- readonly var: "agent";
1481
- }, {
1482
- readonly var: "event.agent";
1483
- }];
1484
- }, {
1485
- readonly "===": readonly [{
1486
- readonly var: "outcome";
1487
- }, {
1488
- readonly var: "state.finalOutcome";
1489
- }];
1490
- }];
1491
- }];
1492
- };
1493
- }, 0];
1494
- }, {
1495
- readonly "!": readonly [{
1496
- readonly in: readonly [{
1497
- readonly var: "event.agent";
1498
- }, {
1499
- readonly map: readonly [{
1500
- readonly var: "state.claims";
1501
- }, {
1502
- readonly var: "agent";
1503
- }];
1504
- }];
1505
- }];
1506
- }];
1507
- };
1508
- readonly effect: {
1509
- readonly merge: readonly [{
1510
- readonly var: "state";
1511
- }, {
1512
- readonly claims: {
1513
- readonly cat: readonly [{
1514
- readonly var: "state.claims";
1515
- }, readonly [{
1516
- readonly agent: {
1517
- readonly var: "event.agent";
1518
- };
1519
- readonly amount: {
1520
- readonly var: "event.amount";
1521
- };
1522
- readonly claimedAt: {
1523
- readonly var: "$timestamp";
1524
- };
1525
- }]];
1526
- };
1527
- }];
1528
- };
1529
- readonly dependencies: readonly [];
1530
- }];
1531
- };
1532
- export declare const marketUniversalDef: {
1533
- readonly metadata: {
1534
- readonly name: "MarketUniversal";
1535
- readonly description: "Minimal market state machine - extend for custom use cases";
1536
- readonly version: "1.0.0";
1537
- };
1538
- readonly states: {
1539
- readonly PROPOSED: {
1540
- readonly id: "PROPOSED";
1541
- readonly isFinal: false;
1542
- readonly metadata: null;
1543
- };
1544
- readonly OPEN: {
1545
- readonly id: "OPEN";
1546
- readonly isFinal: false;
1547
- readonly metadata: null;
1548
- };
1549
- readonly CLOSED: {
1550
- readonly id: "CLOSED";
1551
- readonly isFinal: false;
1552
- readonly metadata: null;
1553
- };
1554
- readonly SETTLED: {
1555
- readonly id: "SETTLED";
1556
- readonly isFinal: true;
1557
- readonly metadata: null;
1558
- };
1559
- readonly CANCELLED: {
1560
- readonly id: "CANCELLED";
1561
- readonly isFinal: true;
1562
- readonly metadata: null;
1563
- };
1564
- };
1565
- readonly initialState: "PROPOSED";
1566
- readonly transitions: readonly [{
1567
- readonly from: "PROPOSED";
1568
- readonly to: "OPEN";
1569
- readonly eventName: "open";
1570
- readonly guard: {
1571
- readonly "==": readonly [1, 1];
1572
- };
1573
- readonly effect: {
1574
- readonly merge: readonly [{
1575
- readonly var: "state";
1576
- }, {
1577
- readonly status: "OPEN";
1578
- readonly openedAt: {
1579
- readonly var: "$timestamp";
1580
- };
1581
- }];
1582
- };
1583
- readonly dependencies: readonly [];
1584
- }, {
1585
- readonly from: "PROPOSED";
1586
- readonly to: "CANCELLED";
1587
- readonly eventName: "cancel";
1588
- readonly guard: {
1589
- readonly "==": readonly [1, 1];
1590
- };
1591
- readonly effect: {
1592
- readonly merge: readonly [{
1593
- readonly var: "state";
1594
- }, {
1595
- readonly status: "CANCELLED";
1596
- readonly cancelledAt: {
1597
- readonly var: "$timestamp";
1598
- };
1599
- }];
1600
- };
1601
- readonly dependencies: readonly [];
1602
- }, {
1603
- readonly from: "OPEN";
1604
- readonly to: "OPEN";
1605
- readonly eventName: "commit";
1606
- readonly guard: {
1607
- readonly ">": readonly [{
1608
- readonly var: "event.amount";
1609
- }, 0];
1610
- };
1611
- readonly effect: {
1612
- readonly merge: readonly [{
1613
- readonly var: "state";
1614
- }, {
1615
- readonly totalCommitted: {
1616
- readonly "+": readonly [{
1617
- readonly var: "state.totalCommitted";
1618
- }, {
1619
- readonly var: "event.amount";
1620
- }];
1621
- };
1622
- }];
1623
- };
1624
- readonly dependencies: readonly [];
1625
- }, {
1626
- readonly from: "OPEN";
1627
- readonly to: "CLOSED";
1628
- readonly eventName: "close";
1629
- readonly guard: {
1630
- readonly "==": readonly [1, 1];
1631
- };
1632
- readonly effect: {
1633
- readonly merge: readonly [{
1634
- readonly var: "state";
1635
- }, {
1636
- readonly status: "CLOSED";
1637
- readonly closedAt: {
1638
- readonly var: "$timestamp";
1639
- };
1640
- }];
1641
- };
1642
- readonly dependencies: readonly [];
1643
- }, {
1644
- readonly from: "CLOSED";
1645
- readonly to: "SETTLED";
1646
- readonly eventName: "settle";
1647
- readonly guard: {
1648
- readonly "==": readonly [1, 1];
1649
- };
1650
- readonly effect: {
1651
- readonly merge: readonly [{
1652
- readonly var: "state";
1653
- }, {
1654
- readonly status: "SETTLED";
1655
- readonly settledAt: {
1656
- readonly var: "$timestamp";
1657
- };
1658
- }];
1659
- };
1660
- readonly dependencies: readonly [];
1661
- }, {
1662
- readonly from: "CLOSED";
1663
- readonly to: "CANCELLED";
1664
- readonly eventName: "cancel";
1665
- readonly guard: {
1666
- readonly "==": readonly [1, 1];
1667
- };
1668
- readonly effect: {
1669
- readonly merge: readonly [{
1670
- readonly var: "state";
1671
- }, {
1672
- readonly status: "CANCELLED";
1673
- readonly cancelledAt: {
1674
- readonly var: "$timestamp";
1675
- };
1676
- }];
1677
- };
1678
- readonly dependencies: readonly [];
1679
- }];
1680
- };
6
+ export { marketUniversalDef } from "./market-universal.js";
7
+ export { marketPredictionDef } from "./market-prediction.js";
8
+ export { marketAuctionDef } from "./market-auction.js";
9
+ export { marketCrowdfundDef } from "./market-crowdfund.js";
10
+ export { marketGroupBuyDef } from "./market-group-buy.js";