@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
@@ -14,13 +14,18 @@ export declare const marketPredictionDef: {
14
14
  };
15
15
  };
16
16
  readonly createSchema: {
17
- readonly required: readonly ["creator", "outcomes", "oracles", "quorum"];
17
+ readonly required: readonly ["creator", "outcomes", "oracles", "quorum", "arbiter"];
18
18
  readonly properties: {
19
19
  readonly creator: {
20
20
  readonly type: "address";
21
21
  readonly description: "DAG address of the market creator";
22
22
  readonly immutable: true;
23
23
  };
24
+ readonly arbiter: {
25
+ readonly type: "address";
26
+ readonly description: "DAG address of the arbiter authorized to rule on a disputed resolution";
27
+ readonly immutable: true;
28
+ };
24
29
  readonly outcomes: {
25
30
  readonly type: "array";
26
31
  readonly description: "Valid outcome identifiers";
@@ -52,6 +57,10 @@ export declare const marketPredictionDef: {
52
57
  readonly type: "address";
53
58
  readonly immutable: true;
54
59
  };
60
+ readonly arbiter: {
61
+ readonly type: "address";
62
+ readonly immutable: true;
63
+ };
55
64
  readonly outcomes: {
56
65
  readonly type: "array";
57
66
  readonly immutable: true;
@@ -131,11 +140,6 @@ export declare const marketPredictionDef: {
131
140
  };
132
141
  readonly finalize: {
133
142
  readonly description: "Finalize market after quorum reached";
134
- readonly properties: {
135
- readonly outcome: {
136
- readonly type: "string";
137
- };
138
- };
139
143
  };
140
144
  readonly dispute: {
141
145
  readonly description: "Dispute the resolution";
@@ -153,10 +157,7 @@ export declare const marketPredictionDef: {
153
157
  readonly ruling: {
154
158
  readonly description: "Judicial ruling on dispute";
155
159
  readonly properties: {
156
- readonly judicialRuling: {
157
- readonly type: "boolean";
158
- };
159
- readonly outcome: {
160
+ readonly finalOutcome: {
160
161
  readonly type: "string";
161
162
  };
162
163
  readonly rulingId: {
@@ -181,56 +182,72 @@ export declare const marketPredictionDef: {
181
182
  readonly id: "PROPOSED";
182
183
  readonly isFinal: false;
183
184
  readonly metadata: {
185
+ readonly label: "Proposed";
184
186
  readonly description: "Market created but not yet open for trading";
187
+ readonly category: "initial";
185
188
  };
186
189
  };
187
190
  readonly OPEN: {
188
191
  readonly id: "OPEN";
189
192
  readonly isFinal: false;
190
193
  readonly metadata: {
194
+ readonly label: "Open";
191
195
  readonly description: "Accepting positions on outcomes";
196
+ readonly category: "active";
192
197
  };
193
198
  };
194
199
  readonly CLOSED: {
195
200
  readonly id: "CLOSED";
196
201
  readonly isFinal: false;
197
202
  readonly metadata: {
203
+ readonly label: "Closed";
198
204
  readonly description: "No more positions, awaiting resolution";
205
+ readonly category: "pending";
199
206
  };
200
207
  };
201
208
  readonly RESOLVING: {
202
209
  readonly id: "RESOLVING";
203
210
  readonly isFinal: false;
204
211
  readonly metadata: {
212
+ readonly label: "Resolving";
205
213
  readonly description: "Oracle(s) submitting resolution";
214
+ readonly category: "pending";
206
215
  };
207
216
  };
208
217
  readonly DISPUTED: {
209
218
  readonly id: "DISPUTED";
210
219
  readonly isFinal: false;
211
220
  readonly metadata: {
221
+ readonly label: "Disputed";
212
222
  readonly description: "Resolution challenged, awaiting arbitration";
223
+ readonly category: "pending";
213
224
  };
214
225
  };
215
226
  readonly SETTLED: {
216
227
  readonly id: "SETTLED";
217
228
  readonly isFinal: true;
218
229
  readonly metadata: {
230
+ readonly label: "Settled";
219
231
  readonly description: "Outcome finalized, payouts available";
232
+ readonly category: "terminal";
220
233
  };
221
234
  };
222
235
  readonly REFUNDED: {
223
236
  readonly id: "REFUNDED";
224
237
  readonly isFinal: true;
225
238
  readonly metadata: {
239
+ readonly label: "Refunded";
226
240
  readonly description: "Market invalidated, all positions refunded";
241
+ readonly category: "terminal";
227
242
  };
228
243
  };
229
244
  readonly CANCELLED: {
230
245
  readonly id: "CANCELLED";
231
246
  readonly isFinal: true;
232
247
  readonly metadata: {
248
+ readonly label: "Cancelled";
233
249
  readonly description: "Market cancelled before opening";
250
+ readonly category: "terminal";
234
251
  };
235
252
  };
236
253
  };
@@ -239,20 +256,14 @@ export declare const marketPredictionDef: {
239
256
  readonly from: "PROPOSED";
240
257
  readonly to: "OPEN";
241
258
  readonly eventName: "open";
242
- readonly guard: {
243
- readonly "===": readonly [{
244
- readonly var: "event.agent";
245
- }, {
246
- readonly var: "state.creator";
247
- }];
248
- };
259
+ readonly guard: import("../../../schema/guards.js").GuardRule;
249
260
  readonly effect: {
250
261
  readonly merge: readonly [{
251
262
  readonly var: "state";
252
263
  }, {
253
264
  readonly status: "OPEN";
254
265
  readonly openedAt: {
255
- readonly var: "$timestamp";
266
+ readonly var: "$ordinal";
256
267
  };
257
268
  readonly positions: {};
258
269
  readonly totalPool: 0;
@@ -263,20 +274,14 @@ export declare const marketPredictionDef: {
263
274
  readonly from: "PROPOSED";
264
275
  readonly to: "CANCELLED";
265
276
  readonly eventName: "cancel";
266
- readonly guard: {
267
- readonly "===": readonly [{
268
- readonly var: "event.agent";
269
- }, {
270
- readonly var: "state.creator";
271
- }];
272
- };
277
+ readonly guard: import("../../../schema/guards.js").GuardRule;
273
278
  readonly effect: {
274
279
  readonly merge: readonly [{
275
280
  readonly var: "state";
276
281
  }, {
277
282
  readonly status: "CANCELLED";
278
283
  readonly cancelledAt: {
279
- readonly var: "$timestamp";
284
+ readonly var: "$ordinal";
280
285
  };
281
286
  readonly reason: {
282
287
  readonly var: "event.reason";
@@ -306,7 +311,7 @@ export declare const marketPredictionDef: {
306
311
  }];
307
312
  }, {
308
313
  readonly "<=": readonly [{
309
- readonly var: "$timestamp";
314
+ readonly var: "$ordinal";
310
315
  }, {
311
316
  readonly var: "state.deadline";
312
317
  }];
@@ -345,18 +350,12 @@ export declare const marketPredictionDef: {
345
350
  readonly to: "CLOSED";
346
351
  readonly eventName: "close";
347
352
  readonly guard: {
348
- readonly or: readonly [{
349
- readonly "===": readonly [{
350
- readonly var: "event.agent";
351
- }, {
352
- readonly var: "state.creator";
353
- }];
354
- }, {
353
+ readonly or: readonly [import("../../../schema/guards.js").GuardRule, {
355
354
  readonly and: readonly [{
356
355
  readonly var: "state.deadline";
357
356
  }, {
358
357
  readonly ">=": readonly [{
359
- readonly var: "$timestamp";
358
+ readonly var: "$ordinal";
360
359
  }, {
361
360
  readonly var: "state.deadline";
362
361
  }];
@@ -369,7 +368,7 @@ export declare const marketPredictionDef: {
369
368
  }, {
370
369
  readonly status: "CLOSED";
371
370
  readonly closedAt: {
372
- readonly var: "$timestamp";
371
+ readonly var: "$ordinal";
373
372
  };
374
373
  }];
375
374
  };
@@ -378,13 +377,7 @@ export declare const marketPredictionDef: {
378
377
  readonly from: "CLOSED";
379
378
  readonly to: "RESOLVING";
380
379
  readonly eventName: "submit_resolution";
381
- readonly guard: {
382
- readonly in: readonly [{
383
- readonly var: "event.agent";
384
- }, {
385
- readonly var: "state.oracles";
386
- }];
387
- };
380
+ readonly guard: import("../../../schema/guards.js").GuardRule;
388
381
  readonly effect: {
389
382
  readonly merge: readonly [{
390
383
  readonly var: "state";
@@ -401,7 +394,7 @@ export declare const marketPredictionDef: {
401
394
  readonly var: "event.proof";
402
395
  };
403
396
  readonly submittedAt: {
404
- readonly var: "$timestamp";
397
+ readonly var: "$ordinal";
405
398
  };
406
399
  }];
407
400
  }];
@@ -412,13 +405,7 @@ export declare const marketPredictionDef: {
412
405
  readonly to: "RESOLVING";
413
406
  readonly eventName: "submit_resolution";
414
407
  readonly guard: {
415
- readonly and: readonly [{
416
- readonly in: readonly [{
417
- readonly var: "event.agent";
418
- }, {
419
- readonly var: "state.oracles";
420
- }];
421
- }, {
408
+ readonly and: readonly [import("../../../schema/guards.js").GuardRule, {
422
409
  readonly "!": readonly [{
423
410
  readonly in: readonly [{
424
411
  readonly var: "event.agent";
@@ -450,7 +437,7 @@ export declare const marketPredictionDef: {
450
437
  readonly var: "event.proof";
451
438
  };
452
439
  readonly submittedAt: {
453
- readonly var: "$timestamp";
440
+ readonly var: "$ordinal";
454
441
  };
455
442
  }]];
456
443
  };
@@ -462,12 +449,14 @@ export declare const marketPredictionDef: {
462
449
  readonly to: "SETTLED";
463
450
  readonly eventName: "finalize";
464
451
  readonly guard: {
465
- readonly ">=": readonly [{
466
- readonly size: {
467
- readonly var: "state.resolutions";
468
- };
469
- }, {
470
- readonly var: "state.quorum";
452
+ readonly and: readonly [import("../../../schema/guards.js").GuardRule, {
453
+ readonly ">=": readonly [{
454
+ readonly count: {
455
+ readonly var: "state.resolutions";
456
+ };
457
+ }, {
458
+ readonly var: "state.quorum";
459
+ }];
471
460
  }];
472
461
  };
473
462
  readonly effect: {
@@ -476,10 +465,10 @@ export declare const marketPredictionDef: {
476
465
  }, {
477
466
  readonly status: "SETTLED";
478
467
  readonly settledAt: {
479
- readonly var: "$timestamp";
468
+ readonly var: "$ordinal";
480
469
  };
481
470
  readonly finalOutcome: {
482
- readonly var: "event.outcome";
471
+ readonly var: "state.resolutions.0.outcome";
483
472
  };
484
473
  readonly claims: readonly [];
485
474
  }];
@@ -492,7 +481,7 @@ export declare const marketPredictionDef: {
492
481
  readonly guard: {
493
482
  readonly and: readonly [{
494
483
  readonly ">": readonly [{
495
- readonly size: {
484
+ readonly length: readonly [{
496
485
  readonly filter: readonly [{
497
486
  readonly var: "state.positions";
498
487
  }, {
@@ -502,7 +491,7 @@ export declare const marketPredictionDef: {
502
491
  readonly var: "event.agent";
503
492
  }];
504
493
  }];
505
- };
494
+ }];
506
495
  }, 0];
507
496
  }, {
508
497
  readonly var: "event.stake";
@@ -514,7 +503,7 @@ export declare const marketPredictionDef: {
514
503
  }, {
515
504
  readonly status: "DISPUTED";
516
505
  readonly disputedAt: {
517
- readonly var: "$timestamp";
506
+ readonly var: "$ordinal";
518
507
  };
519
508
  readonly disputedBy: {
520
509
  readonly var: "event.agent";
@@ -533,7 +522,13 @@ export declare const marketPredictionDef: {
533
522
  readonly to: "SETTLED";
534
523
  readonly eventName: "ruling";
535
524
  readonly guard: {
536
- readonly var: "event.judicialRuling";
525
+ readonly and: readonly [import("../../../schema/guards.js").GuardRule, {
526
+ readonly in: readonly [{
527
+ readonly var: "event.finalOutcome";
528
+ }, {
529
+ readonly var: "state.outcomes";
530
+ }];
531
+ }];
537
532
  };
538
533
  readonly effect: {
539
534
  readonly merge: readonly [{
@@ -541,10 +536,10 @@ export declare const marketPredictionDef: {
541
536
  }, {
542
537
  readonly status: "SETTLED";
543
538
  readonly settledAt: {
544
- readonly var: "$timestamp";
539
+ readonly var: "$ordinal";
545
540
  };
546
541
  readonly finalOutcome: {
547
- readonly var: "event.outcome";
542
+ readonly var: "event.finalOutcome";
548
543
  };
549
544
  readonly rulingId: {
550
545
  readonly var: "event.rulingId";
@@ -559,7 +554,7 @@ export declare const marketPredictionDef: {
559
554
  readonly eventName: "invalidate";
560
555
  readonly guard: {
561
556
  readonly ">=": readonly [{
562
- readonly size: {
557
+ readonly length: readonly [{
563
558
  readonly filter: readonly [{
564
559
  readonly var: "state.resolutions";
565
560
  }, {
@@ -567,7 +562,7 @@ export declare const marketPredictionDef: {
567
562
  readonly var: "outcome";
568
563
  }, "INVALID"];
569
564
  }];
570
- };
565
+ }];
571
566
  }, {
572
567
  readonly var: "state.quorum";
573
568
  }];
@@ -578,7 +573,7 @@ export declare const marketPredictionDef: {
578
573
  }, {
579
574
  readonly status: "REFUNDED";
580
575
  readonly refundedAt: {
581
- readonly var: "$timestamp";
576
+ readonly var: "$ordinal";
582
577
  };
583
578
  readonly reason: "oracle_invalidation";
584
579
  }];
@@ -591,7 +586,7 @@ export declare const marketPredictionDef: {
591
586
  readonly guard: {
592
587
  readonly and: readonly [{
593
588
  readonly ">": readonly [{
594
- readonly size: {
589
+ readonly length: readonly [{
595
590
  readonly filter: readonly [{
596
591
  readonly var: "state.positions";
597
592
  }, {
@@ -609,7 +604,7 @@ export declare const marketPredictionDef: {
609
604
  }];
610
605
  }];
611
606
  }];
612
- };
607
+ }];
613
608
  }, 0];
614
609
  }, {
615
610
  readonly "!": readonly [{
@@ -640,7 +635,7 @@ export declare const marketPredictionDef: {
640
635
  readonly var: "event.amount";
641
636
  };
642
637
  readonly claimedAt: {
643
- readonly var: "$timestamp";
638
+ readonly var: "$ordinal";
644
639
  };
645
640
  }]];
646
641
  };
@@ -50,27 +50,47 @@ export declare const marketUniversalDef: {
50
50
  readonly PROPOSED: {
51
51
  readonly id: "PROPOSED";
52
52
  readonly isFinal: false;
53
- readonly metadata: null;
53
+ readonly metadata: {
54
+ readonly label: "Proposed";
55
+ readonly description: "Market created but not yet open";
56
+ readonly category: "initial";
57
+ };
54
58
  };
55
59
  readonly OPEN: {
56
60
  readonly id: "OPEN";
57
61
  readonly isFinal: false;
58
- readonly metadata: null;
62
+ readonly metadata: {
63
+ readonly label: "Open";
64
+ readonly description: "Market is open for participation";
65
+ readonly category: "active";
66
+ };
59
67
  };
60
68
  readonly CLOSED: {
61
69
  readonly id: "CLOSED";
62
70
  readonly isFinal: false;
63
- readonly metadata: null;
71
+ readonly metadata: {
72
+ readonly label: "Closed";
73
+ readonly description: "Participation closed; awaiting settlement";
74
+ readonly category: "pending";
75
+ };
64
76
  };
65
77
  readonly SETTLED: {
66
78
  readonly id: "SETTLED";
67
79
  readonly isFinal: true;
68
- readonly metadata: null;
80
+ readonly metadata: {
81
+ readonly label: "Settled";
82
+ readonly description: "Market settled and payouts available (terminal)";
83
+ readonly category: "terminal";
84
+ };
69
85
  };
70
86
  readonly CANCELLED: {
71
87
  readonly id: "CANCELLED";
72
88
  readonly isFinal: true;
73
- readonly metadata: null;
89
+ readonly metadata: {
90
+ readonly label: "Cancelled";
91
+ readonly description: "Market cancelled before settlement (terminal)";
92
+ readonly category: "terminal";
93
+ };
74
94
  };
75
95
  };
76
96
  readonly initialState: "PROPOSED";
@@ -87,7 +107,7 @@ export declare const marketUniversalDef: {
87
107
  }, {
88
108
  readonly status: "OPEN";
89
109
  readonly openedAt: {
90
- readonly var: "$timestamp";
110
+ readonly var: "$ordinal";
91
111
  };
92
112
  }];
93
113
  };
@@ -105,7 +125,7 @@ export declare const marketUniversalDef: {
105
125
  }, {
106
126
  readonly status: "CANCELLED";
107
127
  readonly cancelledAt: {
108
- readonly var: "$timestamp";
128
+ readonly var: "$ordinal";
109
129
  };
110
130
  }];
111
131
  };
@@ -146,7 +166,7 @@ export declare const marketUniversalDef: {
146
166
  }, {
147
167
  readonly status: "CLOSED";
148
168
  readonly closedAt: {
149
- readonly var: "$timestamp";
169
+ readonly var: "$ordinal";
150
170
  };
151
171
  }];
152
172
  };
@@ -164,7 +184,7 @@ export declare const marketUniversalDef: {
164
184
  }, {
165
185
  readonly status: "SETTLED";
166
186
  readonly settledAt: {
167
- readonly var: "$timestamp";
187
+ readonly var: "$ordinal";
168
188
  };
169
189
  }];
170
190
  };
@@ -182,7 +202,7 @@ export declare const marketUniversalDef: {
182
202
  }, {
183
203
  readonly status: "CANCELLED";
184
204
  readonly cancelledAt: {
185
- readonly var: "$timestamp";
205
+ readonly var: "$ordinal";
186
206
  };
187
207
  }];
188
208
  };
@@ -19,11 +19,11 @@
19
19
  export { FiberStatus, AccessControlPolicy, PublicAccess, WhitelistAccess, FiberOwnedAccess, StateMachineDefinition, EmittedEvent, EventReceipt, ScriptInvocation, FiberLogEntry, } from './ottochain/v1/fiber.js';
20
20
  export { CreateStateMachine, TransitionStateMachine, ArchiveStateMachine, CreateScript, InvokeScript, OttochainMessage, } from './ottochain/v1/messages.js';
21
21
  export { StateMachineFiberRecord, ScriptFiberRecord, FiberCommit, OnChainState, CalculatedState, } from './ottochain/v1/records.js';
22
- export { IdentityType, IdentityState, Platform, PlatformLink, Reputation, PenaltyEvent, Identity, RegisterIdentityRequest, ActivateIdentityRequest, LinkPlatformRequest, ChallengeIdentityRequest, AddStakeRequest, WithdrawIdentityRequest, IdentityDefinition, } from './ottochain/apps/identity/v1/identity.js';
23
- export { IdentityState as AgentState } from './ottochain/apps/identity/v1/identity.js';
24
- export { IdentityState as OracleState } from './ottochain/apps/identity/v1/identity.js';
22
+ export { Type as IdentityType, State as IdentityState, Platform, PlatformLink, Reputation, PenaltyEvent, Identity, RegisterIdentityRequest, ActivateIdentityRequest, LinkPlatformRequest, ChallengeIdentityRequest, AddStakeRequest, WithdrawIdentityRequest, IdentityDefinition, } from './ottochain/apps/identity/v1/identity.js';
23
+ export { State as AgentState } from './ottochain/apps/identity/v1/identity.js';
24
+ export { State as OracleState } from './ottochain/apps/identity/v1/identity.js';
25
25
  export { AttestationType, ReputationDelta, Attestation, VouchRequest, ChallengeRequest, ReputationConfig, } from './ottochain/apps/identity/v1/attestation.js';
26
- export { ContractState, Contract, ProposeContractRequest, AcceptContractRequest, CompleteContractRequest, RejectContractRequest, DisputeContractRequest, ContractDefinition, } from './ottochain/apps/contracts/v1/contract.js';
27
- export { MarketType, MarketState, Commitment, Resolution, Market, CreateMarketRequest, CommitToMarketRequest, SubmitResolutionRequest, CancelMarketRequest, MarketDefinition, } from './ottochain/apps/markets/v1/market.js';
26
+ export { State as ContractState, Contract, ProposeContractRequest, AcceptContractRequest, CompleteContractRequest, RejectContractRequest, DisputeContractRequest, ContractDefinition, } from './ottochain/apps/contracts/v1/contract.js';
27
+ export { Type as MarketType, State as MarketState, Commitment, Resolution, Market, CreateMarketRequest, CommitToMarketRequest, SubmitResolutionRequest, CancelMarketRequest, MarketDefinition, } from './ottochain/apps/markets/v1/market.js';
28
28
  export { DAOType, DAOStatus, ProposalStatus, VoteChoice, DAOMetadata, Proposal, Vote, VoteTally, SingleOwnerDAO, SingleOwnerAction, OwnershipTransfer, MultisigDAO, MultisigAction, TokenDAO, TokenProposalResult, ThresholdDAO, ThresholdVotes, ThresholdHistoryEntry, CreateDAORequest, ProposeRequest, VoteRequest, ExecuteRequest, } from './ottochain/apps/governance/v1/governance.js';
29
29
  export { EntityType, EntityState, DirectorStatus, OfficerStatus, BoardMeetingType, ResolutionStatus, Jurisdiction, ShareClass, CorporateEntity, RegisteredAgent, Incorporator, ShareStructure, CorporateBoard, Director, SeatInfo, QuorumRules, BoardMeeting, MeetingAttendee, CorporateOfficers, Officer, OfficerAction, CorporateShareholders, Shareholder, ShareHolding, CorporateResolution, ResolutionVote, CorporateSecurities, SecurityIssuance, SecurityTransfer, CorporateCompliance, FilingRecord, ComplianceRequirement, CreateEntityRequest, AppointDirectorRequest, IssueSharesRequest, ProposeResolutionRequest, } from './ottochain/apps/corporate/v1/corporate.js';