@ottochain/sdk 1.7.0-beta.2 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (113) 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 +20 -20
  20. package/dist/cjs/apps/identity/index.js +13 -21
  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/index.js +14 -7
  34. package/dist/cjs/generated/ottochain/apps/identity/v1/identity.js +197 -198
  35. package/dist/cjs/schema/fiber-app.js +55 -0
  36. package/dist/cjs/schema/index.js +20 -0
  37. package/dist/esm/apps/contracts/index.js +3 -3
  38. package/dist/esm/apps/contracts/state-machines/contract-agreement.js +269 -0
  39. package/dist/esm/apps/contracts/state-machines/contract-escrow.js +281 -0
  40. package/dist/esm/apps/contracts/state-machines/contract-universal.js +90 -0
  41. package/dist/esm/apps/contracts/state-machines/index.js +177 -1
  42. package/dist/esm/apps/corporate/index.js +3 -3
  43. package/dist/esm/apps/corporate/state-machines/corp-board.js +1019 -0
  44. package/dist/esm/apps/corporate/state-machines/corp-entity.js +668 -0
  45. package/dist/esm/apps/corporate/state-machines/corp-securities.js +995 -0
  46. package/dist/esm/apps/corporate/state-machines/corp-shareholders.js +1099 -0
  47. package/dist/esm/apps/corporate/state-machines/index.js +15 -4439
  48. package/dist/esm/apps/governance/index.js +9 -9
  49. package/dist/esm/apps/governance/state-machines/dao-multisig.js +464 -0
  50. package/dist/esm/apps/governance/state-machines/dao-reputation.js +455 -0
  51. package/dist/esm/apps/governance/state-machines/dao-single.js +196 -0
  52. package/dist/esm/apps/governance/state-machines/dao-token.js +500 -0
  53. package/dist/esm/apps/governance/state-machines/governance-simple.js +479 -0
  54. package/dist/esm/apps/governance/state-machines/governance-universal.js +135 -0
  55. package/dist/esm/apps/governance/state-machines/index.js +9 -2933
  56. package/dist/esm/apps/identity/constants.js +21 -21
  57. package/dist/esm/apps/identity/index.js +13 -22
  58. package/dist/esm/apps/identity/state-machines/identity-agent.js +253 -0
  59. package/dist/esm/apps/identity/state-machines/identity-oracle.js +318 -0
  60. package/dist/esm/apps/identity/state-machines/identity-universal.js +103 -0
  61. package/dist/esm/apps/identity/state-machines/index.js +11 -783
  62. package/dist/esm/apps/index.js +5 -5
  63. package/dist/esm/apps/markets/index.js +3 -3
  64. package/dist/esm/apps/markets/state-machines/index.js +8 -2297
  65. package/dist/esm/apps/markets/state-machines/market-auction.js +280 -0
  66. package/dist/esm/apps/markets/state-machines/market-crowdfund.js +309 -0
  67. package/dist/esm/apps/markets/state-machines/market-group-buy.js +404 -0
  68. package/dist/esm/apps/markets/state-machines/market-prediction.js +482 -0
  69. package/dist/esm/apps/markets/state-machines/market-universal.js +126 -0
  70. package/dist/esm/apps/oracles/index.js +21 -0
  71. package/dist/esm/generated/index.js +8 -3
  72. package/dist/esm/generated/ottochain/apps/identity/v1/identity.js +196 -197
  73. package/dist/esm/schema/fiber-app.js +47 -0
  74. package/dist/esm/schema/index.js +4 -0
  75. package/dist/types/apps/contracts/index.d.ts +151 -2
  76. package/dist/types/apps/contracts/state-machines/contract-agreement.d.ts +462 -0
  77. package/dist/types/apps/contracts/state-machines/contract-escrow.d.ts +511 -0
  78. package/dist/types/apps/contracts/state-machines/contract-universal.d.ts +147 -0
  79. package/dist/types/apps/contracts/state-machines/index.d.ts +149 -0
  80. package/dist/types/apps/corporate/index.d.ts +5263 -3825
  81. package/dist/types/apps/corporate/state-machines/corp-board.d.ts +1479 -0
  82. package/dist/types/apps/corporate/state-machines/corp-entity.d.ts +970 -0
  83. package/dist/types/apps/corporate/state-machines/corp-securities.d.ts +1381 -0
  84. package/dist/types/apps/corporate/state-machines/corp-shareholders.d.ts +1631 -0
  85. package/dist/types/apps/corporate/state-machines/index.d.ts +5245 -3802
  86. package/dist/types/apps/governance/index.d.ts +875 -37
  87. package/dist/types/apps/governance/state-machines/dao-multisig.d.ts +644 -0
  88. package/dist/types/apps/governance/state-machines/dao-reputation.d.ts +610 -0
  89. package/dist/types/apps/governance/state-machines/dao-single.d.ts +276 -0
  90. package/dist/types/apps/governance/state-machines/dao-token.d.ts +601 -0
  91. package/dist/types/apps/governance/state-machines/governance-simple.d.ts +652 -0
  92. package/dist/types/apps/governance/state-machines/governance-universal.d.ts +181 -0
  93. package/dist/types/apps/governance/state-machines/index.d.ts +9 -2136
  94. package/dist/types/apps/identity/constants.d.ts +4 -7
  95. package/dist/types/apps/identity/index.d.ts +1082 -592
  96. package/dist/types/apps/identity/state-machines/identity-agent.d.ts +401 -0
  97. package/dist/types/apps/identity/state-machines/identity-oracle.d.ts +550 -0
  98. package/dist/types/apps/identity/state-machines/identity-universal.d.ts +151 -0
  99. package/dist/types/apps/identity/state-machines/index.d.ts +1069 -567
  100. package/dist/types/apps/index.d.ts +5 -5
  101. package/dist/types/apps/markets/index.d.ts +535 -7
  102. package/dist/types/apps/markets/state-machines/index.d.ts +8 -1678
  103. package/dist/types/apps/markets/state-machines/market-auction.d.ts +392 -0
  104. package/dist/types/apps/markets/state-machines/market-crowdfund.d.ts +443 -0
  105. package/dist/types/apps/markets/state-machines/market-group-buy.d.ts +539 -0
  106. package/dist/types/apps/markets/state-machines/market-prediction.d.ts +651 -0
  107. package/dist/types/apps/markets/state-machines/market-universal.d.ts +191 -0
  108. package/dist/types/apps/oracles/index.d.ts +18 -0
  109. package/dist/types/generated/index.d.ts +3 -1
  110. package/dist/types/generated/ottochain/apps/identity/v1/identity.d.ts +43 -64
  111. package/dist/types/schema/fiber-app.d.ts +139 -0
  112. package/dist/types/schema/index.d.ts +4 -0
  113. package/package.json +1 -1
