@ottochain/sdk 2.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/dist/cjs/apps/contracts/index.js +1 -1
  2. package/dist/cjs/apps/contracts/state-machines/contract-agreement.js +272 -0
  3. package/dist/cjs/apps/contracts/state-machines/contract-escrow.js +284 -0
  4. package/dist/cjs/apps/contracts/state-machines/contract-universal.js +93 -0
  5. package/dist/cjs/apps/contracts/state-machines/index.js +177 -1
  6. package/dist/cjs/apps/corporate/state-machines/corp-board.js +1022 -0
  7. package/dist/cjs/apps/corporate/state-machines/corp-entity.js +671 -0
  8. package/dist/cjs/apps/corporate/state-machines/corp-securities.js +998 -0
  9. package/dist/cjs/apps/corporate/state-machines/corp-shareholders.js +1102 -0
  10. package/dist/cjs/apps/corporate/state-machines/index.js +20 -4440
  11. package/dist/cjs/apps/governance/index.js +7 -7
  12. package/dist/cjs/apps/governance/state-machines/dao-multisig.js +467 -0
  13. package/dist/cjs/apps/governance/state-machines/dao-reputation.js +458 -0
  14. package/dist/cjs/apps/governance/state-machines/dao-single.js +199 -0
  15. package/dist/cjs/apps/governance/state-machines/dao-token.js +503 -0
  16. package/dist/cjs/apps/governance/state-machines/governance-simple.js +482 -0
  17. package/dist/cjs/apps/governance/state-machines/governance-universal.js +138 -0
  18. package/dist/cjs/apps/governance/state-machines/index.js +16 -2934
  19. package/dist/cjs/apps/identity/constants.js +28 -14
  20. package/dist/cjs/apps/identity/index.js +27 -12
  21. package/dist/cjs/apps/identity/state-machines/identity-agent.js +256 -0
  22. package/dist/cjs/apps/identity/state-machines/identity-oracle.js +321 -0
  23. package/dist/cjs/apps/identity/state-machines/identity-universal.js +106 -0
  24. package/dist/cjs/apps/identity/state-machines/index.js +15 -784
  25. package/dist/cjs/apps/markets/index.js +1 -1
  26. package/dist/cjs/apps/markets/state-machines/index.js +14 -2298
  27. package/dist/cjs/apps/markets/state-machines/market-auction.js +283 -0
  28. package/dist/cjs/apps/markets/state-machines/market-crowdfund.js +312 -0
  29. package/dist/cjs/apps/markets/state-machines/market-group-buy.js +407 -0
  30. package/dist/cjs/apps/markets/state-machines/market-prediction.js +485 -0
  31. package/dist/cjs/apps/markets/state-machines/market-universal.js +129 -0
  32. package/dist/cjs/apps/oracles/index.js +36 -0
  33. package/dist/cjs/generated/google/protobuf/struct.js +1 -1
  34. package/dist/cjs/generated/google/protobuf/timestamp.js +1 -1
  35. package/dist/cjs/generated/index.js +26 -22
  36. package/dist/cjs/generated/ottochain/apps/contracts/v1/contract.js +1 -1
  37. package/dist/cjs/generated/ottochain/apps/corporate/v1/corporate.js +1 -1
  38. package/dist/cjs/generated/ottochain/apps/governance/v1/governance.js +1 -1
  39. package/dist/cjs/generated/ottochain/apps/identity/v1/attestation.js +12 -12
  40. package/dist/cjs/generated/ottochain/apps/identity/v1/identity.js +1688 -0
  41. package/dist/cjs/generated/ottochain/apps/markets/v1/market.js +1 -1
  42. package/dist/cjs/generated/ottochain/v1/common.js +1 -1
  43. package/dist/cjs/generated/ottochain/v1/fiber.js +1 -1
  44. package/dist/cjs/generated/ottochain/v1/messages.js +1 -1
  45. package/dist/cjs/generated/ottochain/v1/records.js +1 -1
  46. package/dist/cjs/schema/fiber-app.js +95 -0
  47. package/dist/cjs/schema/index.js +20 -0
  48. package/dist/esm/apps/contracts/index.js +3 -3
  49. package/dist/esm/apps/contracts/state-machines/contract-agreement.js +269 -0
  50. package/dist/esm/apps/contracts/state-machines/contract-escrow.js +281 -0
  51. package/dist/esm/apps/contracts/state-machines/contract-universal.js +90 -0
  52. package/dist/esm/apps/contracts/state-machines/index.js +177 -1
  53. package/dist/esm/apps/corporate/index.js +3 -3
  54. package/dist/esm/apps/corporate/state-machines/corp-board.js +1019 -0
  55. package/dist/esm/apps/corporate/state-machines/corp-entity.js +668 -0
  56. package/dist/esm/apps/corporate/state-machines/corp-securities.js +995 -0
  57. package/dist/esm/apps/corporate/state-machines/corp-shareholders.js +1099 -0
  58. package/dist/esm/apps/corporate/state-machines/index.js +15 -4439
  59. package/dist/esm/apps/governance/index.js +9 -9
  60. package/dist/esm/apps/governance/state-machines/dao-multisig.js +464 -0
  61. package/dist/esm/apps/governance/state-machines/dao-reputation.js +455 -0
  62. package/dist/esm/apps/governance/state-machines/dao-single.js +196 -0
  63. package/dist/esm/apps/governance/state-machines/dao-token.js +500 -0
  64. package/dist/esm/apps/governance/state-machines/governance-simple.js +479 -0
  65. package/dist/esm/apps/governance/state-machines/governance-universal.js +135 -0
  66. package/dist/esm/apps/governance/state-machines/index.js +9 -2933
  67. package/dist/esm/apps/identity/constants.js +28 -14
  68. package/dist/esm/apps/identity/index.js +7 -5
  69. package/dist/esm/apps/identity/state-machines/identity-agent.js +253 -0
  70. package/dist/esm/apps/identity/state-machines/identity-oracle.js +318 -0
  71. package/dist/esm/apps/identity/state-machines/identity-universal.js +103 -0
  72. package/dist/esm/apps/identity/state-machines/index.js +11 -783
  73. package/dist/esm/apps/index.js +5 -5
  74. package/dist/esm/apps/markets/index.js +3 -3
  75. package/dist/esm/apps/markets/state-machines/index.js +8 -2297
  76. package/dist/esm/apps/markets/state-machines/market-auction.js +280 -0
  77. package/dist/esm/apps/markets/state-machines/market-crowdfund.js +309 -0
  78. package/dist/esm/apps/markets/state-machines/market-group-buy.js +404 -0
  79. package/dist/esm/apps/markets/state-machines/market-prediction.js +482 -0
  80. package/dist/esm/apps/markets/state-machines/market-universal.js +126 -0
  81. package/dist/esm/apps/oracles/index.js +21 -0
  82. package/dist/esm/generated/google/protobuf/struct.js +1 -1
  83. package/dist/esm/generated/google/protobuf/timestamp.js +1 -1
  84. package/dist/esm/generated/index.js +8 -4
  85. package/dist/esm/generated/ottochain/apps/contracts/v1/contract.js +1 -1
  86. package/dist/esm/generated/ottochain/apps/corporate/v1/corporate.js +1 -1
  87. package/dist/esm/generated/ottochain/apps/governance/v1/governance.js +1 -1
  88. package/dist/esm/generated/ottochain/apps/identity/v1/attestation.js +2 -2
  89. package/dist/esm/generated/ottochain/apps/identity/v1/identity.js +1676 -0
  90. package/dist/esm/generated/ottochain/apps/markets/v1/market.js +1 -1
  91. package/dist/esm/generated/ottochain/v1/common.js +1 -1
  92. package/dist/esm/generated/ottochain/v1/fiber.js +1 -1
  93. package/dist/esm/generated/ottochain/v1/messages.js +1 -1
  94. package/dist/esm/generated/ottochain/v1/records.js +1 -1
  95. package/dist/esm/schema/fiber-app.js +86 -0
  96. package/dist/esm/schema/index.js +4 -0
  97. package/dist/types/apps/contracts/index.d.ts +151 -2
  98. package/dist/types/apps/contracts/state-machines/contract-agreement.d.ts +462 -0
  99. package/dist/types/apps/contracts/state-machines/contract-escrow.d.ts +511 -0
  100. package/dist/types/apps/contracts/state-machines/contract-universal.d.ts +147 -0
  101. package/dist/types/apps/contracts/state-machines/index.d.ts +149 -0
  102. package/dist/types/apps/corporate/index.d.ts +5263 -3825
  103. package/dist/types/apps/corporate/state-machines/corp-board.d.ts +1479 -0
  104. package/dist/types/apps/corporate/state-machines/corp-entity.d.ts +970 -0
  105. package/dist/types/apps/corporate/state-machines/corp-securities.d.ts +1381 -0
  106. package/dist/types/apps/corporate/state-machines/corp-shareholders.d.ts +1631 -0
  107. package/dist/types/apps/corporate/state-machines/index.d.ts +5245 -3802
  108. package/dist/types/apps/governance/index.d.ts +875 -37
  109. package/dist/types/apps/governance/state-machines/dao-multisig.d.ts +644 -0
  110. package/dist/types/apps/governance/state-machines/dao-reputation.d.ts +610 -0
  111. package/dist/types/apps/governance/state-machines/dao-single.d.ts +276 -0
  112. package/dist/types/apps/governance/state-machines/dao-token.d.ts +601 -0
  113. package/dist/types/apps/governance/state-machines/governance-simple.d.ts +652 -0
  114. package/dist/types/apps/governance/state-machines/governance-universal.d.ts +181 -0
  115. package/dist/types/apps/governance/state-machines/index.d.ts +9 -2136
  116. package/dist/types/apps/identity/constants.d.ts +8 -6
  117. package/dist/types/apps/identity/index.d.ts +1078 -577
  118. package/dist/types/apps/identity/state-machines/identity-agent.d.ts +401 -0
  119. package/dist/types/apps/identity/state-machines/identity-oracle.d.ts +550 -0
  120. package/dist/types/apps/identity/state-machines/identity-universal.d.ts +151 -0
  121. package/dist/types/apps/identity/state-machines/index.d.ts +1069 -567
  122. package/dist/types/apps/index.d.ts +5 -5
  123. package/dist/types/apps/markets/index.d.ts +535 -7
  124. package/dist/types/apps/markets/state-machines/index.d.ts +8 -1678
  125. package/dist/types/apps/markets/state-machines/market-auction.d.ts +392 -0
  126. package/dist/types/apps/markets/state-machines/market-crowdfund.d.ts +443 -0
  127. package/dist/types/apps/markets/state-machines/market-group-buy.d.ts +539 -0
  128. package/dist/types/apps/markets/state-machines/market-prediction.d.ts +651 -0
  129. package/dist/types/apps/markets/state-machines/market-universal.d.ts +191 -0
  130. package/dist/types/apps/oracles/index.d.ts +18 -0
  131. package/dist/types/generated/index.d.ts +3 -2
  132. package/dist/types/generated/ottochain/apps/identity/v1/attestation.d.ts +1 -1
  133. package/dist/types/generated/ottochain/apps/identity/v1/identity.d.ts +187 -0
  134. package/dist/types/schema/fiber-app.d.ts +172 -0
  135. package/dist/types/schema/index.d.ts +4 -0
  136. package/package.json +1 -1
  137. package/dist/cjs/generated/ottochain/apps/identity/v1/agent.js +0 -619
  138. package/dist/cjs/generated/ottochain/apps/oracles/v1/oracle.js +0 -1223
  139. package/dist/esm/generated/ottochain/apps/identity/v1/agent.js +0 -610
  140. package/dist/esm/generated/ottochain/apps/oracles/v1/oracle.js +0 -1217
  141. package/dist/types/generated/ottochain/apps/identity/v1/agent.d.ts +0 -94
  142. package/dist/types/generated/ottochain/apps/oracles/v1/oracle.d.ts +0 -150
