@ottochain/sdk 2.2.5 → 2.4.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 (222) hide show
  1. package/dist/cjs/apps/contracts/index.js +15 -8
  2. package/dist/cjs/apps/contracts/state-machines/contract-agreement.js +89 -46
  3. package/dist/cjs/apps/contracts/state-machines/contract-escrow.js +152 -45
  4. package/dist/cjs/apps/contracts/state-machines/contract-universal.js +40 -8
  5. package/dist/cjs/apps/corporate/index.js +2 -2
  6. package/dist/cjs/apps/corporate/state-machines/corp-board.js +169 -59
  7. package/dist/cjs/apps/corporate/state-machines/corp-entity.js +245 -47
  8. package/dist/cjs/apps/corporate/state-machines/corp-securities.js +407 -99
  9. package/dist/cjs/apps/corporate/state-machines/corp-shareholders.js +151 -37
  10. package/dist/cjs/apps/governance/index.js +14 -14
  11. package/dist/cjs/apps/governance/state-machines/dao-multisig.js +85 -43
  12. package/dist/cjs/apps/governance/state-machines/dao-reputation.js +73 -43
  13. package/dist/cjs/apps/governance/state-machines/dao-single.js +55 -14
  14. package/dist/cjs/apps/governance/state-machines/dao-token.js +103 -45
  15. package/dist/cjs/apps/governance/state-machines/governance-simple.js +129 -65
  16. package/dist/cjs/apps/governance/state-machines/governance-universal.js +29 -5
  17. package/dist/cjs/apps/identity/constants.js +55 -14
  18. package/dist/cjs/apps/identity/index.js +27 -11
  19. package/dist/cjs/apps/identity/state-machines/identity-agent.js +57 -9
  20. package/dist/cjs/apps/identity/state-machines/identity-oracle.js +70 -27
  21. package/dist/cjs/apps/identity/state-machines/identity-registry.js +288 -0
  22. package/dist/cjs/apps/identity/state-machines/identity-universal.js +30 -6
  23. package/dist/cjs/apps/identity/state-machines/index.js +3 -1
  24. package/dist/cjs/apps/index.js +19 -8
  25. package/dist/cjs/apps/lending/assets.js +223 -0
  26. package/dist/cjs/apps/lending/credit-scoring.js +87 -0
  27. package/dist/cjs/apps/lending/eligibility.js +121 -0
  28. package/dist/cjs/apps/lending/index.js +91 -0
  29. package/dist/cjs/apps/lending/state-machines/index.js +9 -0
  30. package/dist/cjs/apps/lending/state-machines/lending-zk-loan.js +412 -0
  31. package/dist/cjs/apps/markets/index.js +21 -11
  32. package/dist/cjs/apps/markets/state-machines/market-auction.js +44 -19
  33. package/dist/cjs/apps/markets/state-machines/market-crowdfund.js +54 -29
  34. package/dist/cjs/apps/markets/state-machines/market-group-buy.js +53 -31
  35. package/dist/cjs/apps/markets/state-machines/market-prediction.js +120 -61
  36. package/dist/cjs/apps/markets/state-machines/market-universal.js +50 -10
  37. package/dist/cjs/apps/oracles/index.js +2 -2
  38. package/dist/cjs/errors.js +3 -3
  39. package/dist/cjs/generated/google/protobuf/struct.js +4 -4
  40. package/dist/cjs/generated/index.js +11 -7
  41. package/dist/cjs/generated/openapi.js +6 -0
  42. package/dist/cjs/generated/ottochain/apps/contracts/v1/contract.js +50 -50
  43. package/dist/cjs/generated/ottochain/apps/corporate/v1/corporate.js +19 -20
  44. package/dist/cjs/generated/ottochain/apps/governance/v1/governance.js +13 -13
  45. package/dist/cjs/generated/ottochain/apps/identity/v1/attestation.js +4 -4
  46. package/dist/cjs/generated/ottochain/apps/identity/v1/identity.js +124 -130
  47. package/dist/cjs/generated/ottochain/apps/markets/v1/market.js +107 -107
  48. package/dist/cjs/generated/ottochain/v1/common.js +1722 -1
  49. package/dist/cjs/generated/ottochain/v1/fiber.js +355 -5
  50. package/dist/cjs/generated/ottochain/v1/messages.js +775 -3
  51. package/dist/cjs/generated/ottochain/v1/records.js +350 -3
  52. package/dist/cjs/index.js +45 -7
  53. package/dist/cjs/openapi.js +2 -0
  54. package/dist/cjs/ottochain/drop-nulls.js +1 -2
  55. package/dist/cjs/ottochain/genesis-manifest.js +193 -0
  56. package/dist/cjs/ottochain/index.js +27 -13
  57. package/dist/cjs/ottochain/metagraph-client.js +65 -8
  58. package/dist/cjs/ottochain/snapshot.js +11 -12
  59. package/dist/cjs/ottochain/transaction.js +57 -14
  60. package/dist/cjs/ottochain/types.js +19 -1
  61. package/dist/cjs/privacy/index.js +14 -0
  62. package/dist/cjs/privacy/sealed-bid.js +210 -0
  63. package/dist/cjs/privacy/shield-app.js +131 -0
  64. package/dist/cjs/schema/effects.js +40 -0
  65. package/dist/cjs/schema/fiber-app.js +19 -13
  66. package/dist/cjs/schema/guard-lint.js +352 -0
  67. package/dist/cjs/schema/guards.js +246 -0
  68. package/dist/cjs/signing.js +80 -0
  69. package/dist/cjs/types.js +2 -3
  70. package/dist/cjs/validation.js +8 -8
  71. package/dist/cjs/verify.js +9 -4
  72. package/dist/cjs/zk/commit.js +53 -0
  73. package/dist/cjs/zk/guard.js +107 -0
  74. package/dist/cjs/zk/index.js +48 -0
  75. package/dist/cjs/zk/preimage.js +37 -0
  76. package/dist/cjs/zk/prover.js +87 -0
  77. package/dist/cjs/zk/registry.js +62 -0
  78. package/dist/cjs/zk/types.js +28 -0
  79. package/dist/cjs/zk/witness.js +19 -0
  80. package/dist/esm/apps/contracts/index.js +7 -3
  81. package/dist/esm/apps/contracts/state-machines/contract-agreement.js +89 -46
  82. package/dist/esm/apps/contracts/state-machines/contract-escrow.js +152 -45
  83. package/dist/esm/apps/contracts/state-machines/contract-universal.js +40 -8
  84. package/dist/esm/apps/corporate/state-machines/corp-board.js +169 -59
  85. package/dist/esm/apps/corporate/state-machines/corp-entity.js +245 -47
  86. package/dist/esm/apps/corporate/state-machines/corp-securities.js +407 -99
  87. package/dist/esm/apps/corporate/state-machines/corp-shareholders.js +151 -37
  88. package/dist/esm/apps/governance/state-machines/dao-multisig.js +85 -43
  89. package/dist/esm/apps/governance/state-machines/dao-reputation.js +73 -43
  90. package/dist/esm/apps/governance/state-machines/dao-single.js +55 -14
  91. package/dist/esm/apps/governance/state-machines/dao-token.js +103 -45
  92. package/dist/esm/apps/governance/state-machines/governance-simple.js +129 -65
  93. package/dist/esm/apps/governance/state-machines/governance-universal.js +29 -5
  94. package/dist/esm/apps/identity/constants.js +51 -12
  95. package/dist/esm/apps/identity/index.js +12 -7
  96. package/dist/esm/apps/identity/state-machines/identity-agent.js +57 -9
  97. package/dist/esm/apps/identity/state-machines/identity-oracle.js +70 -27
  98. package/dist/esm/apps/identity/state-machines/identity-registry.js +285 -0
  99. package/dist/esm/apps/identity/state-machines/identity-universal.js +30 -6
  100. package/dist/esm/apps/identity/state-machines/index.js +1 -0
  101. package/dist/esm/apps/index.js +1 -0
  102. package/dist/esm/apps/lending/assets.js +207 -0
  103. package/dist/esm/apps/lending/credit-scoring.js +81 -0
  104. package/dist/esm/apps/lending/eligibility.js +115 -0
  105. package/dist/esm/apps/lending/index.js +69 -0
  106. package/dist/esm/apps/lending/state-machines/index.js +5 -0
  107. package/dist/esm/apps/lending/state-machines/lending-zk-loan.js +409 -0
  108. package/dist/esm/apps/markets/index.js +8 -4
  109. package/dist/esm/apps/markets/state-machines/market-auction.js +44 -19
  110. package/dist/esm/apps/markets/state-machines/market-crowdfund.js +54 -29
  111. package/dist/esm/apps/markets/state-machines/market-group-buy.js +53 -31
  112. package/dist/esm/apps/markets/state-machines/market-prediction.js +120 -61
  113. package/dist/esm/apps/markets/state-machines/market-universal.js +50 -10
  114. package/dist/esm/generated/index.js +9 -5
  115. package/dist/esm/generated/openapi.js +5 -0
  116. package/dist/esm/generated/ottochain/apps/contracts/v1/contract.js +46 -46
  117. package/dist/esm/generated/ottochain/apps/identity/v1/identity.js +114 -120
  118. package/dist/esm/generated/ottochain/apps/markets/v1/market.js +100 -100
  119. package/dist/esm/generated/ottochain/v1/common.js +1718 -0
  120. package/dist/esm/generated/ottochain/v1/fiber.js +351 -1
  121. package/dist/esm/generated/ottochain/v1/messages.js +774 -2
  122. package/dist/esm/generated/ottochain/v1/records.js +349 -2
  123. package/dist/esm/index.js +23 -2
  124. package/dist/esm/openapi.js +1 -0
  125. package/dist/esm/ottochain/genesis-manifest.js +189 -0
  126. package/dist/esm/ottochain/index.js +4 -3
  127. package/dist/esm/ottochain/metagraph-client.js +65 -8
  128. package/dist/esm/ottochain/snapshot.js +4 -4
  129. package/dist/esm/ottochain/transaction.js +43 -3
  130. package/dist/esm/ottochain/types.js +18 -0
  131. package/dist/esm/privacy/index.js +6 -0
  132. package/dist/esm/privacy/sealed-bid.js +206 -0
  133. package/dist/esm/privacy/shield-app.js +127 -0
  134. package/dist/esm/schema/effects.js +35 -0
  135. package/dist/esm/schema/fiber-app.js +13 -6
  136. package/dist/esm/schema/guard-lint.js +346 -0
  137. package/dist/esm/schema/guards.js +229 -0
  138. package/dist/esm/signing.js +74 -0
  139. package/dist/esm/verify.js +8 -2
  140. package/dist/esm/zk/commit.js +44 -0
  141. package/dist/esm/zk/guard.js +99 -0
  142. package/dist/esm/zk/index.js +19 -0
  143. package/dist/esm/zk/preimage.js +30 -0
  144. package/dist/esm/zk/prover.js +82 -0
  145. package/dist/esm/zk/registry.js +55 -0
  146. package/dist/esm/zk/types.js +25 -0
  147. package/dist/esm/zk/witness.js +15 -0
  148. package/dist/types/apps/contracts/index.d.ts +159 -227
  149. package/dist/types/apps/contracts/state-machines/contract-agreement.d.ts +50 -101
  150. package/dist/types/apps/contracts/state-machines/contract-escrow.d.ts +86 -120
  151. package/dist/types/apps/contracts/state-machines/contract-universal.d.ts +20 -4
  152. package/dist/types/apps/corporate/index.d.ts +1040 -304
  153. package/dist/types/apps/corporate/state-machines/corp-board.d.ts +188 -52
  154. package/dist/types/apps/corporate/state-machines/corp-entity.d.ts +267 -62
  155. package/dist/types/apps/corporate/state-machines/corp-securities.d.ts +355 -131
  156. package/dist/types/apps/corporate/state-machines/corp-shareholders.d.ts +225 -53
  157. package/dist/types/apps/governance/index.d.ts +396 -417
  158. package/dist/types/apps/governance/state-machines/dao-multisig.d.ts +92 -95
  159. package/dist/types/apps/governance/state-machines/dao-reputation.d.ts +57 -69
  160. package/dist/types/apps/governance/state-machines/dao-single.d.ts +40 -50
  161. package/dist/types/apps/governance/state-machines/dao-token.d.ts +80 -53
  162. package/dist/types/apps/governance/state-machines/governance-simple.d.ts +107 -121
  163. package/dist/types/apps/governance/state-machines/governance-universal.d.ts +17 -5
  164. package/dist/types/apps/identity/constants.d.ts +32 -4
  165. package/dist/types/apps/identity/index.d.ts +449 -100
  166. package/dist/types/apps/identity/state-machines/identity-agent.d.ts +30 -0
  167. package/dist/types/apps/identity/state-machines/identity-oracle.d.ts +41 -87
  168. package/dist/types/apps/identity/state-machines/identity-registry.d.ts +379 -0
  169. package/dist/types/apps/identity/state-machines/identity-universal.d.ts +15 -0
  170. package/dist/types/apps/identity/state-machines/index.d.ts +1 -0
  171. package/dist/types/apps/index.d.ts +1 -0
  172. package/dist/types/apps/lending/assets.d.ts +258 -0
  173. package/dist/types/apps/lending/credit-scoring.d.ts +80 -0
  174. package/dist/types/apps/lending/eligibility.d.ts +83 -0
  175. package/dist/types/apps/lending/index.d.ts +548 -0
  176. package/dist/types/apps/lending/state-machines/index.d.ts +5 -0
  177. package/dist/types/apps/lending/state-machines/lending-zk-loan.d.ts +528 -0
  178. package/dist/types/apps/markets/index.d.ts +184 -204
  179. package/dist/types/apps/markets/state-machines/market-auction.d.ts +25 -37
  180. package/dist/types/apps/markets/state-machines/market-crowdfund.d.ts +26 -34
  181. package/dist/types/apps/markets/state-machines/market-group-buy.d.ts +31 -43
  182. package/dist/types/apps/markets/state-machines/market-prediction.d.ts +67 -72
  183. package/dist/types/apps/markets/state-machines/market-universal.d.ts +30 -10
  184. package/dist/types/generated/index.d.ts +5 -5
  185. package/dist/types/generated/openapi.d.ts +1257 -0
  186. package/dist/types/generated/ottochain/apps/contracts/v1/contract.d.ts +5 -5
  187. package/dist/types/generated/ottochain/apps/identity/v1/identity.d.ts +12 -12
  188. package/dist/types/generated/ottochain/apps/markets/v1/market.d.ts +11 -11
  189. package/dist/types/generated/ottochain/v1/common.d.ts +228 -0
  190. package/dist/types/generated/ottochain/v1/fiber.d.ts +32 -1
  191. package/dist/types/generated/ottochain/v1/messages.d.ts +84 -0
  192. package/dist/types/generated/ottochain/v1/records.d.ts +34 -0
  193. package/dist/types/index.d.ts +8 -2
  194. package/dist/types/openapi.d.ts +22 -0
  195. package/dist/types/ottochain/genesis-manifest.d.ts +130 -0
  196. package/dist/types/ottochain/index.d.ts +6 -5
  197. package/dist/types/ottochain/metagraph-client.d.ts +49 -7
  198. package/dist/types/ottochain/snapshot.d.ts +6 -6
  199. package/dist/types/ottochain/transaction.d.ts +33 -1
  200. package/dist/types/ottochain/types.d.ts +602 -11
  201. package/dist/types/privacy/index.d.ts +6 -0
  202. package/dist/types/privacy/sealed-bid.d.ts +348 -0
  203. package/dist/types/privacy/shield-app.d.ts +48 -0
  204. package/dist/types/schema/effects.d.ts +34 -0
  205. package/dist/types/schema/fiber-app.d.ts +41 -3
  206. package/dist/types/schema/guard-lint.d.ts +111 -0
  207. package/dist/types/schema/guards.d.ts +134 -0
  208. package/dist/types/signing.d.ts +45 -0
  209. package/dist/types/validation.d.ts +22 -217
  210. package/dist/types/verify.d.ts +4 -0
  211. package/dist/types/zk/commit.d.ts +28 -0
  212. package/dist/types/zk/guard.d.ts +46 -0
  213. package/dist/types/zk/index.d.ts +19 -0
  214. package/dist/types/zk/preimage.d.ts +10 -0
  215. package/dist/types/zk/prover.d.ts +34 -0
  216. package/dist/types/zk/registry.d.ts +34 -0
  217. package/dist/types/zk/types.d.ts +33 -0
  218. package/dist/types/zk/witness.d.ts +40 -0
  219. package/package.json +52 -35
  220. package/dist/cjs/ottochain/normalize.js +0 -186
  221. package/dist/esm/ottochain/normalize.js +0 -179
  222. package/dist/types/ottochain/normalize.d.ts +0 -79