@@ -0,0 +1,392 @@
1
+ /**
2
+ * Auction market supporting English, Dutch, and sealed-bid variants.
3
+ */
4
+ export declare const marketAuctionDef: {
5
+ readonly metadata: {
6
+ readonly name: "MarketAuction";
7
+ readonly app: "markets";
8
+ readonly type: "auction";
9
+ readonly version: "1.0.0";
10
+ readonly description: "Auction market supporting English, Dutch, and sealed-bid variants";
11
+ readonly crossReferences: {
12
+ readonly sellerIdentityId: "Links to seller's IdentityAgent";
13
+ readonly escrowId: "Links to ContractEscrow for asset custody";
14
+ };
15
+ };
16
+ readonly createSchema: {
17
+ readonly required: readonly ["seller", "minBid"];
18
+ readonly properties: {
19
+ readonly seller: {
20
+ readonly type: "address";
21
+ readonly description: "DAG address of the seller";
22
+ readonly immutable: true;
23
+ };
24
+ readonly minBid: {
25
+ readonly type: "number";
26
+ readonly minimum: 0;
27
+ readonly description: "Minimum opening bid";
28
+ readonly immutable: true;
29
+ };
30
+ readonly bidIncrement: {
31
+ readonly type: "number";
32
+ readonly minimum: 0;
33
+ readonly description: "Minimum bid increment";
34
+ };
35
+ readonly reservePrice: {
36
+ readonly type: "number";
37
+ readonly minimum: 0;
38
+ readonly description: "Reserve price (if any)";
39
+ };
40
+ readonly deadline: {
41
+ readonly type: "timestamp";
42
+ readonly description: "Auction deadline";
43
+ };
44
+ };
45
+ };
46
+ readonly stateSchema: {
47
+ readonly properties: {
48
+ readonly status: {
49
+ readonly type: "string";
50
+ readonly computed: true;
51
+ };
52
+ readonly seller: {
53
+ readonly type: "address";
54
+ readonly immutable: true;
55
+ };
56
+ readonly minBid: {
57
+ readonly type: "number";
58
+ readonly immutable: true;
59
+ };
60
+ readonly bidIncrement: {
61
+ readonly type: "number";
62
+ };
63
+ readonly reservePrice: {
64
+ readonly type: "number";
65
+ };
66
+ readonly deadline: {
67
+ readonly type: "timestamp";
68
+ };
69
+ readonly bids: {
70
+ readonly type: "array";
71
+ readonly computed: true;
72
+ };
73
+ readonly highBid: {
74
+ readonly type: "number";
75
+ readonly computed: true;
76
+ };
77
+ readonly highBidder: {
78
+ readonly type: "address";
79
+ readonly computed: true;
80
+ };
81
+ };
82
+ };
83
+ readonly eventSchemas: {
84
+ readonly open: {
85
+ readonly description: "Open the auction";
86
+ };
87
+ readonly cancel: {
88
+ readonly description: "Cancel the auction";
89
+ };
90
+ readonly bid: {
91
+ readonly description: "Place a bid";
92
+ readonly required: readonly ["amount"];
93
+ readonly properties: {
94
+ readonly amount: {
95
+ readonly type: "number";
96
+ readonly minimum: 0;
97
+ };
98
+ };
99
+ };
100
+ readonly close: {
101
+ readonly description: "Close bidding";
102
+ };
103
+ readonly settle: {
104
+ readonly description: "Settle with winning bidder";
105
+ };
106
+ readonly no_sale: {
107
+ readonly description: "Declare no sale (reserve not met or no bids)";
108
+ };
109
+ };
110
+ readonly states: {
111
+ readonly PROPOSED: {
112
+ readonly id: "PROPOSED";
113
+ readonly isFinal: false;
114
+ readonly metadata: {
115
+ readonly description: "Auction created but not yet open";
116
+ };
117
+ };
118
+ readonly OPEN: {
119
+ readonly id: "OPEN";
120
+ readonly isFinal: false;
121
+ readonly metadata: {
122
+ readonly description: "Accepting bids";
123
+ };
124
+ };
125
+ readonly CLOSING: {
126
+ readonly id: "CLOSING";
127
+ readonly isFinal: false;
128
+ readonly metadata: {
129
+ readonly description: "Bid period ended, determining winner";
130
+ };
131
+ };
132
+ readonly SETTLED: {
133
+ readonly id: "SETTLED";
134
+ readonly isFinal: true;
135
+ readonly metadata: {
136
+ readonly description: "Winner determined, transfer complete";
137
+ };
138
+ };
139
+ readonly NO_SALE: {
140
+ readonly id: "NO_SALE";
141
+ readonly isFinal: true;
142
+ readonly metadata: {
143
+ readonly description: "Reserve not met or no valid bids";
144
+ };
145
+ };
146
+ readonly CANCELLED: {
147
+ readonly id: "CANCELLED";
148
+ readonly isFinal: true;
149
+ readonly metadata: {
150
+ readonly description: "Auction cancelled by seller";
151
+ };
152
+ };
153
+ };
154
+ readonly initialState: "PROPOSED";
155
+ readonly transitions: readonly [{
156
+ readonly from: "PROPOSED";
157
+ readonly to: "OPEN";
158
+ readonly eventName: "open";
159
+ readonly guard: {
160
+ readonly "===": readonly [{
161
+ readonly var: "event.agent";
162
+ }, {
163
+ readonly var: "state.seller";
164
+ }];
165
+ };
166
+ readonly effect: {
167
+ readonly merge: readonly [{
168
+ readonly var: "state";
169
+ }, {
170
+ readonly status: "OPEN";
171
+ readonly openedAt: {
172
+ readonly var: "$timestamp";
173
+ };
174
+ readonly bids: readonly [];
175
+ readonly highBid: null;
176
+ readonly highBidder: null;
177
+ }];
178
+ };
179
+ readonly dependencies: readonly [];
180
+ }, {
181
+ readonly from: "PROPOSED";
182
+ readonly to: "CANCELLED";
183
+ readonly eventName: "cancel";
184
+ readonly guard: {
185
+ readonly "===": readonly [{
186
+ readonly var: "event.agent";
187
+ }, {
188
+ readonly var: "state.seller";
189
+ }];
190
+ };
191
+ readonly effect: {
192
+ readonly merge: readonly [{
193
+ readonly var: "state";
194
+ }, {
195
+ readonly status: "CANCELLED";
196
+ readonly cancelledAt: {
197
+ readonly var: "$timestamp";
198
+ };
199
+ }];
200
+ };
201
+ readonly dependencies: readonly [];
202
+ }, {
203
+ readonly from: "OPEN";
204
+ readonly to: "OPEN";
205
+ readonly eventName: "bid";
206
+ readonly guard: {
207
+ readonly and: readonly [{
208
+ readonly "!==": readonly [{
209
+ readonly var: "event.agent";
210
+ }, {
211
+ readonly var: "state.seller";
212
+ }];
213
+ }, {
214
+ readonly ">=": readonly [{
215
+ readonly var: "event.amount";
216
+ }, {
217
+ readonly var: "state.minBid";
218
+ }];
219
+ }, {
220
+ readonly or: readonly [{
221
+ readonly "!": readonly [{
222
+ readonly var: "state.highBid";
223
+ }];
224
+ }, {
225
+ readonly ">=": readonly [{
226
+ readonly var: "event.amount";
227
+ }, {
228
+ readonly "+": readonly [{
229
+ readonly var: "state.highBid";
230
+ }, {
231
+ readonly var: "state.bidIncrement";
232
+ }];
233
+ }];
234
+ }];
235
+ }, {
236
+ readonly or: readonly [{
237
+ readonly "!": readonly [{
238
+ readonly var: "state.deadline";
239
+ }];
240
+ }, {
241
+ readonly "<=": readonly [{
242
+ readonly var: "$timestamp";
243
+ }, {
244
+ readonly var: "state.deadline";
245
+ }];
246
+ }];
247
+ }];
248
+ };
249
+ readonly effect: {
250
+ readonly merge: readonly [{
251
+ readonly var: "state";
252
+ }, {
253
+ readonly bids: {
254
+ readonly cat: readonly [{
255
+ readonly var: "state.bids";
256
+ }, readonly [{
257
+ readonly bidder: {
258
+ readonly var: "event.agent";
259
+ };
260
+ readonly amount: {
261
+ readonly var: "event.amount";
262
+ };
263
+ readonly bidAt: {
264
+ readonly var: "$timestamp";
265
+ };
266
+ }]];
267
+ };
268
+ readonly highBid: {
269
+ readonly var: "event.amount";
270
+ };
271
+ readonly highBidder: {
272
+ readonly var: "event.agent";
273
+ };
274
+ readonly lastBidAt: {
275
+ readonly var: "$timestamp";
276
+ };
277
+ }];
278
+ };
279
+ readonly dependencies: readonly [];
280
+ }, {
281
+ readonly from: "OPEN";
282
+ readonly to: "CLOSING";
283
+ readonly eventName: "close";
284
+ readonly guard: {
285
+ readonly or: readonly [{
286
+ readonly "===": readonly [{
287
+ readonly var: "event.agent";
288
+ }, {
289
+ readonly var: "state.seller";
290
+ }];
291
+ }, {
292
+ readonly and: readonly [{
293
+ readonly var: "state.deadline";
294
+ }, {
295
+ readonly ">=": readonly [{
296
+ readonly var: "$timestamp";
297
+ }, {
298
+ readonly var: "state.deadline";
299
+ }];
300
+ }];
301
+ }];
302
+ };
303
+ readonly effect: {
304
+ readonly merge: readonly [{
305
+ readonly var: "state";
306
+ }, {
307
+ readonly status: "CLOSING";
308
+ readonly closedAt: {
309
+ readonly var: "$timestamp";
310
+ };
311
+ }];
312
+ };
313
+ readonly dependencies: readonly [];
314
+ }, {
315
+ readonly from: "CLOSING";
316
+ readonly to: "SETTLED";
317
+ readonly eventName: "settle";
318
+ readonly guard: {
319
+ readonly and: readonly [{
320
+ readonly var: "state.highBidder";
321
+ }, {
322
+ readonly or: readonly [{
323
+ readonly "!": readonly [{
324
+ readonly var: "state.reservePrice";
325
+ }];
326
+ }, {
327
+ readonly ">=": readonly [{
328
+ readonly var: "state.highBid";
329
+ }, {
330
+ readonly var: "state.reservePrice";
331
+ }];
332
+ }];
333
+ }];
334
+ };
335
+ readonly effect: {
336
+ readonly merge: readonly [{
337
+ readonly var: "state";
338
+ }, {
339
+ readonly status: "SETTLED";
340
+ readonly settledAt: {
341
+ readonly var: "$timestamp";
342
+ };
343
+ readonly winner: {
344
+ readonly var: "state.highBidder";
345
+ };
346
+ readonly finalPrice: {
347
+ readonly var: "state.highBid";
348
+ };
349
+ }];
350
+ };
351
+ readonly dependencies: readonly [];
352
+ }, {
353
+ readonly from: "CLOSING";
354
+ readonly to: "NO_SALE";
355
+ readonly eventName: "no_sale";
356
+ readonly guard: {
357
+ readonly or: readonly [{
358
+ readonly "!": readonly [{
359
+ readonly var: "state.highBidder";
360
+ }];
361
+ }, {
362
+ readonly and: readonly [{
363
+ readonly var: "state.reservePrice";
364
+ }, {
365
+ readonly "<": readonly [{
366
+ readonly var: "state.highBid";
367
+ }, {
368
+ readonly var: "state.reservePrice";
369
+ }];
370
+ }];
371
+ }];
372
+ };
373
+ readonly effect: {
374
+ readonly merge: readonly [{
375
+ readonly var: "state";
376
+ }, {
377
+ readonly status: "NO_SALE";
378
+ readonly closedAt: {
379
+ readonly var: "$timestamp";
380
+ };
381
+ readonly reason: {
382
+ readonly if: readonly [{
383
+ readonly "!": readonly [{
384
+ readonly var: "state.highBidder";
385
+ }];
386
+ }, "no_bids", "reserve_not_met"];
387
+ };
388
+ }];
389
+ };
390
+ readonly dependencies: readonly [];
391
+ }];
392
+ };