@@ -26,8 +26,8 @@
26
26
  *
27
27
  * @packageDocumentation
28
28
  */
29
- export * as identity from './identity/index.js';
30
- export * as contracts from './contracts/index.js';
31
- export * as markets from './markets/index.js';
32
- export * as governance from './governance/index.js';
33
- export * as corporate from './corporate/index.js';
29
+ export * as identity from "./identity/index.js";
30
+ export * as contracts from "./contracts/index.js";
31
+ export * as markets from "./markets/index.js";
32
+ export * as governance from "./governance/index.js";
33
+ export * as corporate from "./corporate/index.js";
@@ -19,16 +19,55 @@
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';
23
- import { marketUniversalDef, marketPredictionDef, marketAuctionDef, marketCrowdfundDef, marketGroupBuyDef } from './state-machines/index.js';
22
+ export { MarketType, MarketState, Commitment, Resolution, Market, CreateMarketRequest, CommitToMarketRequest, SubmitResolutionRequest, CancelMarketRequest, MarketDefinition, marketTypeFromJSON, marketTypeToJSON, marketStateFromJSON, marketStateToJSON, } from "../../generated/ottochain/apps/markets/v1/market.js";
23
+ import { marketUniversalDef, marketPredictionDef, marketAuctionDef, marketCrowdfundDef, marketGroupBuyDef } from "./state-machines/index.js";
24
24
  export { marketUniversalDef, marketPredictionDef, marketAuctionDef, marketCrowdfundDef, marketGroupBuyDef, };
