@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
@@ -112,42 +112,54 @@ export declare const marketAuctionDef: {
112
112
  readonly id: "PROPOSED";
113
113
  readonly isFinal: false;
114
114
  readonly metadata: {
115
+ readonly label: "Proposed";
115
116
  readonly description: "Auction created but not yet open";
117
+ readonly category: "initial";
116
118
  };
117
119
  };
118
120
  readonly OPEN: {
119
121
  readonly id: "OPEN";
120
122
  readonly isFinal: false;
121
123
  readonly metadata: {
124
+ readonly label: "Open";
122
125
  readonly description: "Accepting bids";
126
+ readonly category: "active";
123
127
  };
124
128
  };
125
129
  readonly CLOSING: {
126
130
  readonly id: "CLOSING";
127
131
  readonly isFinal: false;
128
132
  readonly metadata: {
133
+ readonly label: "Closing";
129
134
  readonly description: "Bid period ended, determining winner";
135
+ readonly category: "pending";
130
136
  };
131
137
  };
132
138
  readonly SETTLED: {
133
139
  readonly id: "SETTLED";
134
140
  readonly isFinal: true;
135
141
  readonly metadata: {
142
+ readonly label: "Settled";
136
143
  readonly description: "Winner determined, transfer complete";
144
+ readonly category: "terminal";
137
145
  };
138
146
  };
139
147
  readonly NO_SALE: {
140
148
  readonly id: "NO_SALE";
141
149
  readonly isFinal: true;
142
150
  readonly metadata: {
151
+ readonly label: "No sale";
143
152
  readonly description: "Reserve not met or no valid bids";
153
+ readonly category: "terminal";
144
154
  };
145
155
  };
146
156
  readonly CANCELLED: {
147
157
  readonly id: "CANCELLED";
148
158
  readonly isFinal: true;
149
159
  readonly metadata: {
160
+ readonly label: "Cancelled";
150
161
  readonly description: "Auction cancelled by seller";
162
+ readonly category: "terminal";
151
163
  };
152
164
  };
153
165
  };