@@ -6,8 +6,8 @@
6
6
  * @example
7
7
  * ```typescript
8
8
  * import {
9
- * MarketType,
10
- * MarketState,
9
+ * Type,
10
+ * State,
11
11
  * Market,
12
12
  * getMarketDefinition,
13
13
  * MARKETS_DEFINITIONS
@@ -19,7 +19,8 @@
19
19
  *
20
20
  * @packageDocumentation
21
21
  */
22
- export { MarketType, MarketState, Commitment, Resolution, Market, CreateMarketRequest, CommitToMarketRequest, SubmitResolutionRequest, CancelMarketRequest, MarketDefinition, marketTypeFromJSON, marketTypeToJSON, marketStateFromJSON, marketStateToJSON, } from "../../generated/ottochain/apps/markets/v1/market.js";
22
+ export { Type, State, Commitment, Resolution, Market, CreateMarketRequest, CommitToMarketRequest, SubmitResolutionRequest, CancelMarketRequest, MarketDefinition, typeFromJSON, typeToJSON, stateFromJSON, stateToJSON, } from "../../generated/ottochain/apps/markets/v1/market.js";
23
+ export { Type as MarketType, State as MarketState, typeFromJSON as marketTypeFromJSON, typeToJSON as marketTypeToJSON, stateFromJSON as marketStateFromJSON, stateToJSON as marketStateToJSON, } from "../../generated/ottochain/apps/markets/v1/market.js";
23
24
  import { marketUniversalDef, marketPredictionDef, marketAuctionDef, marketCrowdfundDef, marketGroupBuyDef } from "./state-machines/index.js";
24
25
  import type { FiberAppDefinition } from "../../schema/fiber-app.js";
25
26
  export { marketUniversalDef, marketPredictionDef, marketAuctionDef, marketCrowdfundDef, marketGroupBuyDef, };
@@ -74,27 +75,47 @@ export declare const MARKETS_DEFINITIONS: {
74
75
  readonly PROPOSED: {
75
76
  readonly id: "PROPOSED";
76
77
  readonly isFinal: false;
77
- readonly metadata: null;
78
+ readonly metadata: {
79
+ readonly label: "Proposed";
80
+ readonly description: "Market created but not yet open";
81
+ readonly category: "initial";
82
+ };
78
83
  };
79
84
  readonly OPEN: {
80
85
  readonly id: "OPEN";
81
86
  readonly isFinal: false;
82
- readonly metadata: null;
87
+ readonly metadata: {
88
+ readonly label: "Open";
89
+ readonly description: "Market is open for participation";
90
+ readonly category: "active";
91
+ };
83
92
  };
84
93
  readonly CLOSED: {
85
94
  readonly id: "CLOSED";
86
95
  readonly isFinal: false;
87
- readonly metadata: null;
96
+ readonly metadata: {
97
+ readonly label: "Closed";
98
+ readonly description: "Participation closed; awaiting settlement";
99
+ readonly category: "pending";
100
+ };
88
101
  };
89
102
  readonly SETTLED: {
90
103
  readonly id: "SETTLED";
91
104
  readonly isFinal: true;
92
- readonly metadata: null;
105
+ readonly metadata: {
106
+ readonly label: "Settled";
107
+ readonly description: "Market settled and payouts available (terminal)";
108
+ readonly category: "terminal";
109
+ };
93
110
  };
94
111
  readonly CANCELLED: {
95
112
  readonly id: "CANCELLED";
96
113
  readonly isFinal: true;
97
- readonly metadata: null;
114
+ readonly metadata: {
115
+ readonly label: "Cancelled";
116
+ readonly description: "Market cancelled before settlement (terminal)";
117
+ readonly category: "terminal";
118
+ };
98
119
  };
99
120
  };
100
121
  readonly initialState: "PROPOSED";
@@ -111,7 +132,7 @@ export declare const MARKETS_DEFINITIONS: {
111
132
  }, {
112
133
  readonly status: "OPEN";
113
134
  readonly openedAt: {
114
- readonly var: "$timestamp";
135
+ readonly var: "$ordinal";
115
136
  };
116
137
  }];
117
138
  };
@@ -129,7 +150,7 @@ export declare const MARKETS_DEFINITIONS: {
129
150
  }, {
130
151
  readonly status: "CANCELLED";
131
152
  readonly cancelledAt: {
132
- readonly var: "$timestamp";
153
+ readonly var: "$ordinal";
133
154
  };
134
155
  }];
135
156
  };
@@ -170,7 +191,7 @@ export declare const MARKETS_DEFINITIONS: {
170
191
  }, {
171
192
  readonly status: "CLOSED";
172
193
  readonly closedAt: {
173
- readonly var: "$timestamp";
194
+ readonly var: "$ordinal";
174
195
  };
175
196
  }];
176
197
  };
@@ -188,7 +209,7 @@ export declare const MARKETS_DEFINITIONS: {
188
209
  }, {
189
210
  readonly status: "SETTLED";
190
211
  readonly settledAt: {
191
- readonly var: "$timestamp";
212
+ readonly var: "$ordinal";
192
213
  };
193
214
  }];
194
215
  };
@@ -206,7 +227,7 @@ export declare const MARKETS_DEFINITIONS: {
206
227
  }, {
207
228
  readonly status: "CANCELLED";
208
229
  readonly cancelledAt: {
209
- readonly var: "$timestamp";
230
+ readonly var: "$ordinal";
210
231
  };
211
232
  }];
212
233
  };
@@ -226,13 +247,18 @@ export declare const MARKETS_DEFINITIONS: {
226
247
  };
227
248
  };
228
249
  readonly createSchema: {
229
- readonly required: readonly ["creator", "outcomes", "oracles", "quorum"];
250
+ readonly required: readonly ["creator", "outcomes", "oracles", "quorum", "arbiter"];
230
251
  readonly properties: {
231
252
  readonly creator: {
232
253
  readonly type: "address";
233
254
  readonly description: "DAG address of the market creator";
234
255
  readonly immutable: true;
235
256
  };
257
+ readonly arbiter: {
258
+ readonly type: "address";
259
+ readonly description: "DAG address of the arbiter authorized to rule on a disputed resolution";
260
+ readonly immutable: true;
261
+ };
236
262
  readonly outcomes: {
237
263
  readonly type: "array";
238
264
  readonly description: "Valid outcome identifiers";
@@ -264,6 +290,10 @@ export declare const MARKETS_DEFINITIONS: {
264
290
  readonly type: "address";
265
291
  readonly immutable: true;
266
292
  };
293
+ readonly arbiter: {
294
+ readonly type: "address";
295
+ readonly immutable: true;
296
+ };
267
297
  readonly outcomes: {
268
298
  readonly type: "array";
269
299
  readonly immutable: true;
@@ -343,11 +373,6 @@ export declare const MARKETS_DEFINITIONS: {
343
373
  };
344
374
  readonly finalize: {
345
375
  readonly description: "Finalize market after quorum reached";
346
- readonly properties: {
347
- readonly outcome: {
348
- readonly type: "string";
349
- };
350
- };
351
376
  };
352
377
  readonly dispute: {
353
378
  readonly description: "Dispute the resolution";
@@ -365,10 +390,7 @@ export declare const MARKETS_DEFINITIONS: {
365
390
  readonly ruling: {
366
391
  readonly description: "Judicial ruling on dispute";
367
392
  readonly properties: {
368
- readonly judicialRuling: {
369
- readonly type: "boolean";
370
- };
371
- readonly outcome: {
393
+ readonly finalOutcome: {
372
394
  readonly type: "string";
373
395
  };
374
396
  readonly rulingId: {
@@ -393,56 +415,72 @@ export declare const MARKETS_DEFINITIONS: {
393
415
  readonly id: "PROPOSED";
394
416
  readonly isFinal: false;
395
417
  readonly metadata: {
418
+ readonly label: "Proposed";
396
419
  readonly description: "Market created but not yet open for trading";
420
+ readonly category: "initial";
397
421
  };
398
422
  };
399
423
  readonly OPEN: {
400
424
  readonly id: "OPEN";
401
425
  readonly isFinal: false;
402
426
  readonly metadata: {
427
+ readonly label: "Open";
403
428
  readonly description: "Accepting positions on outcomes";
429
+ readonly category: "active";
404
430
  };
405
431
  };
406
432
  readonly CLOSED: {
407
433
  readonly id: "CLOSED";
408
434
  readonly isFinal: false;
409
435
  readonly metadata: {
436
+ readonly label: "Closed";
410
437
  readonly description: "No more positions, awaiting resolution";
438
+ readonly category: "pending";
411
439
  };
412
440
  };
413
441
  readonly RESOLVING: {
414
442
  readonly id: "RESOLVING";
415
443
  readonly isFinal: false;
416
444
  readonly metadata: {
445
+ readonly label: "Resolving";
417
446
  readonly description: "Oracle(s) submitting resolution";
447
+ readonly category: "pending";
418
448
  };
419
449
  };
420
450
  readonly DISPUTED: {
421
451
  readonly id: "DISPUTED";
422
452
  readonly isFinal: false;
423
453
  readonly metadata: {
454
+ readonly label: "Disputed";
424
455
  readonly description: "Resolution challenged, awaiting arbitration";
456
+ readonly category: "pending";
425
457
  };
426
458
  };
427
459
  readonly SETTLED: {
428
460
  readonly id: "SETTLED";
429
461
  readonly isFinal: true;
430
462
  readonly metadata: {
463
+ readonly label: "Settled";
431
464
  readonly description: "Outcome finalized, payouts available";
465
+ readonly category: "terminal";
432
466
  };
433
467
  };
434
468
  readonly REFUNDED: {
435
469
  readonly id: "REFUNDED";
436
470
  readonly isFinal: true;
437
471
  readonly metadata: {
472
+ readonly label: "Refunded";
438
473
  readonly description: "Market invalidated, all positions refunded";
474
+ readonly category: "terminal";
439
475
  };
440
476
  };
441
477
  readonly CANCELLED: {
442
478
  readonly id: "CANCELLED";
443
479
  readonly isFinal: true;
444
480
  readonly metadata: {
481
+ readonly label: "Cancelled";
445
482
  readonly description: "Market cancelled before opening";
483
+ readonly category: "terminal";
446
484
  };
447
485
  };
448
486
  };
@@ -451,20 +489,14 @@ export declare const MARKETS_DEFINITIONS: {
451
489
  readonly from: "PROPOSED";
452
490
  readonly to: "OPEN";
453
491
  readonly eventName: "open";
454
- readonly guard: {
455
- readonly "===": readonly [{
456
- readonly var: "event.agent";
457
- }, {
458
- readonly var: "state.creator";
459
- }];
460
- };
492
+ readonly guard: import("../../index.js").GuardRule;
461
493
  readonly effect: {
462
494
  readonly merge: readonly [{
463
495
  readonly var: "state";
464
496
  }, {
465
497
  readonly status: "OPEN";
466
498
  readonly openedAt: {
467
- readonly var: "$timestamp";
499
+ readonly var: "$ordinal";
468
500
  };
469
501
  readonly positions: {};
470
502
  readonly totalPool: 0;
@@ -475,20 +507,14 @@ export declare const MARKETS_DEFINITIONS: {
475
507
  readonly from: "PROPOSED";
476
508
  readonly to: "CANCELLED";
477
509
  readonly eventName: "cancel";
478
- readonly guard: {
479
- readonly "===": readonly [{
480
- readonly var: "event.agent";
481
- }, {
482
- readonly var: "state.creator";
483
- }];
484
- };
510
+ readonly guard: import("../../index.js").GuardRule;
485
511
  readonly effect: {
486
512
  readonly merge: readonly [{
487
513
  readonly var: "state";
488
514
  }, {
489
515
  readonly status: "CANCELLED";
490
516
  readonly cancelledAt: {
491
- readonly var: "$timestamp";
517
+ readonly var: "$ordinal";
492
518
  };
493
519
  readonly reason: {
494
520
  readonly var: "event.reason";
@@ -518,7 +544,7 @@ export declare const MARKETS_DEFINITIONS: {
518
544
  }];
519
545
  }, {
520
546
  readonly "<=": readonly [{
521
- readonly var: "$timestamp";
547
+ readonly var: "$ordinal";
522
548
  }, {
523
549
  readonly var: "state.deadline";
524
550
  }];
@@ -557,18 +583,12 @@ export declare const MARKETS_DEFINITIONS: {
557
583
  readonly to: "CLOSED";
558
584
  readonly eventName: "close";
559
585
  readonly guard: {
560
- readonly or: readonly [{
561
- readonly "===": readonly [{
562
- readonly var: "event.agent";
563
- }, {
564
- readonly var: "state.creator";
565
- }];
566
- }, {
586
+ readonly or: readonly [import("../../index.js").GuardRule, {
567
587
  readonly and: readonly [{
568
588
  readonly var: "state.deadline";
569
589
  }, {
570
590
  readonly ">=": readonly [{
571
- readonly var: "$timestamp";
591
+ readonly var: "$ordinal";
572
592
  }, {
573
593
  readonly var: "state.deadline";
574
594
  }];
@@ -581,7 +601,7 @@ export declare const MARKETS_DEFINITIONS: {
581
601
  }, {
582
602
  readonly status: "CLOSED";
583
603
  readonly closedAt: {
584
- readonly var: "$timestamp";
604
+ readonly var: "$ordinal";
585
605
  };
586
606
  }];
587
607
  };
@@ -590,13 +610,7 @@ export declare const MARKETS_DEFINITIONS: {
590
610
  readonly from: "CLOSED";
591
611
  readonly to: "RESOLVING";
592
612
  readonly eventName: "submit_resolution";
593
- readonly guard: {
594
- readonly in: readonly [{
595
- readonly var: "event.agent";
596
- }, {
597
- readonly var: "state.oracles";
598
- }];
599
- };
613
+ readonly guard: import("../../index.js").GuardRule;
600
614
  readonly effect: {
601
615
  readonly merge: readonly [{
602
616
  readonly var: "state";
@@ -613,7 +627,7 @@ export declare const MARKETS_DEFINITIONS: {
613
627
  readonly var: "event.proof";
614
628
  };
615
629
  readonly submittedAt: {
616
- readonly var: "$timestamp";
630
+ readonly var: "$ordinal";
617
631
  };
618
632
  }];
619
633
  }];
@@ -624,13 +638,7 @@ export declare const MARKETS_DEFINITIONS: {
624
638
  readonly to: "RESOLVING";
625
639
  readonly eventName: "submit_resolution";
626
640
  readonly guard: {
627
- readonly and: readonly [{
628
- readonly in: readonly [{
629
- readonly var: "event.agent";
630
- }, {
631
- readonly var: "state.oracles";
632
- }];
633
- }, {
641
+ readonly and: readonly [import("../../index.js").GuardRule, {
634
642
  readonly "!": readonly [{
635
643
  readonly in: readonly [{
636
644
  readonly var: "event.agent";
@@ -662,7 +670,7 @@ export declare const MARKETS_DEFINITIONS: {
662
670
  readonly var: "event.proof";
663
671
  };
664
672
  readonly submittedAt: {
665
- readonly var: "$timestamp";
673
+ readonly var: "$ordinal";
666
674
  };
667
675
  }]];
668
676
  };
@@ -674,12 +682,14 @@ export declare const MARKETS_DEFINITIONS: {
674
682
  readonly to: "SETTLED";
675
683
  readonly eventName: "finalize";
676
684
  readonly guard: {
677
- readonly ">=": readonly [{
678
- readonly size: {
679
- readonly var: "state.resolutions";
680
- };
681
- }, {
682
- readonly var: "state.quorum";
685
+ readonly and: readonly [import("../../index.js").GuardRule, {
686
+ readonly ">=": readonly [{
687
+ readonly count: {
688
+ readonly var: "state.resolutions";
689
+ };
690
+ }, {
691
+ readonly var: "state.quorum";
692
+ }];
683
693
  }];
684
694
  };
685
695
  readonly effect: {
@@ -688,10 +698,10 @@ export declare const MARKETS_DEFINITIONS: {
688
698
  }, {
689
699
  readonly status: "SETTLED";
690
700
  readonly settledAt: {
691
- readonly var: "$timestamp";
701
+ readonly var: "$ordinal";
692
702
  };
693
703
  readonly finalOutcome: {
694
- readonly var: "event.outcome";
704
+ readonly var: "state.resolutions.0.outcome";
695
705
  };
696
706
  readonly claims: readonly [];
697
707
  }];
@@ -704,7 +714,7 @@ export declare const MARKETS_DEFINITIONS: {
704
714
  readonly guard: {
705
715
  readonly and: readonly [{
706
716
  readonly ">": readonly [{
707
- readonly size: {
717
+ readonly length: readonly [{
708
718
  readonly filter: readonly [{
709
719
  readonly var: "state.positions";
710
720
  }, {
@@ -714,7 +724,7 @@ export declare const MARKETS_DEFINITIONS: {
714
724
  readonly var: "event.agent";
715
725
  }];
716
726
  }];
717
- };
727
+ }];
718
728
  }, 0];
719
729
  }, {
720
730
  readonly var: "event.stake";
@@ -726,7 +736,7 @@ export declare const MARKETS_DEFINITIONS: {
726
736
  }, {
727
737
  readonly status: "DISPUTED";
728
738
  readonly disputedAt: {
729
- readonly var: "$timestamp";
739
+ readonly var: "$ordinal";
730
740
  };
731
741
  readonly disputedBy: {
732
742
  readonly var: "event.agent";
@@ -745,7 +755,13 @@ export declare const MARKETS_DEFINITIONS: {
745
755
  readonly to: "SETTLED";
746
756
  readonly eventName: "ruling";
747
757
  readonly guard: {
748
- readonly var: "event.judicialRuling";
758
+ readonly and: readonly [import("../../index.js").GuardRule, {
759
+ readonly in: readonly [{
760
+ readonly var: "event.finalOutcome";
761
+ }, {
762
+ readonly var: "state.outcomes";
763
+ }];
764
+ }];
749
765
  };
750
766
  readonly effect: {
751
767
  readonly merge: readonly [{
@@ -753,10 +769,10 @@ export declare const MARKETS_DEFINITIONS: {
753
769
  }, {
754
770
  readonly status: "SETTLED";
755
771
  readonly settledAt: {
756
- readonly var: "$timestamp";
772
+ readonly var: "$ordinal";
757
773
  };
758
774
  readonly finalOutcome: {
759
- readonly var: "event.outcome";
775
+ readonly var: "event.finalOutcome";
760
776
  };
761
777
  readonly rulingId: {
762
778
  readonly var: "event.rulingId";
@@ -771,7 +787,7 @@ export declare const MARKETS_DEFINITIONS: {
771
787
  readonly eventName: "invalidate";
772
788
  readonly guard: {
773
789
  readonly ">=": readonly [{
774
- readonly size: {
790
+ readonly length: readonly [{
775
791
  readonly filter: readonly [{
776
792
  readonly var: "state.resolutions";
777
793
  }, {
@@ -779,7 +795,7 @@ export declare const MARKETS_DEFINITIONS: {
779
795
  readonly var: "outcome";
780
796
  }, "INVALID"];
781
797
  }];
782
- };
798
+ }];
783
799
  }, {
784
800
  readonly var: "state.quorum";
785
801
  }];
@@ -790,7 +806,7 @@ export declare const MARKETS_DEFINITIONS: {
790
806
  }, {
791
807
  readonly status: "REFUNDED";
792
808
  readonly refundedAt: {
793
- readonly var: "$timestamp";
809
+ readonly var: "$ordinal";
794
810
  };
795
811
  readonly reason: "oracle_invalidation";
796
812
  }];
@@ -803,7 +819,7 @@ export declare const MARKETS_DEFINITIONS: {
803
819
  readonly guard: {
804
820
  readonly and: readonly [{
805
821
  readonly ">": readonly [{
806
- readonly size: {
822
+ readonly length: readonly [{
807
823
  readonly filter: readonly [{
808
824
  readonly var: "state.positions";
809
825
  }, {
@@ -821,7 +837,7 @@ export declare const MARKETS_DEFINITIONS: {
821
837
  }];
822
838
  }];
823
839
  }];
824
- };
840
+ }];
825
841
  }, 0];
826
842
  }, {
827
843
  readonly "!": readonly [{
@@ -852,7 +868,7 @@ export declare const MARKETS_DEFINITIONS: {
852
868
  readonly var: "event.amount";
853
869
  };
854
870
  readonly claimedAt: {
855
- readonly var: "$timestamp";
871
+ readonly var: "$ordinal";
856
872
  };
857
873
  }]];
858
874
  };
@@ -944,10 +960,6 @@ export declare const MARKETS_DEFINITIONS: {
944
960
  readonly open: {
945
961
  readonly description: "Open the auction";
946
962
  };
947
- /**
948
- * Get a market state machine definition by type.
949
- * @param type - 'universal' | 'prediction' | 'auction' | 'crowdfund' | 'groupBuy' (default: 'universal')
950
- */
951
963
  readonly cancel: {
952
964
  readonly description: "Cancel the auction";
953
965
  };
@@ -976,42 +988,54 @@ export declare const MARKETS_DEFINITIONS: {
976
988
  readonly id: "PROPOSED";
977
989
  readonly isFinal: false;
978
990
  readonly metadata: {
991
+ readonly label: "Proposed";
979
992
  readonly description: "Auction created but not yet open";
993
+ readonly category: "initial";
980
994
  };
981
995
  };
982
996
  readonly OPEN: {
983
997
  readonly id: "OPEN";
984
998
  readonly isFinal: false;
985
999
  readonly metadata: {
1000
+ readonly label: "Open";
986
1001
  readonly description: "Accepting bids";
1002
+ readonly category: "active";
987
1003
  };
988
1004
  };
989
1005
  readonly CLOSING: {
990
1006
  readonly id: "CLOSING";
991
1007
  readonly isFinal: false;
992
1008
  readonly metadata: {
1009
+ readonly label: "Closing";
993
1010
  readonly description: "Bid period ended, determining winner";
1011
+ readonly category: "pending";
994
1012
  };
995
1013
  };
996
1014
  readonly SETTLED: {
997
1015
  readonly id: "SETTLED";
998
1016
  readonly isFinal: true;
999
1017
  readonly metadata: {
1018
+ readonly label: "Settled";
1000
1019
  readonly description: "Winner determined, transfer complete";
1020
+ readonly category: "terminal";
1001
1021
  };
1002
1022
  };
1003
1023
  readonly NO_SALE: {
1004
1024
  readonly id: "NO_SALE";
1005
1025
  readonly isFinal: true;
1006
1026
  readonly metadata: {
1027
+ readonly label: "No sale";
1007
1028
  readonly description: "Reserve not met or no valid bids";
1029
+ readonly category: "terminal";
1008
1030
  };
1009
1031
  };
1010
1032
  readonly CANCELLED: {
1011
1033
  readonly id: "CANCELLED";
1012
1034
  readonly isFinal: true;
1013
1035
  readonly metadata: {
1036
+ readonly label: "Cancelled";
1014
1037
  readonly description: "Auction cancelled by seller";
1038
+ readonly category: "terminal";
1015
1039
  };
1016
1040
  };
1017
1041
  };
@@ -1020,20 +1044,14 @@ export declare const MARKETS_DEFINITIONS: {
1020
1044
  readonly from: "PROPOSED";
1021
1045
  readonly to: "OPEN";
1022
1046
  readonly eventName: "open";
1023
- readonly guard: {
1024
- readonly "===": readonly [{
1025
- readonly var: "event.agent";
1026
- }, {
1027
- readonly var: "state.seller";
1028
- }];
1029
- };
1047
+ readonly guard: import("../../index.js").GuardRule;
1030
1048
  readonly effect: {
1031
1049
  readonly merge: readonly [{
1032
1050
  readonly var: "state";
1033
1051
  }, {
1034
1052
  readonly status: "OPEN";
1035
1053
  readonly openedAt: {
1036
- readonly var: "$timestamp";
1054
+ readonly var: "$ordinal";
1037
1055
  };
1038
1056
  readonly bids: readonly [];
1039
1057
  readonly highBid: null;
@@ -1045,20 +1063,14 @@ export declare const MARKETS_DEFINITIONS: {
1045
1063
  readonly from: "PROPOSED";
1046
1064
  readonly to: "CANCELLED";
1047
1065
  readonly eventName: "cancel";
1048
- readonly guard: {
1049
- readonly "===": readonly [{
1050
- readonly var: "event.agent";
1051
- }, {
1052
- readonly var: "state.seller";
1053
- }];
1054
- };
1066
+ readonly guard: import("../../index.js").GuardRule;
1055
1067
  readonly effect: {
1056
1068
  readonly merge: readonly [{
1057
1069
  readonly var: "state";
1058
1070
  }, {
1059
1071
  readonly status: "CANCELLED";
1060
1072
  readonly cancelledAt: {
1061
- readonly var: "$timestamp";
1073
+ readonly var: "$ordinal";
1062
1074
  };
1063
1075
  }];
1064
1076
  };
@@ -1068,13 +1080,7 @@ export declare const MARKETS_DEFINITIONS: {
1068
1080
  readonly to: "OPEN";
1069
1081
  readonly eventName: "bid";
1070
1082
  readonly guard: {
1071
- readonly and: readonly [{
1072
- readonly "!==": readonly [{
1073
- readonly var: "event.agent";
1074
- }, {
1075
- readonly var: "state.seller";
1076
- }];
1077
- }, {
1083
+ readonly and: readonly [import("../../index.js").GuardRule, {
1078
1084
  readonly ">=": readonly [{
1079
1085
  readonly var: "event.amount";
1080
1086
  }, {
@@ -1103,7 +1109,7 @@ export declare const MARKETS_DEFINITIONS: {
1103
1109
  }];
1104
1110
  }, {
1105
1111
  readonly "<=": readonly [{
1106
- readonly var: "$timestamp";
1112
+ readonly var: "$ordinal";
1107
1113
  }, {
1108
1114
  readonly var: "state.deadline";
1109
1115
  }];
@@ -1125,7 +1131,7 @@ export declare const MARKETS_DEFINITIONS: {
1125
1131
  readonly var: "event.amount";
1126
1132
  };
1127
1133
  readonly bidAt: {
1128
- readonly var: "$timestamp";
1134
+ readonly var: "$ordinal";
1129
1135
  };
1130
1136
  }]];
1131
1137
  };
@@ -1136,7 +1142,7 @@ export declare const MARKETS_DEFINITIONS: {
1136
1142
  readonly var: "event.agent";
1137
1143
  };
1138
1144
  readonly lastBidAt: {
1139
- readonly var: "$timestamp";
1145
+ readonly var: "$ordinal";
1140
1146
  };
1141
1147
  }];
1142
1148
  };
@@ -1146,18 +1152,12 @@ export declare const MARKETS_DEFINITIONS: {
1146
1152
  readonly to: "CLOSING";
1147
1153
  readonly eventName: "close";
1148
1154
  readonly guard: {
1149
- readonly or: readonly [{
1150
- readonly "===": readonly [{
1151
- readonly var: "event.agent";
1152
- }, {
1153
- readonly var: "state.seller";
1154
- }];
1155
- }, {
1155
+ readonly or: readonly [import("../../index.js").GuardRule, {
1156
1156
  readonly and: readonly [{
1157
1157
  readonly var: "state.deadline";
1158
1158
  }, {
1159
1159
  readonly ">=": readonly [{
1160
- readonly var: "$timestamp";
1160
+ readonly var: "$ordinal";
1161
1161
  }, {
1162
1162
  readonly var: "state.deadline";
1163
1163
  }];
@@ -1170,7 +1170,7 @@ export declare const MARKETS_DEFINITIONS: {
1170
1170
  }, {
1171
1171
  readonly status: "CLOSING";
1172
1172
  readonly closedAt: {
1173
- readonly var: "$timestamp";
1173
+ readonly var: "$ordinal";
1174
1174
  };
1175
1175
  }];
1176
1176
  };
@@ -1202,7 +1202,7 @@ export declare const MARKETS_DEFINITIONS: {
1202
1202
  }, {
1203
1203
  readonly status: "SETTLED";
1204
1204
  readonly settledAt: {
1205
- readonly var: "$timestamp";
1205
+ readonly var: "$ordinal";
1206
1206
  };
1207
1207
  readonly winner: {
1208
1208
  readonly var: "state.highBidder";
@@ -1240,7 +1240,7 @@ export declare const MARKETS_DEFINITIONS: {
1240
1240
  }, {
1241
1241
  readonly status: "NO_SALE";
1242
1242
  readonly closedAt: {
1243
- readonly var: "$timestamp";
1243
+ readonly var: "$ordinal";
1244
1244
  };
1245
1245
  readonly reason: {
1246
1246
  readonly if: readonly [{
@@ -1380,35 +1380,45 @@ export declare const MARKETS_DEFINITIONS: {
1380
1380
  readonly id: "PROPOSED";
1381
1381
  readonly isFinal: false;
1382
1382
  readonly metadata: {
1383
+ readonly label: "Proposed";
1383
1384
  readonly description: "Campaign created but not yet open";
1385
+ readonly category: "initial";
1384
1386
  };
1385
1387
  };
1386
1388
  readonly OPEN: {
1387
1389
  readonly id: "OPEN";
1388
1390
  readonly isFinal: false;
1389
1391
  readonly metadata: {
1392
+ readonly label: "Open";
1390
1393
  readonly description: "Accepting pledges";
1394
+ readonly category: "active";
1391
1395
  };
1392
1396
  };
1393
1397
  readonly FUNDED: {
1394
1398
  readonly id: "FUNDED";
1395
1399
  readonly isFinal: true;
1396
1400
  readonly metadata: {
1401
+ readonly label: "Funded";
1397
1402
  readonly description: "Threshold met, funds released to creator";
1403
+ readonly category: "terminal";
1398
1404
  };
1399
1405
  };
1400
1406
  readonly REFUNDED: {
1401
1407
  readonly id: "REFUNDED";
1402
1408
  readonly isFinal: true;
1403
1409
  readonly metadata: {
1410
+ readonly label: "Refunded";
1404
1411
  readonly description: "Threshold not met, all pledges refunded";
1412
+ readonly category: "terminal";
1405
1413
  };
1406
1414
  };
1407
1415
  readonly CANCELLED: {
1408
1416
  readonly id: "CANCELLED";
1409
1417
  readonly isFinal: true;
1410
1418
  readonly metadata: {
1419
+ readonly label: "Cancelled";
1411
1420
  readonly description: "Campaign cancelled by creator";
1421
+ readonly category: "terminal";
1412
1422
  };
1413
1423
  };
1414
1424
  };
@@ -1417,20 +1427,14 @@ export declare const MARKETS_DEFINITIONS: {
1417
1427
  readonly from: "PROPOSED";
1418
1428
  readonly to: "OPEN";
1419
1429
  readonly eventName: "launch";
1420
- readonly guard: {
1421
- readonly "===": readonly [{
1422
- readonly var: "event.agent";
1423
- }, {
1424
- readonly var: "state.creator";
1425
- }];
1426
- };
1430
+ readonly guard: import("../../index.js").GuardRule;
1427
1431
  readonly effect: {
1428
1432
  readonly merge: readonly [{
1429
1433
  readonly var: "state";
1430
1434
  }, {
1431
1435
  readonly status: "OPEN";
1432
1436
  readonly launchedAt: {
1433
- readonly var: "$timestamp";
1437
+ readonly var: "$ordinal";
1434
1438
  };
1435
1439
  readonly pledges: readonly [];
1436
1440
  readonly totalPledged: 0;
@@ -1442,20 +1446,14 @@ export declare const MARKETS_DEFINITIONS: {
1442
1446
  readonly from: "PROPOSED";
1443
1447
  readonly to: "CANCELLED";
1444
1448
  readonly eventName: "cancel";
1445
- readonly guard: {
1446
- readonly "===": readonly [{
1447
- readonly var: "event.agent";
1448
- }, {
1449
- readonly var: "state.creator";
1450
- }];
1451
- };
1449
+ readonly guard: import("../../index.js").GuardRule;
1452
1450
  readonly effect: {
1453
1451
  readonly merge: readonly [{
1454
1452
  readonly var: "state";
1455
1453
  }, {
1456
1454
  readonly status: "CANCELLED";
1457
1455
  readonly cancelledAt: {
1458
- readonly var: "$timestamp";
1456
+ readonly var: "$ordinal";
1459
1457
  };
1460
1458
  }];
1461
1459
  };
@@ -1469,13 +1467,7 @@ export declare const MARKETS_DEFINITIONS: {
1469
1467
  readonly ">": readonly [{
1470
1468
  readonly var: "event.amount";
1471
1469
  }, 0];
1472
- }, {
1473
- readonly "!==": readonly [{
1474
- readonly var: "event.agent";
1475
- }, {
1476
- readonly var: "state.creator";
1477
- }];
1478
- }, {
1470
+ }, import("../../index.js").GuardRule, {
1479
1471
  readonly or: readonly [{
1480
1472
  readonly "!": readonly [{
1481
1473
  readonly var: "state.minPledge";
@@ -1489,7 +1481,7 @@ export declare const MARKETS_DEFINITIONS: {
1489
1481
  }];
1490
1482
  }, {
1491
1483
  readonly "<=": readonly [{
1492
- readonly var: "$timestamp";
1484
+ readonly var: "$ordinal";
1493
1485
  }, {
1494
1486
  readonly var: "state.deadline";
1495
1487
  }];
@@ -1513,7 +1505,7 @@ export declare const MARKETS_DEFINITIONS: {
1513
1505
  readonly var: "event.rewardTier";
1514
1506
  };
1515
1507
  readonly pledgedAt: {
1516
- readonly var: "$timestamp";
1508
+ readonly var: "$ordinal";
1517
1509
  };
1518
1510
  }]];
1519
1511
  };
@@ -1543,13 +1535,13 @@ export declare const MARKETS_DEFINITIONS: {
1543
1535
  }, 0];
1544
1536
  }, {
1545
1537
  readonly "<=": readonly [{
1546
- readonly var: "$timestamp";
1538
+ readonly var: "$ordinal";
1547
1539
  }, {
1548
1540
  readonly var: "state.deadline";
1549
1541
  }];
1550
1542
  }, {
1551
1543
  readonly ">": readonly [{
1552
- readonly size: {
1544
+ readonly length: readonly [{
1553
1545
  readonly filter: readonly [{
1554
1546
  readonly var: "state.pledges";
1555
1547
  }, {
@@ -1559,7 +1551,7 @@ export declare const MARKETS_DEFINITIONS: {
1559
1551
  readonly var: "event.agent";
1560
1552
  }];
1561
1553
  }];
1562
- };
1554
+ }];
1563
1555
  }, 0];
1564
1556
  }];
1565
1557
  };
@@ -1590,7 +1582,7 @@ export declare const MARKETS_DEFINITIONS: {
1590
1582
  }];
1591
1583
  }, {
1592
1584
  readonly ">=": readonly [{
1593
- readonly var: "$timestamp";
1585
+ readonly var: "$ordinal";
1594
1586
  }, {
1595
1587
  readonly var: "state.deadline";
1596
1588
  }];
@@ -1602,7 +1594,7 @@ export declare const MARKETS_DEFINITIONS: {
1602
1594
  }, {
1603
1595
  readonly status: "FUNDED";
1604
1596
  readonly fundedAt: {
1605
- readonly var: "$timestamp";
1597
+ readonly var: "$ordinal";
1606
1598
  };
1607
1599
  readonly stretchGoalsReached: {
1608
1600
  readonly filter: readonly [{
@@ -1631,7 +1623,7 @@ export declare const MARKETS_DEFINITIONS: {
1631
1623
  }];
1632
1624
  }, {
1633
1625
  readonly ">=": readonly [{
1634
- readonly var: "$timestamp";
1626
+ readonly var: "$ordinal";
1635
1627
  }, {
1636
1628
  readonly var: "state.deadline";
1637
1629
  }];
@@ -1643,7 +1635,7 @@ export declare const MARKETS_DEFINITIONS: {
1643
1635
  }, {
1644
1636
  readonly status: "REFUNDED";
1645
1637
  readonly refundedAt: {
1646
- readonly var: "$timestamp";
1638
+ readonly var: "$ordinal";
1647
1639
  };
1648
1640
  readonly reason: "threshold_not_met";
1649
1641
  }];
@@ -1656,7 +1648,7 @@ export declare const MARKETS_DEFINITIONS: {
1656
1648
  readonly guard: {
1657
1649
  readonly and: readonly [{
1658
1650
  readonly ">": readonly [{
1659
- readonly size: {
1651
+ readonly length: readonly [{
1660
1652
  readonly filter: readonly [{
1661
1653
  readonly var: "state.pledges";
1662
1654
  }, {
@@ -1666,7 +1658,7 @@ export declare const MARKETS_DEFINITIONS: {
1666
1658
  readonly var: "event.agent";
1667
1659
  }];
1668
1660
  }];
1669
- };
1661
+ }];
1670
1662
  }, 0];
1671
1663
  }, {
1672
1664
  readonly "!": readonly [{
@@ -1743,7 +1735,7 @@ export declare const MARKETS_DEFINITIONS: {
1743
1735
  readonly stateSchema: {
1744
1736
  readonly properties: {
1745
1737
  readonly status: {
1746
- readonly type: "string"; /** All market state machine definitions */
1738
+ readonly type: "string";
1747
1739
  readonly computed: true;
1748
1740
  };
1749
1741
  readonly organizer: {
@@ -1823,49 +1815,63 @@ export declare const MARKETS_DEFINITIONS: {
1823
1815
  readonly id: "PROPOSED";
1824
1816
  readonly isFinal: false;
1825
1817
  readonly metadata: {
1818
+ readonly label: "Proposed";
1826
1819
  readonly description: "Group buy created but not yet open";
1820
+ readonly category: "initial";
1827
1821
  };
1828
1822
  };
1829
1823
  readonly OPEN: {
1830
1824
  readonly id: "OPEN";
1831
1825
  readonly isFinal: false;
1832
1826
  readonly metadata: {
1827
+ readonly label: "Open";
1833
1828
  readonly description: "Accepting orders";
1829
+ readonly category: "active";
1834
1830
  };
1835
1831
  };
1836
1832
  readonly THRESHOLD_MET: {
1837
1833
  readonly id: "THRESHOLD_MET";
1838
1834
  readonly isFinal: false;
1839
1835
  readonly metadata: {
1836
+ readonly label: "Threshold met";
1840
1837
  readonly description: "Minimum quantity reached, continuing for better tier";
1838
+ readonly category: "active";
1841
1839
  };
1842
1840
  };
1843
1841
  readonly PROCESSING: {
1844
1842
  readonly id: "PROCESSING";
1845
1843
  readonly isFinal: false;
1846
1844
  readonly metadata: {
1845
+ readonly label: "Processing";
1847
1846
  readonly description: "Order placed with vendor, awaiting fulfillment";
1847
+ readonly category: "pending";
1848
1848
  };
1849
1849
  };
1850
1850
  readonly FULFILLED: {
1851
1851
  readonly id: "FULFILLED";
1852
1852
  readonly isFinal: true;
1853
1853
  readonly metadata: {
1854
+ readonly label: "Fulfilled";
1854
1855
  readonly description: "All items delivered to buyers";
1856
+ readonly category: "terminal";
1855
1857
  };
1856
1858
  };
1857
1859
  readonly REFUNDED: {
1858
1860
  readonly id: "REFUNDED";
1859
1861
  readonly isFinal: true;
1860
1862
  readonly metadata: {
1863
+ readonly label: "Refunded";
1861
1864
  readonly description: "Threshold not met, all orders refunded";
1865
+ readonly category: "terminal";
1862
1866
  };
1863
1867
  };
1864
1868
  readonly CANCELLED: {
1865
1869
  readonly id: "CANCELLED";
1866
1870
  readonly isFinal: true;
1867
1871
  readonly metadata: {
1872
+ readonly label: "Cancelled";
1868
1873
  readonly description: "Group buy cancelled";
1874
+ readonly category: "terminal";
1869
1875
  };
1870
1876
  };
1871
1877
  };
@@ -1874,20 +1880,14 @@ export declare const MARKETS_DEFINITIONS: {
1874
1880
  readonly from: "PROPOSED";
1875
1881
  readonly to: "OPEN";
1876
1882
  readonly eventName: "open";
1877
- readonly guard: {
1878
- readonly "===": readonly [{
1879
- readonly var: "event.agent";
1880
- }, {
1881
- readonly var: "state.organizer";
1882
- }];
1883
- };
1883
+ readonly guard: import("../../index.js").GuardRule;
1884
1884
  readonly effect: {
1885
1885
  readonly merge: readonly [{
1886
1886
  readonly var: "state";
1887
1887
  }, {
1888
1888
  readonly status: "OPEN";
1889
1889
  readonly openedAt: {
1890
- readonly var: "$timestamp";
1890
+ readonly var: "$ordinal";
1891
1891
  };
1892
1892
  readonly orders: readonly [];
1893
1893
  readonly totalQuantity: 0;
@@ -1899,20 +1899,14 @@ export declare const MARKETS_DEFINITIONS: {
1899
1899
  readonly from: "PROPOSED";
1900
1900
  readonly to: "CANCELLED";
1901
1901
  readonly eventName: "cancel";
1902
- readonly guard: {
1903
- readonly "===": readonly [{
1904
- readonly var: "event.agent";
1905
- }, {
1906
- readonly var: "state.organizer";
1907
- }];
1908
- };
1902
+ readonly guard: import("../../index.js").GuardRule;
1909
1903
  readonly effect: {
1910
1904
  readonly merge: readonly [{
1911
1905
  readonly var: "state";
1912
1906
  }, {
1913
1907
  readonly status: "CANCELLED";
1914
1908
  readonly cancelledAt: {
1915
- readonly var: "$timestamp";
1909
+ readonly var: "$ordinal";
1916
1910
  };
1917
1911
  }];
1918
1912
  };
@@ -1940,7 +1934,7 @@ export declare const MARKETS_DEFINITIONS: {
1940
1934
  }];
1941
1935
  }, {
1942
1936
  readonly "<=": readonly [{
1943
- readonly var: "$timestamp";
1937
+ readonly var: "$ordinal";
1944
1938
  }, {
1945
1939
  readonly var: "state.deadline";
1946
1940
  }];
@@ -1964,7 +1958,7 @@ export declare const MARKETS_DEFINITIONS: {
1964
1958
  readonly var: "event.shippingInfo";
1965
1959
  };
1966
1960
  readonly orderedAt: {
1967
- readonly var: "$timestamp";
1961
+ readonly var: "$ordinal";
1968
1962
  };
1969
1963
  }]];
1970
1964
  };
@@ -1995,7 +1989,7 @@ export declare const MARKETS_DEFINITIONS: {
1995
1989
  }, {
1996
1990
  readonly status: "THRESHOLD_MET";
1997
1991
  readonly thresholdMetAt: {
1998
- readonly var: "$timestamp";
1992
+ readonly var: "$ordinal";
1999
1993
  };
2000
1994
  readonly currentTier: {
2001
1995
  readonly reduce: readonly [{
@@ -2028,7 +2022,7 @@ export declare const MARKETS_DEFINITIONS: {
2028
2022
  }, 0];
2029
2023
  }, {
2030
2024
  readonly "<=": readonly [{
2031
- readonly var: "$timestamp";
2025
+ readonly var: "$ordinal";
2032
2026
  }, {
2033
2027
  readonly var: "state.deadline";
2034
2028
  }];
@@ -2052,7 +2046,7 @@ export declare const MARKETS_DEFINITIONS: {
2052
2046
  readonly var: "event.shippingInfo";
2053
2047
  };
2054
2048
  readonly orderedAt: {
2055
- readonly var: "$timestamp";
2049
+ readonly var: "$ordinal";
2056
2050
  };
2057
2051
  }]];
2058
2052
  };
@@ -2095,7 +2089,7 @@ export declare const MARKETS_DEFINITIONS: {
2095
2089
  readonly eventName: "finalize";
2096
2090
  readonly guard: {
2097
2091
  readonly ">=": readonly [{
2098
- readonly var: "$timestamp";
2092
+ readonly var: "$ordinal";
2099
2093
  }, {
2100
2094
  readonly var: "state.deadline";
2101
2095
  }];
@@ -2106,7 +2100,7 @@ export declare const MARKETS_DEFINITIONS: {
2106
2100
  }, {
2107
2101
  readonly status: "PROCESSING";
2108
2102
  readonly finalizedAt: {
2109
- readonly var: "$timestamp";
2103
+ readonly var: "$ordinal";
2110
2104
  };
2111
2105
  readonly finalTier: {
2112
2106
  readonly var: "state.currentTier";
@@ -2125,28 +2119,14 @@ export declare const MARKETS_DEFINITIONS: {
2125
2119
  readonly from: "PROCESSING";
2126
2120
  readonly to: "FULFILLED";
2127
2121
  readonly eventName: "fulfill";
2128
- readonly guard: {
2129
- readonly or: readonly [{
2130
- readonly "===": readonly [{
2131
- readonly var: "event.agent";
2132
- }, {
2133
- readonly var: "state.vendor";
2134
- }];
2135
- }, {
2136
- readonly "===": readonly [{
2137
- readonly var: "event.agent";
2138
- }, {
2139
- readonly var: "state.organizer";
2140
- }];
2141
- }];
2142
- };
2122
+ readonly guard: import("../../index.js").GuardRule;
2143
2123
  readonly effect: {
2144
2124
  readonly merge: readonly [{
2145
2125
  readonly var: "state";
2146
2126
  }, {
2147
2127
  readonly status: "FULFILLED";
2148
2128
  readonly fulfilledAt: {
2149
- readonly var: "$timestamp";
2129
+ readonly var: "$ordinal";
2150
2130
  };
2151
2131
  readonly trackingInfo: {
2152
2132
  readonly var: "event.trackingInfo";
@@ -2167,7 +2147,7 @@ export declare const MARKETS_DEFINITIONS: {
2167
2147
  }];
2168
2148
  }, {
2169
2149
  readonly ">=": readonly [{
2170
- readonly var: "$timestamp";
2150
+ readonly var: "$ordinal";
2171
2151
  }, {
2172
2152
  readonly var: "state.deadline";
2173
2153
  }];
@@ -2179,7 +2159,7 @@ export declare const MARKETS_DEFINITIONS: {
2179
2159
  }, {
2180
2160
  readonly status: "REFUNDED";
2181
2161
  readonly refundedAt: {
2182
- readonly var: "$timestamp";
2162
+ readonly var: "$ordinal";
2183
2163
  };
2184
2164
  readonly reason: "threshold_not_met";
2185
2165
  }];
@@ -2192,7 +2172,7 @@ export declare const MARKETS_DEFINITIONS: {
2192
2172
  readonly guard: {
2193
2173
  readonly and: readonly [{
2194
2174
  readonly ">": readonly [{
2195
- readonly size: {
2175
+ readonly length: readonly [{
2196
2176
  readonly filter: readonly [{
2197
2177
  readonly var: "state.orders";
2198
2178
  }, {
@@ -2202,7 +2182,7 @@ export declare const MARKETS_DEFINITIONS: {
2202
2182
  readonly var: "event.agent";
2203
2183
  }];
2204
2184
  }];
2205
- };
2185
+ }];
2206
2186
  }, 0];
2207
2187
  }, {
2208
2188
  readonly "!": readonly [{