25
25
  /** All market state machine definitions */
26
26
  export declare const MARKETS_DEFINITIONS: {
27
27
  readonly universal: {
28
28
  readonly metadata: {
29
29
  readonly name: "MarketUniversal";
30
- readonly description: "Minimal market state machine - extend for custom use cases";
30
+ readonly app: "markets";
31
+ readonly type: "universal";
31
32
  readonly version: "1.0.0";
33
+ readonly description: "Minimal market state machine - extend for custom use cases";
34
+ };
35
+ readonly createSchema: {
36
+ readonly properties: {};
37
+ };
38
+ readonly stateSchema: {
39
+ readonly properties: {
40
+ readonly status: {
41
+ readonly type: "string";
42
+ };
43
+ readonly totalCommitted: {
44
+ readonly type: "number";
45
+ readonly computed: true;
46
+ };
47
+ };
48
+ };
49
+ readonly eventSchemas: {
50
+ readonly open: {
51
+ readonly description: "Open the market for participation";
52
+ };
53
+ readonly cancel: {
54
+ readonly description: "Cancel the market";
55
+ };
56
+ readonly commit: {
57
+ readonly description: "Commit funds to the market";
58
+ readonly properties: {
59
+ readonly amount: {
60
+ readonly type: "number";
61
+ readonly minimum: 0;
62
+ };
63
+ };
64
+ };
65
+ readonly close: {
66
+ readonly description: "Close the market to new commits";
67
+ };
68
+ readonly settle: {
69
+ readonly description: "Settle the market";
70
+ };
32
71
  };
33
72
  readonly states: {
34
73
  readonly PROPOSED: {
@@ -176,13 +215,178 @@ export declare const MARKETS_DEFINITIONS: {
176
215
  readonly prediction: {
177
216
  readonly metadata: {
178
217
  readonly name: "MarketPrediction";
179
- readonly description: "Binary or multi-outcome prediction market with oracle resolution and position staking";
218
+ readonly app: "markets";
219
+ readonly type: "prediction";
180
220
  readonly version: "1.0.0";
221
+ readonly description: "Binary or multi-outcome prediction market with oracle resolution and position staking";
181
222
  readonly crossReferences: {
182
223
  readonly oracleId: "Links to IdentityOracle that resolves the outcome";
183
224
  readonly creatorIdentityId: "Links to creator's IdentityAgent";
184
225
  };
185
226
  };
227
+ readonly createSchema: {
228
+ readonly required: readonly ["creator", "outcomes", "oracles", "quorum"];
229
+ readonly properties: {
230
+ readonly creator: {
231
+ readonly type: "address";
232
+ readonly description: "DAG address of the market creator";
233
+ readonly immutable: true;
234
+ };
235
+ readonly outcomes: {
236
+ readonly type: "array";
237
+ readonly description: "Valid outcome identifiers";
238
+ readonly immutable: true;
239
+ };
240
+ readonly oracles: {
241
+ readonly type: "array";
242
+ readonly description: "Authorized oracle addresses";
243
+ readonly immutable: true;
244
+ };
245
+ readonly quorum: {
246
+ readonly type: "number";
247
+ readonly description: "Minimum oracle submissions needed to resolve";
248
+ readonly immutable: true;
249
+ };
250
+ readonly deadline: {
251
+ readonly type: "timestamp";
252
+ readonly description: "Optional trading deadline";
253
+ };
254
+ };
255
+ };
256
+ readonly stateSchema: {
257
+ readonly properties: {
258
+ readonly status: {
259
+ readonly type: "string";
260
+ readonly computed: true;
261
+ };
262
+ readonly creator: {
263
+ readonly type: "address";
264
+ readonly immutable: true;
265
+ };
266
+ readonly outcomes: {
267
+ readonly type: "array";
268
+ readonly immutable: true;
269
+ };
270
+ readonly oracles: {
271
+ readonly type: "array";
272
+ readonly immutable: true;
273
+ };
274
+ readonly quorum: {
275
+ readonly type: "number";
276
+ readonly immutable: true;
277
+ };
278
+ readonly deadline: {
279
+ readonly type: "timestamp";
280
+ };
281
+ readonly positions: {
282
+ readonly type: "object";
283
+ readonly computed: true;
284
+ };
285
+ readonly totalPool: {
286
+ readonly type: "number";
287
+ readonly computed: true;
288
+ };
289
+ readonly resolutions: {
290
+ readonly type: "array";
291
+ readonly computed: true;
292
+ };
293
+ readonly finalOutcome: {
294
+ readonly type: "string";
295
+ readonly computed: true;
296
+ };
297
+ readonly claims: {
298
+ readonly type: "array";
299
+ readonly computed: true;
300
+ };
301
+ };
302
+ };
303
+ readonly eventSchemas: {
304
+ readonly open: {
305
+ readonly description: "Open the market for trading";
306
+ };
307
+ readonly cancel: {
308
+ readonly description: "Cancel the market before opening";
309
+ readonly properties: {
310
+ readonly reason: {
311
+ readonly type: "string";
312
+ };
313
+ };
314
+ };
315
+ readonly take_position: {
316
+ readonly description: "Take a position on an outcome";
317
+ readonly required: readonly ["outcome", "amount"];
318
+ readonly properties: {
319
+ readonly outcome: {
320
+ readonly type: "string";
321
+ };
322
+ readonly amount: {
323
+ readonly type: "number";
324
+ readonly minimum: 0;
325
+ };
326
+ };
327
+ };
328
+ readonly close: {
329
+ readonly description: "Close trading";
330
+ };
331
+ readonly submit_resolution: {
332
+ readonly description: "Submit oracle resolution";
333
+ readonly required: readonly ["outcome", "proof"];
334
+ readonly properties: {
335
+ readonly outcome: {
336
+ readonly type: "string";
337
+ };
338
+ readonly proof: {
339
+ readonly type: "string";
340
+ };
341
+ };
342
+ };
343
+ readonly finalize: {
344
+ readonly description: "Finalize market after quorum reached";
345
+ readonly properties: {
346
+ readonly outcome: {
347
+ readonly type: "string";
348
+ };
349
+ };
350
+ };
351
+ readonly dispute: {
352
+ readonly description: "Dispute the resolution";
353
+ readonly required: readonly ["stake"];
354
+ readonly properties: {
355
+ readonly stake: {
356
+ readonly type: "number";
357
+ readonly minimum: 0;
358
+ };
359
+ readonly reason: {
360
+ readonly type: "string";
361
+ };
362
+ };
363
+ };
364
+ readonly ruling: {
365
+ readonly description: "Judicial ruling on dispute";
366
+ readonly properties: {
367
+ readonly judicialRuling: {
368
+ readonly type: "boolean";
369
+ };
370
+ readonly outcome: {
371
+ readonly type: "string";
372
+ };
373
+ readonly rulingId: {
374
+ readonly type: "string";
375
+ };
376
+ };
377
+ };
378
+ readonly invalidate: {
379
+ readonly description: "Invalidate market by oracle consensus";
380
+ };
381
+ readonly claim: {
382
+ readonly description: "Claim payout after settlement";
383
+ readonly properties: {
384
+ readonly amount: {
385
+ readonly type: "number";
386
+ };
387
+ };
388
+ };
389
+ };
186
390
  readonly states: {
187
391
  readonly PROPOSED: {
188
392
  readonly id: "PROPOSED";
@@ -659,13 +863,112 @@ export declare const MARKETS_DEFINITIONS: {
659
863
  readonly auction: {
660
864
  readonly metadata: {
661
865
  readonly name: "MarketAuction";
662
- readonly description: "Auction market supporting English, Dutch, and sealed-bid variants";
866
+ readonly app: "markets";
867
+ readonly type: "auction";
663
868
  readonly version: "1.0.0";
869
+ readonly description: "Auction market supporting English, Dutch, and sealed-bid variants";
664
870
  readonly crossReferences: {
665
871
  readonly sellerIdentityId: "Links to seller's IdentityAgent";
666
872
  readonly escrowId: "Links to ContractEscrow for asset custody";
667
873
  };
668
874
  };
875
+ readonly createSchema: {
876
+ readonly required: readonly ["seller", "minBid"];
877
+ readonly properties: {
878
+ readonly seller: {
879
+ readonly type: "address";
880
+ readonly description: "DAG address of the seller";
881
+ readonly immutable: true;
882
+ };
883
+ readonly minBid: {
884
+ readonly type: "number";
885
+ readonly minimum: 0;
886
+ readonly description: "Minimum opening bid";
887
+ readonly immutable: true;
888
+ };
889
+ readonly bidIncrement: {
890
+ readonly type: "number";
891
+ readonly minimum: 0;
892
+ readonly description: "Minimum bid increment";
893
+ };
894
+ readonly reservePrice: {
895
+ readonly type: "number";
896
+ readonly minimum: 0;
897
+ readonly description: "Reserve price (if any)";
898
+ };
899
+ readonly deadline: {
900
+ readonly type: "timestamp";
901
+ readonly description: "Auction deadline";
902
+ };
903
+ };
904
+ };
905
+ readonly stateSchema: {
906
+ readonly properties: {
907
+ readonly status: {
908
+ readonly type: "string";
909
+ readonly computed: true;
910
+ };
911
+ readonly seller: {
912
+ readonly type: "address";
913
+ readonly immutable: true;
914
+ };
915
+ readonly minBid: {
916
+ readonly type: "number";
917
+ readonly immutable: true;
918
+ };
919
+ readonly bidIncrement: {
920
+ readonly type: "number";
921
+ };
922
+ readonly reservePrice: {
923
+ readonly type: "number";
924
+ };
925
+ readonly deadline: {
926
+ readonly type: "timestamp";
927
+ };
928
+ readonly bids: {
929
+ readonly type: "array";
930
+ readonly computed: true;
931
+ };
932
+ readonly highBid: {
933
+ readonly type: "number";
934
+ readonly computed: true;
935
+ };
936
+ readonly highBidder: {
937
+ readonly type: "address";
938
+ readonly computed: true;
939
+ };
940
+ };
941
+ }; /**
942
+ * Get a market state machine definition by type.
943
+ * @param type - 'universal' | 'prediction' | 'auction' | 'crowdfund' | 'groupBuy' (default: 'universal')
944
+ */
945
+ readonly eventSchemas: {
946
+ readonly open: {
947
+ readonly description: "Open the auction";
948
+ };
949
+ readonly cancel: {
950
+ readonly description: "Cancel the auction";
951
+ };
952
+ readonly bid: {
953
+ readonly description: "Place a bid";
954
+ readonly required: readonly ["amount"];
955
+ readonly properties: {
956
+ readonly amount: {
957
+ readonly type: "number";
958
+ readonly minimum: 0;
959
+ };
960
+ };
961
+ };
962
+ readonly close: {
963
+ readonly description: "Close bidding";
964
+ };
965
+ readonly settle: {
966
+ readonly description: "Settle with winning bidder";
967
+ };
968
+ readonly no_sale: {
969
+ readonly description: "Declare no sale (reserve not met or no bids)";
970
+ };
971
+ };
669
972
  readonly states: {
670
973
  readonly PROPOSED: {
671
974
  readonly id: "PROPOSED";
@@ -952,13 +1255,124 @@ export declare const MARKETS_DEFINITIONS: {
952
1255
  readonly crowdfund: {
953
1256
  readonly metadata: {
954
1257
  readonly name: "MarketCrowdfund";
955
- readonly description: "All-or-nothing crowdfunding with threshold, deadline, and stretch goals";
1258
+ readonly app: "markets";
1259
+ readonly type: "crowdfund";
956
1260
  readonly version: "1.0.0";
1261
+ readonly description: "All-or-nothing crowdfunding with threshold, deadline, and stretch goals";
957
1262
  readonly crossReferences: {
958
1263
  readonly creatorIdentityId: "Links to creator's IdentityAgent";
959
1264
  readonly treasuryId: "Links to Treasury for fund custody";
960
1265
  };
961
1266
  };
1267
+ readonly createSchema: {
1268
+ readonly required: readonly ["creator", "threshold", "deadline"];
1269
+ readonly properties: {
1270
+ readonly creator: {
1271
+ readonly type: "address";
1272
+ readonly description: "DAG address of campaign creator";
1273
+ readonly immutable: true;
1274
+ };
1275
+ readonly threshold: {
1276
+ readonly type: "number";
1277
+ readonly minimum: 0;
1278
+ readonly description: "Funding goal amount";
1279
+ readonly immutable: true;
1280
+ };
1281
+ readonly deadline: {
1282
+ readonly type: "timestamp";
1283
+ readonly description: "Campaign deadline";
1284
+ readonly immutable: true;
1285
+ };
1286
+ readonly minPledge: {
1287
+ readonly type: "number";
1288
+ readonly minimum: 0;
1289
+ readonly description: "Minimum pledge amount";
1290
+ };
1291
+ readonly stretchGoals: {
1292
+ readonly type: "array";
1293
+ readonly description: "Stretch goal targets";
1294
+ };
1295
+ };
1296
+ };
1297
+ readonly stateSchema: {
1298
+ readonly properties: {
1299
+ readonly status: {
1300
+ readonly type: "string";
1301
+ readonly computed: true;
1302
+ };
1303
+ readonly creator: {
1304
+ readonly type: "address";
1305
+ readonly immutable: true;
1306
+ };
1307
+ readonly threshold: {
1308
+ readonly type: "number";
1309
+ readonly immutable: true;
1310
+ };
1311
+ readonly deadline: {
1312
+ readonly type: "timestamp";
1313
+ readonly immutable: true;
1314
+ };
1315
+ readonly minPledge: {
1316
+ readonly type: "number";
1317
+ };
1318
+ readonly stretchGoals: {
1319
+ readonly type: "array";
1320
+ };
1321
+ readonly pledges: {
1322
+ readonly type: "array";
1323
+ readonly computed: true;
1324
+ };
1325
+ readonly totalPledged: {
1326
+ readonly type: "number";
1327
+ readonly computed: true;
1328
+ };
1329
+ readonly backerCount: {
1330
+ readonly type: "number";
1331
+ readonly computed: true;
1332
+ };
1333
+ readonly refundsClaimed: {
1334
+ readonly type: "array";
1335
+ readonly computed: true;
1336
+ };
1337
+ };
1338
+ };
1339
+ readonly eventSchemas: {
1340
+ readonly launch: {
1341
+ readonly description: "Launch the campaign";
1342
+ };
1343
+ readonly cancel: {
1344
+ readonly description: "Cancel the campaign";
1345
+ };
1346
+ readonly pledge: {
1347
+ readonly description: "Make a pledge";
1348
+ readonly required: readonly ["amount"];
1349
+ readonly properties: {
1350
+ readonly amount: {
1351
+ readonly type: "number";
1352
+ readonly minimum: 0;
1353
+ };
1354
+ readonly rewardTier: {
1355
+ readonly type: "string";
1356
+ };
1357
+ };
1358
+ };
1359
+ readonly increase_pledge: {
1360
+ readonly description: "Increase an existing pledge";
1361
+ readonly required: readonly ["additionalAmount"];
1362
+ readonly properties: {
1363
+ readonly additionalAmount: {
1364
+ readonly type: "number";
1365
+ readonly minimum: 0;
1366
+ };
1367
+ };
1368
+ };
1369
+ readonly finalize: {
1370
+ readonly description: "Finalize the campaign after deadline";
1371
+ };
1372
+ readonly claim_refund: {
1373
+ readonly description: "Claim refund in failed campaign";
1374
+ };
1375
+ };
962
1376
  readonly states: {
963
1377
  readonly PROPOSED: {
964
1378
  readonly id: "PROPOSED";
@@ -1281,13 +1695,127 @@ export declare const MARKETS_DEFINITIONS: {
1281
1695
  readonly groupBuy: {
1282
1696
  readonly metadata: {
1283
1697
  readonly name: "MarketGroupBuy";
1284
- readonly description: "Collective purchasing with quantity thresholds and tiered pricing";
1698
+ readonly app: "markets";
1699
+ readonly type: "groupBuy";
1285
1700
  readonly version: "1.0.0";
1701
+ readonly description: "Collective purchasing with quantity thresholds and tiered pricing";
1286
1702
  readonly crossReferences: {
1287
1703
  readonly vendorIdentityId: "Links to vendor's IdentityAgent";
1288
1704
  readonly escrowId: "Links to ContractEscrow for payment custody";
1289
1705
  };
1290
1706
  };
1707
+ readonly createSchema: {
1708
+ readonly required: readonly ["organizer", "minQuantity", "deadline"];
1709
+ readonly properties: {
1710
+ readonly organizer: {
1711
+ readonly type: "address";
1712
+ readonly description: "DAG address of group buy organizer";
1713
+ readonly immutable: true;
1714
+ };
1715
+ readonly minQuantity: {
1716
+ readonly type: "number";
1717
+ readonly minimum: 1;
1718
+ readonly description: "Minimum quantity to proceed";
1719
+ readonly immutable: true;
1720
+ };
1721
+ readonly deadline: {
1722
+ readonly type: "timestamp";
1723
+ readonly description: "Order deadline";
1724
+ readonly immutable: true;
1725
+ };
1726
+ readonly vendor: {
1727
+ readonly type: "address";
1728
+ readonly description: "DAG address of the vendor";
1729
+ };
1730
+ readonly maxPerBuyer: {
1731
+ readonly type: "number";
1732
+ readonly minimum: 1;
1733
+ readonly description: "Max quantity per buyer";
1734
+ };
1735
+ readonly priceTiers: {
1736
+ readonly type: "array";
1737
+ readonly description: "Quantity-based pricing tiers";
1738
+ };
1739
+ };
1740
+ };
1741
+ readonly stateSchema: {
1742
+ readonly properties: {
1743
+ readonly status: {
1744
+ readonly type: "string";
1745
+ readonly computed: true;
1746
+ };
1747
+ readonly organizer: {
1748
+ readonly type: "address";
1749
+ readonly immutable: true;
1750
+ };
1751
+ readonly vendor: {
1752
+ readonly type: "address";
1753
+ };
1754
+ readonly minQuantity: {
1755
+ readonly type: "number";
1756
+ readonly immutable: true;
1757
+ };
1758
+ readonly maxPerBuyer: {
1759
+ readonly type: "number";
1760
+ };
1761
+ readonly deadline: {
1762
+ readonly type: "timestamp";
1763
+ readonly immutable: true;
1764
+ };
1765
+ readonly priceTiers: {
1766
+ readonly type: "array";
1767
+ };
1768
+ readonly orders: {
1769
+ readonly type: "array";
1770
+ readonly computed: true;
1771
+ };
1772
+ readonly totalQuantity: {
1773
+ readonly type: "number";
1774
+ readonly computed: true;
1775
+ };
1776
+ readonly currentTier: {
1777
+ readonly type: "number";
1778
+ readonly computed: true;
1779
+ };
1780
+ readonly refundsClaimed: {
1781
+ readonly type: "array";
1782
+ readonly computed: true;
1783
+ };
1784
+ };
1785
+ };
1786
+ readonly eventSchemas: {
1787
+ readonly open: {
1788
+ readonly description: "Open the group buy for orders";
1789
+ };
1790
+ readonly cancel: {
1791
+ readonly description: "Cancel the group buy";
1792
+ };
1793
+ readonly order: {
1794
+ readonly description: "Place an order";
1795
+ readonly required: readonly ["quantity"];
1796
+ readonly properties: {
1797
+ readonly quantity: {
1798
+ readonly type: "number";
1799
+ readonly minimum: 1;
1800
+ };
1801
+ readonly shippingInfo: {
1802
+ readonly type: "object";
1803
+ };
1804
+ };
1805
+ };
1806
+ readonly check_threshold: {
1807
+ readonly description: "Check if minimum threshold reached";
1808
+ };
1809
+ readonly finalize: {
1810
+ readonly description: "Finalize after deadline";
1811
+ };
1812
+ readonly fulfill: {
1813
+ readonly description: "Mark group buy as fulfilled by vendor/organizer";
1814
+ };
1815
+ readonly claim_refund: {
1816
+ readonly description: "Claim refund if threshold not met";
1817
+ };
1818
+ };
1291
1819
  readonly states: {
1292
1820
  readonly PROPOSED: {
1293
1821
  readonly id: "PROPOSED";