@@ -156,20 +168,14 @@ export declare const marketAuctionDef: {
156
168
  readonly from: "PROPOSED";
157
169
  readonly to: "OPEN";
158
170
  readonly eventName: "open";
159
- readonly guard: {
160
- readonly "===": readonly [{
161
- readonly var: "event.agent";
162
- }, {
163
- readonly var: "state.seller";
164
- }];
165
- };
171
+ readonly guard: import("../../../schema/guards.js").GuardRule;
166
172
  readonly effect: {
167
173
  readonly merge: readonly [{
168
174
  readonly var: "state";
169
175
  }, {
170
176
  readonly status: "OPEN";
171
177
  readonly openedAt: {
172
- readonly var: "$timestamp";
178
+ readonly var: "$ordinal";
173
179
  };
174
180
  readonly bids: readonly [];
175
181
  readonly highBid: null;
@@ -181,20 +187,14 @@ export declare const marketAuctionDef: {
181
187
  readonly from: "PROPOSED";
182
188
  readonly to: "CANCELLED";
183
189
  readonly eventName: "cancel";
184
- readonly guard: {
185
- readonly "===": readonly [{
186
- readonly var: "event.agent";
187
- }, {
188
- readonly var: "state.seller";
189
- }];
190
- };
190
+ readonly guard: import("../../../schema/guards.js").GuardRule;
191
191
  readonly effect: {
192
192
  readonly merge: readonly [{
193
193
  readonly var: "state";
194
194
  }, {
195
195
  readonly status: "CANCELLED";
196
196
  readonly cancelledAt: {
197
- readonly var: "$timestamp";
197
+ readonly var: "$ordinal";
198
198
  };
199
199
  }];
200
200
  };
@@ -204,13 +204,7 @@ export declare const marketAuctionDef: {
204
204
  readonly to: "OPEN";
205
205
  readonly eventName: "bid";
206
206
  readonly guard: {
207
- readonly and: readonly [{
208
- readonly "!==": readonly [{
209
- readonly var: "event.agent";
210
- }, {
211
- readonly var: "state.seller";
212
- }];
213
- }, {
207
+ readonly and: readonly [import("../../../schema/guards.js").GuardRule, {
214
208
  readonly ">=": readonly [{
215
209
  readonly var: "event.amount";
216
210
  }, {
@@ -239,7 +233,7 @@ export declare const marketAuctionDef: {
239
233
  }];
240
234
  }, {
241
235
  readonly "<=": readonly [{
242
- readonly var: "$timestamp";
236
+ readonly var: "$ordinal";
243
237
  }, {
244
238
  readonly var: "state.deadline";
245
239
  }];
@@ -261,7 +255,7 @@ export declare const marketAuctionDef: {
261
255
  readonly var: "event.amount";
262
256
  };
263
257
  readonly bidAt: {
264
- readonly var: "$timestamp";
258
+ readonly var: "$ordinal";
265
259
  };
266
260
  }]];
267
261
  };
@@ -272,7 +266,7 @@ export declare const marketAuctionDef: {
272
266
  readonly var: "event.agent";
273
267
  };
274
268
  readonly lastBidAt: {
275
- readonly var: "$timestamp";
269
+ readonly var: "$ordinal";
276
270
  };
277
271
  }];
278
272
  };
@@ -282,18 +276,12 @@ export declare const marketAuctionDef: {
282
276
  readonly to: "CLOSING";
283
277
  readonly eventName: "close";
284
278
  readonly guard: {
285
- readonly or: readonly [{
286
- readonly "===": readonly [{
287
- readonly var: "event.agent";
288
- }, {
289
- readonly var: "state.seller";
290
- }];
291
- }, {
279
+ readonly or: readonly [import("../../../schema/guards.js").GuardRule, {
292
280
  readonly and: readonly [{
293
281
  readonly var: "state.deadline";
294
282
  }, {
295
283
  readonly ">=": readonly [{
296
- readonly var: "$timestamp";
284
+ readonly var: "$ordinal";
297
285
  }, {
298
286
  readonly var: "state.deadline";
299
287
  }];
@@ -306,7 +294,7 @@ export declare const marketAuctionDef: {
306
294
  }, {
307
295
  readonly status: "CLOSING";
308
296
  readonly closedAt: {
309
- readonly var: "$timestamp";
297
+ readonly var: "$ordinal";
310
298
  };
311
299
  }];
312
300
  };
@@ -338,7 +326,7 @@ export declare const marketAuctionDef: {
338
326
  }, {
339
327
  readonly status: "SETTLED";
340
328
  readonly settledAt: {
341
- readonly var: "$timestamp";
329
+ readonly var: "$ordinal";
342
330
  };
343
331
  readonly winner: {
344
332
  readonly var: "state.highBidder";
@@ -376,7 +364,7 @@ export declare const marketAuctionDef: {
376
364
  }, {
377
365
  readonly status: "NO_SALE";
378
366
  readonly closedAt: {
379
- readonly var: "$timestamp";
367
+ readonly var: "$ordinal";
380
368
  };
381
369
  readonly reason: {
382
370
  readonly if: readonly [{
@@ -127,35 +127,45 @@ export declare const marketCrowdfundDef: {
127
127
  readonly id: "PROPOSED";
128
128
  readonly isFinal: false;
129
129
  readonly metadata: {
130
+ readonly label: "Proposed";
130
131
  readonly description: "Campaign created but not yet open";
132
+ readonly category: "initial";
131
133
  };
132
134
  };
133
135
  readonly OPEN: {
134
136
  readonly id: "OPEN";
135
137
  readonly isFinal: false;
136
138
  readonly metadata: {
139
+ readonly label: "Open";
137
140
  readonly description: "Accepting pledges";
141
+ readonly category: "active";
138
142
  };
139
143
  };
140
144
  readonly FUNDED: {
141
145
  readonly id: "FUNDED";
142
146
  readonly isFinal: true;
143
147
  readonly metadata: {
148
+ readonly label: "Funded";
144
149
  readonly description: "Threshold met, funds released to creator";
150
+ readonly category: "terminal";
145
151
  };
146
152
  };
147
153
  readonly REFUNDED: {
148
154
  readonly id: "REFUNDED";
149
155
  readonly isFinal: true;
150
156
  readonly metadata: {
157
+ readonly label: "Refunded";
151
158
  readonly description: "Threshold not met, all pledges refunded";
159
+ readonly category: "terminal";
152
160
  };
153
161
  };
154
162
  readonly CANCELLED: {
155
163
  readonly id: "CANCELLED";
156
164
  readonly isFinal: true;
157
165
  readonly metadata: {
166
+ readonly label: "Cancelled";
158
167
  readonly description: "Campaign cancelled by creator";
168
+ readonly category: "terminal";
159
169
  };
160
170
  };
161
171
  };
@@ -164,20 +174,14 @@ export declare const marketCrowdfundDef: {
164
174
  readonly from: "PROPOSED";
165
175
  readonly to: "OPEN";
166
176
  readonly eventName: "launch";
167
- readonly guard: {
168
- readonly "===": readonly [{
169
- readonly var: "event.agent";
170
- }, {
171
- readonly var: "state.creator";
172
- }];
173
- };
177
+ readonly guard: import("../../../schema/guards.js").GuardRule;
174
178
  readonly effect: {
175
179
  readonly merge: readonly [{
176
180
  readonly var: "state";
177
181
  }, {
178
182
  readonly status: "OPEN";
179
183
  readonly launchedAt: {
180
- readonly var: "$timestamp";
184
+ readonly var: "$ordinal";
181
185
  };
182
186
  readonly pledges: readonly [];
183
187
  readonly totalPledged: 0;
@@ -189,20 +193,14 @@ export declare const marketCrowdfundDef: {
189
193
  readonly from: "PROPOSED";
190
194
  readonly to: "CANCELLED";
191
195
  readonly eventName: "cancel";
192
- readonly guard: {
193
- readonly "===": readonly [{
194
- readonly var: "event.agent";
195
- }, {
196
- readonly var: "state.creator";
197
- }];
198
- };
196
+ readonly guard: import("../../../schema/guards.js").GuardRule;
199
197
  readonly effect: {
200
198
  readonly merge: readonly [{
201
199
  readonly var: "state";
202
200
  }, {
203
201
  readonly status: "CANCELLED";
204
202
  readonly cancelledAt: {
205
- readonly var: "$timestamp";
203
+ readonly var: "$ordinal";
206
204
  };
207
205
  }];
208
206
  };
@@ -216,13 +214,7 @@ export declare const marketCrowdfundDef: {
216
214
  readonly ">": readonly [{
217
215
  readonly var: "event.amount";
218
216
  }, 0];
219
- }, {
220
- readonly "!==": readonly [{
221
- readonly var: "event.agent";
222
- }, {
223
- readonly var: "state.creator";
224
- }];
225
- }, {
217
+ }, import("../../../schema/guards.js").GuardRule, {
226
218
  readonly or: readonly [{
227
219
  readonly "!": readonly [{
228
220
  readonly var: "state.minPledge";
@@ -236,7 +228,7 @@ export declare const marketCrowdfundDef: {
236
228
  }];
237
229
  }, {
238
230
  readonly "<=": readonly [{
239
- readonly var: "$timestamp";
231
+ readonly var: "$ordinal";
240
232
  }, {
241
233
  readonly var: "state.deadline";
242
234
  }];
@@ -260,7 +252,7 @@ export declare const marketCrowdfundDef: {
260
252
  readonly var: "event.rewardTier";
261
253
  };
262
254
  readonly pledgedAt: {
263
- readonly var: "$timestamp";
255
+ readonly var: "$ordinal";
264
256
  };
265
257
  }]];
266
258
  };
@@ -290,13 +282,13 @@ export declare const marketCrowdfundDef: {
290
282
  }, 0];
291
283
  }, {
292
284
  readonly "<=": readonly [{
293
- readonly var: "$timestamp";
285
+ readonly var: "$ordinal";
294
286
  }, {
295
287
  readonly var: "state.deadline";
296
288
  }];
297
289
  }, {
298
290
  readonly ">": readonly [{
299
- readonly size: {
291
+ readonly length: readonly [{
300
292
  readonly filter: readonly [{
301
293
  readonly var: "state.pledges";
302
294
  }, {
@@ -306,7 +298,7 @@ export declare const marketCrowdfundDef: {
306
298
  readonly var: "event.agent";
307
299
  }];
308
300
  }];
309
- };
301
+ }];
310
302
  }, 0];
311
303
  }];
312
304
  };
@@ -337,7 +329,7 @@ export declare const marketCrowdfundDef: {
337
329
  }];
338
330
  }, {
339
331
  readonly ">=": readonly [{
340
- readonly var: "$timestamp";
332
+ readonly var: "$ordinal";
341
333
  }, {
342
334
  readonly var: "state.deadline";
343
335
  }];
@@ -349,7 +341,7 @@ export declare const marketCrowdfundDef: {
349
341
  }, {
350
342
  readonly status: "FUNDED";
351
343
  readonly fundedAt: {
352
- readonly var: "$timestamp";
344
+ readonly var: "$ordinal";
353
345
  };
354
346
  readonly stretchGoalsReached: {
355
347
  readonly filter: readonly [{
@@ -378,7 +370,7 @@ export declare const marketCrowdfundDef: {
378
370
  }];
379
371
  }, {
380
372
  readonly ">=": readonly [{
381
- readonly var: "$timestamp";
373
+ readonly var: "$ordinal";
382
374
  }, {
383
375
  readonly var: "state.deadline";
384
376
  }];
@@ -390,7 +382,7 @@ export declare const marketCrowdfundDef: {
390
382
  }, {
391
383
  readonly status: "REFUNDED";
392
384
  readonly refundedAt: {
393
- readonly var: "$timestamp";
385
+ readonly var: "$ordinal";
394
386
  };
395
387
  readonly reason: "threshold_not_met";
396
388
  }];
@@ -403,7 +395,7 @@ export declare const marketCrowdfundDef: {
403
395
  readonly guard: {
404
396
  readonly and: readonly [{
405
397
  readonly ">": readonly [{
406
- readonly size: {
398
+ readonly length: readonly [{
407
399
  readonly filter: readonly [{
408
400
  readonly var: "state.pledges";
409
401
  }, {
@@ -413,7 +405,7 @@ export declare const marketCrowdfundDef: {
413
405
  readonly var: "event.agent";
414
406
  }];
415
407
  }];
416
- };
408
+ }];
417
409
  }, 0];
418
410
  }, {
419
411
  readonly "!": readonly [{
@@ -130,49 +130,63 @@ export declare const marketGroupBuyDef: {
130
130
  readonly id: "PROPOSED";
131
131
  readonly isFinal: false;
132
132
  readonly metadata: {
133
+ readonly label: "Proposed";
133
134
  readonly description: "Group buy created but not yet open";
135
+ readonly category: "initial";
134
136
  };
135
137
  };
136
138
  readonly OPEN: {
137
139
  readonly id: "OPEN";
138
140
  readonly isFinal: false;
139
141
  readonly metadata: {
142
+ readonly label: "Open";
140
143
  readonly description: "Accepting orders";
144
+ readonly category: "active";
141
145
  };
142
146
  };
143
147
  readonly THRESHOLD_MET: {
144
148
  readonly id: "THRESHOLD_MET";
145
149
  readonly isFinal: false;
146
150
  readonly metadata: {
151
+ readonly label: "Threshold met";
147
152
  readonly description: "Minimum quantity reached, continuing for better tier";
153
+ readonly category: "active";
148
154
  };
149
155
  };
150
156
  readonly PROCESSING: {
151
157
  readonly id: "PROCESSING";
152
158
  readonly isFinal: false;
153
159
  readonly metadata: {
160
+ readonly label: "Processing";
154
161
  readonly description: "Order placed with vendor, awaiting fulfillment";
162
+ readonly category: "pending";
155
163
  };
156
164
  };
157
165
  readonly FULFILLED: {
158
166
  readonly id: "FULFILLED";
159
167
  readonly isFinal: true;
160
168
  readonly metadata: {
169
+ readonly label: "Fulfilled";
161
170
  readonly description: "All items delivered to buyers";
171
+ readonly category: "terminal";
162
172
  };
163
173
  };
164
174
  readonly REFUNDED: {
165
175
  readonly id: "REFUNDED";
166
176
  readonly isFinal: true;
167
177
  readonly metadata: {
178
+ readonly label: "Refunded";
168
179
  readonly description: "Threshold not met, all orders refunded";
180
+ readonly category: "terminal";
169
181
  };
170
182
  };
171
183
  readonly CANCELLED: {
172
184
  readonly id: "CANCELLED";
173
185
  readonly isFinal: true;
174
186
  readonly metadata: {
187
+ readonly label: "Cancelled";
175
188
  readonly description: "Group buy cancelled";
189
+ readonly category: "terminal";
176
190
  };
177
191
  };
178
192
  };
@@ -181,20 +195,14 @@ export declare const marketGroupBuyDef: {
181
195
  readonly from: "PROPOSED";
182
196
  readonly to: "OPEN";
183
197
  readonly eventName: "open";
184
- readonly guard: {
185
- readonly "===": readonly [{
186
- readonly var: "event.agent";
187
- }, {
188
- readonly var: "state.organizer";
189
- }];
190
- };
198
+ readonly guard: import("../../../schema/guards.js").GuardRule;
191
199
  readonly effect: {
192
200
  readonly merge: readonly [{
193
201
  readonly var: "state";
194
202
  }, {
195
203
  readonly status: "OPEN";
196
204
  readonly openedAt: {
197
- readonly var: "$timestamp";
205
+ readonly var: "$ordinal";
198
206
  };
199
207
  readonly orders: readonly [];
200
208
  readonly totalQuantity: 0;
@@ -206,20 +214,14 @@ export declare const marketGroupBuyDef: {
206
214
  readonly from: "PROPOSED";
207
215
  readonly to: "CANCELLED";
208
216
  readonly eventName: "cancel";
209
- readonly guard: {
210
- readonly "===": readonly [{
211
- readonly var: "event.agent";
212
- }, {
213
- readonly var: "state.organizer";
214
- }];
215
- };
217
+ readonly guard: import("../../../schema/guards.js").GuardRule;
216
218
  readonly effect: {
217
219
  readonly merge: readonly [{
218
220
  readonly var: "state";
219
221
  }, {
220
222
  readonly status: "CANCELLED";
221
223
  readonly cancelledAt: {
222
- readonly var: "$timestamp";
224
+ readonly var: "$ordinal";
223
225
  };
224
226
  }];
225
227
  };
@@ -247,7 +249,7 @@ export declare const marketGroupBuyDef: {
247
249
  }];
248
250
  }, {
249
251
  readonly "<=": readonly [{
250
- readonly var: "$timestamp";
252
+ readonly var: "$ordinal";
251
253
  }, {
252
254
  readonly var: "state.deadline";
253
255
  }];
@@ -271,7 +273,7 @@ export declare const marketGroupBuyDef: {
271
273
  readonly var: "event.shippingInfo";
272
274
  };
273
275
  readonly orderedAt: {
274
- readonly var: "$timestamp";
276
+ readonly var: "$ordinal";
275
277
  };
276
278
  }]];
277
279
  };
@@ -302,7 +304,7 @@ export declare const marketGroupBuyDef: {
302
304
  }, {
303
305
  readonly status: "THRESHOLD_MET";
304
306
  readonly thresholdMetAt: {
305
- readonly var: "$timestamp";
307
+ readonly var: "$ordinal";
306
308
  };
307
309
  readonly currentTier: {
308
310
  readonly reduce: readonly [{
@@ -335,7 +337,7 @@ export declare const marketGroupBuyDef: {
335
337
  }, 0];
336
338
  }, {
337
339
  readonly "<=": readonly [{
338
- readonly var: "$timestamp";
340
+ readonly var: "$ordinal";
339
341
  }, {
340
342
  readonly var: "state.deadline";
341
343
  }];
@@ -359,7 +361,7 @@ export declare const marketGroupBuyDef: {
359
361
  readonly var: "event.shippingInfo";
360
362
  };
361
363
  readonly orderedAt: {
362
- readonly var: "$timestamp";
364
+ readonly var: "$ordinal";
363
365
  };
364
366
  }]];
365
367
  };
@@ -402,7 +404,7 @@ export declare const marketGroupBuyDef: {
402
404
  readonly eventName: "finalize";
403
405
  readonly guard: {
404
406
  readonly ">=": readonly [{
405
- readonly var: "$timestamp";
407
+ readonly var: "$ordinal";
406
408
  }, {
407
409
  readonly var: "state.deadline";
408
410
  }];
@@ -413,7 +415,7 @@ export declare const marketGroupBuyDef: {
413
415
  }, {
414
416
  readonly status: "PROCESSING";
415
417
  readonly finalizedAt: {
416
- readonly var: "$timestamp";
418
+ readonly var: "$ordinal";
417
419
  };
418
420
  readonly finalTier: {
419
421
  readonly var: "state.currentTier";
@@ -432,28 +434,14 @@ export declare const marketGroupBuyDef: {
432
434
  readonly from: "PROCESSING";
433
435
  readonly to: "FULFILLED";
434
436
  readonly eventName: "fulfill";
435
- readonly guard: {
436
- readonly or: readonly [{
437
- readonly "===": readonly [{
438
- readonly var: "event.agent";
439
- }, {
440
- readonly var: "state.vendor";
441
- }];
442
- }, {
443
- readonly "===": readonly [{
444
- readonly var: "event.agent";
445
- }, {
446
- readonly var: "state.organizer";
447
- }];
448
- }];
449
- };
437
+ readonly guard: import("../../../schema/guards.js").GuardRule;
450
438
  readonly effect: {
451
439
  readonly merge: readonly [{
452
440
  readonly var: "state";
453
441
  }, {
454
442
  readonly status: "FULFILLED";
455
443
  readonly fulfilledAt: {
456
- readonly var: "$timestamp";
444
+ readonly var: "$ordinal";
457
445
  };
458
446
  readonly trackingInfo: {
459
447
  readonly var: "event.trackingInfo";
@@ -474,7 +462,7 @@ export declare const marketGroupBuyDef: {
474
462
  }];
475
463
  }, {
476
464
  readonly ">=": readonly [{
477
- readonly var: "$timestamp";
465
+ readonly var: "$ordinal";
478
466
  }, {
479
467
  readonly var: "state.deadline";
480
468
  }];
@@ -486,7 +474,7 @@ export declare const marketGroupBuyDef: {
486
474
  }, {
487
475
  readonly status: "REFUNDED";
488
476
  readonly refundedAt: {
489
- readonly var: "$timestamp";
477
+ readonly var: "$ordinal";
490
478
  };
491
479
  readonly reason: "threshold_not_met";
492
480
  }];
@@ -499,7 +487,7 @@ export declare const marketGroupBuyDef: {
499
487
  readonly guard: {
500
488
  readonly and: readonly [{
501
489
  readonly ">": readonly [{
502
- readonly size: {
490
+ readonly length: readonly [{
503
491
  readonly filter: readonly [{
504
492
  readonly var: "state.orders";
505
493
  }, {
@@ -509,7 +497,7 @@ export declare const marketGroupBuyDef: {
509
497
  readonly var: "event.agent";
510
498
  }];
511
499
  }];
512
- };
500
+ }];
513
501
  }, 0];
514
502
  }, {
515
503
  readonly "!": readonly [{