@ottochain/sdk 1.4.2 → 1.6.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 (80) hide show
  1. package/dist/cjs/apps/contracts/index.js +6 -10
  2. package/dist/cjs/apps/{governance/state-machines/governance-legislature.json → contracts/state-machines/index.js} +381 -330
  3. package/dist/cjs/apps/corporate/index.js +12 -24
  4. package/dist/cjs/apps/corporate/state-machines/index.js +10246 -0
  5. package/dist/cjs/apps/governance/index.js +11 -22
  6. package/dist/cjs/apps/governance/state-machines/index.js +4755 -0
  7. package/dist/cjs/apps/identity/index.js +3 -6
  8. package/dist/{esm/apps/identity/state-machines/agent-identity.json → cjs/apps/identity/state-machines/index.js} +9 -2
  9. package/dist/cjs/apps/markets/index.js +2 -5
  10. package/dist/{esm/apps/markets/state-machines/market-universal.json → cjs/apps/markets/state-machines/index.js} +9 -2
  11. package/dist/cjs/apps/oracles/index.js +2 -5
  12. package/dist/{esm/apps/oracles/state-machines/oracle.json → cjs/apps/oracles/state-machines/index.js} +9 -2
  13. package/dist/cjs/ottochain/index.js +4 -1
  14. package/dist/cjs/ottochain/normalize.js +40 -15
  15. package/dist/cjs/ottochain/types.js +12 -0
  16. package/dist/esm/apps/contracts/index.js +2 -3
  17. package/dist/esm/apps/{governance/state-machines/governance-legislature.json → contracts/state-machines/index.js} +378 -330
  18. package/dist/esm/apps/corporate/index.js +2 -11
  19. package/dist/esm/apps/corporate/state-machines/index.js +10243 -0
  20. package/dist/esm/apps/governance/index.js +2 -10
  21. package/dist/esm/apps/governance/state-machines/index.js +4752 -0
  22. package/dist/esm/apps/identity/index.js +2 -2
  23. package/dist/{cjs/apps/identity/state-machines/agent-identity.json → esm/apps/identity/state-machines/index.js} +6 -2
  24. package/dist/esm/apps/markets/index.js +1 -1
  25. package/dist/{cjs/apps/markets/state-machines/market-universal.json → esm/apps/markets/state-machines/index.js} +6 -2
  26. package/dist/esm/apps/oracles/index.js +1 -1
  27. package/dist/{cjs/apps/oracles/state-machines/oracle.json → esm/apps/oracles/state-machines/index.js} +6 -2
  28. package/dist/esm/ottochain/index.js +2 -0
  29. package/dist/esm/ottochain/normalize.js +40 -15
  30. package/dist/esm/ottochain/types.js +11 -1
  31. package/dist/types/apps/contracts/state-machines/index.d.ts +549 -0
  32. package/dist/types/apps/corporate/state-machines/index.d.ts +9121 -0
  33. package/dist/types/apps/governance/state-machines/index.d.ts +3551 -0
  34. package/dist/types/apps/identity/state-machines/index.d.ts +206 -0
  35. package/dist/types/apps/markets/state-machines/index.d.ts +448 -0
  36. package/dist/types/apps/oracles/state-machines/index.d.ts +312 -0
  37. package/dist/types/ottochain/index.d.ts +2 -1
  38. package/dist/types/ottochain/normalize.d.ts +21 -8
  39. package/dist/types/ottochain/types.d.ts +12 -1
  40. package/package.json +10 -9
  41. package/dist/cjs/apps/contracts/state-machines/contract.json +0 -352
  42. package/dist/cjs/apps/contracts/state-machines/escrow.json +0 -354
  43. package/dist/cjs/apps/corporate/state-machines/corporate-board.json +0 -1064
  44. package/dist/cjs/apps/corporate/state-machines/corporate-bylaws.json +0 -751
  45. package/dist/cjs/apps/corporate/state-machines/corporate-committee.json +0 -957
  46. package/dist/cjs/apps/corporate/state-machines/corporate-compliance.json +0 -1293
  47. package/dist/cjs/apps/corporate/state-machines/corporate-entity.json +0 -861
  48. package/dist/cjs/apps/corporate/state-machines/corporate-officers.json +0 -843
  49. package/dist/cjs/apps/corporate/state-machines/corporate-proxy.json +0 -783
  50. package/dist/cjs/apps/corporate/state-machines/corporate-resolution.json +0 -1174
  51. package/dist/cjs/apps/corporate/state-machines/corporate-securities.json +0 -1215
  52. package/dist/cjs/apps/corporate/state-machines/corporate-shareholders.json +0 -1298
  53. package/dist/cjs/apps/governance/state-machines/dao-multisig.json +0 -667
  54. package/dist/cjs/apps/governance/state-machines/dao-single.json +0 -230
  55. package/dist/cjs/apps/governance/state-machines/dao-threshold.json +0 -624
  56. package/dist/cjs/apps/governance/state-machines/dao-token.json +0 -638
  57. package/dist/cjs/apps/governance/state-machines/governance-constitution.json +0 -357
  58. package/dist/cjs/apps/governance/state-machines/governance-executive.json +0 -387
  59. package/dist/cjs/apps/governance/state-machines/governance-judiciary.json +0 -558
  60. package/dist/cjs/apps/governance/state-machines/governance-simple.json +0 -625
  61. package/dist/esm/apps/contracts/state-machines/contract.json +0 -352
  62. package/dist/esm/apps/contracts/state-machines/escrow.json +0 -354
  63. package/dist/esm/apps/corporate/state-machines/corporate-board.json +0 -1064
  64. package/dist/esm/apps/corporate/state-machines/corporate-bylaws.json +0 -751
  65. package/dist/esm/apps/corporate/state-machines/corporate-committee.json +0 -957
  66. package/dist/esm/apps/corporate/state-machines/corporate-compliance.json +0 -1293
  67. package/dist/esm/apps/corporate/state-machines/corporate-entity.json +0 -861
  68. package/dist/esm/apps/corporate/state-machines/corporate-officers.json +0 -843
  69. package/dist/esm/apps/corporate/state-machines/corporate-proxy.json +0 -783
  70. package/dist/esm/apps/corporate/state-machines/corporate-resolution.json +0 -1174
  71. package/dist/esm/apps/corporate/state-machines/corporate-securities.json +0 -1215
  72. package/dist/esm/apps/corporate/state-machines/corporate-shareholders.json +0 -1298
  73. package/dist/esm/apps/governance/state-machines/dao-multisig.json +0 -667
  74. package/dist/esm/apps/governance/state-machines/dao-single.json +0 -230
  75. package/dist/esm/apps/governance/state-machines/dao-threshold.json +0 -624
  76. package/dist/esm/apps/governance/state-machines/dao-token.json +0 -638
  77. package/dist/esm/apps/governance/state-machines/governance-constitution.json +0 -357
  78. package/dist/esm/apps/governance/state-machines/governance-executive.json +0 -387
  79. package/dist/esm/apps/governance/state-machines/governance-judiciary.json +0 -558
  80. package/dist/esm/apps/governance/state-machines/governance-simple.json +0 -625
@@ -1,1174 +0,0 @@
1
- {
2
- "$schema": "https://ottochain.dev/schemas/state-machine-v1.json",
3
- "name": "corporate-resolution",
4
- "version": "1.0.0",
5
- "category": "corporate-governance",
6
- "description": "Formal corporate resolutions state machine tracking the lifecycle from proposal through approval, execution, and expiration. Supports board resolutions, shareholder resolutions, and written consents.",
7
- "context": {
8
- "resolutionId": {
9
- "type": "string",
10
- "description": "Unique identifier for this resolution"
11
- },
12
- "entityId": {
13
- "type": "string",
14
- "description": "Reference to parent corporate-entity"
15
- },
16
- "resolutionNumber": {
17
- "type": "string",
18
- "description": "Sequential resolution number (e.g., 2024-B-001 for board, 2024-S-001 for shareholder)"
19
- },
20
- "title": {
21
- "type": "string",
22
- "description": "Brief title of the resolution"
23
- },
24
- "resolutionType": {
25
- "type": "string",
26
- "enum": [
27
- "BOARD_RESOLUTION",
28
- "SHAREHOLDER_RESOLUTION",
29
- "BOARD_WRITTEN_CONSENT",
30
- "SHAREHOLDER_WRITTEN_CONSENT",
31
- "UNANIMOUS_WRITTEN_CONSENT"
32
- ],
33
- "description": "Type of resolution"
34
- },
35
- "category": {
36
- "type": "string",
37
- "enum": [
38
- "OFFICER_APPOINTMENT",
39
- "OFFICER_REMOVAL",
40
- "STOCK_ISSUANCE",
41
- "DIVIDEND_DECLARATION",
42
- "CONTRACT_APPROVAL",
43
- "BANKING",
44
- "CHARTER_AMENDMENT",
45
- "BYLAW_AMENDMENT",
46
- "MERGER_ACQUISITION",
47
- "DISSOLUTION",
48
- "COMMITTEE_ACTION",
49
- "COMPENSATION",
50
- "AUDIT",
51
- "GENERAL",
52
- "OTHER"
53
- ],
54
- "description": "Category of action"
55
- },
56
- "proposedDate": {
57
- "type": "string",
58
- "format": "date"
59
- },
60
- "proposedBy": {
61
- "type": "object",
62
- "properties": {
63
- "type": {
64
- "type": "string",
65
- "enum": [
66
- "DIRECTOR",
67
- "OFFICER",
68
- "SHAREHOLDER",
69
- "COMMITTEE"
70
- ]
71
- },
72
- "personId": {
73
- "type": "string"
74
- },
75
- "name": {
76
- "type": "string"
77
- }
78
- }
79
- },
80
- "resolvedText": {
81
- "type": "string",
82
- "description": "Full text of the resolution including WHEREAS and RESOLVED clauses"
83
- },
84
- "whereAsClauses": {
85
- "type": "array",
86
- "items": {
87
- "type": "string"
88
- },
89
- "description": "Background/recital clauses"
90
- },
91
- "resolvedClauses": {
92
- "type": "array",
93
- "items": {
94
- "type": "string"
95
- },
96
- "description": "Operative clauses"
97
- },
98
- "attachments": {
99
- "type": "array",
100
- "items": {
101
- "type": "object",
102
- "properties": {
103
- "attachmentId": {
104
- "type": "string"
105
- },
106
- "title": {
107
- "type": "string"
108
- },
109
- "documentRef": {
110
- "type": "string"
111
- },
112
- "type": {
113
- "type": "string"
114
- }
115
- }
116
- }
117
- },
118
- "approvalRequirements": {
119
- "type": "object",
120
- "properties": {
121
- "approverType": {
122
- "type": "string",
123
- "enum": [
124
- "BOARD",
125
- "SHAREHOLDERS",
126
- "COMMITTEE",
127
- "BOARD_AND_SHAREHOLDERS"
128
- ]
129
- },
130
- "threshold": {
131
- "type": "string",
132
- "enum": [
133
- "MAJORITY_PRESENT",
134
- "MAJORITY_FULL",
135
- "SUPERMAJORITY",
136
- "UNANIMOUS"
137
- ],
138
- "description": "Vote threshold required"
139
- },
140
- "supermajorityPercent": {
141
- "type": "number",
142
- "nullable": true
143
- },
144
- "quorumRequired": {
145
- "type": "boolean",
146
- "default": true
147
- },
148
- "shareholderClassVotes": {
149
- "type": "array",
150
- "items": {
151
- "type": "string"
152
- },
153
- "description": "Share classes that must approve (for class voting)"
154
- }
155
- }
156
- },
157
- "meetingRef": {
158
- "type": "object",
159
- "nullable": true,
160
- "description": "Reference to meeting where resolution was considered",
161
- "properties": {
162
- "meetingType": {
163
- "type": "string",
164
- "enum": [
165
- "BOARD_MEETING",
166
- "SHAREHOLDER_MEETING",
167
- "COMMITTEE_MEETING"
168
- ]
169
- },
170
- "meetingId": {
171
- "type": "string"
172
- },
173
- "meetingDate": {
174
- "type": "string",
175
- "format": "date"
176
- }
177
- }
178
- },
179
- "voting": {
180
- "type": "object",
181
- "properties": {
182
- "votingOpenedAt": {
183
- "type": "string",
184
- "format": "date-time",
185
- "nullable": true
186
- },
187
- "votingClosedAt": {
188
- "type": "string",
189
- "format": "date-time",
190
- "nullable": true
191
- },
192
- "votes": {
193
- "type": "array",
194
- "items": {
195
- "type": "object",
196
- "properties": {
197
- "voterId": {
198
- "type": "string"
199
- },
200
- "voterName": {
201
- "type": "string"
202
- },
203
- "voterType": {
204
- "type": "string",
205
- "enum": [
206
- "DIRECTOR",
207
- "SHAREHOLDER",
208
- "COMMITTEE_MEMBER"
209
- ]
210
- },
211
- "vote": {
212
- "type": "string",
213
- "enum": [
214
- "FOR",
215
- "AGAINST",
216
- "ABSTAIN",
217
- "RECUSE"
218
- ]
219
- },
220
- "votingPower": {
221
- "type": "integer",
222
- "default": 1,
223
- "description": "Number of votes (shares for shareholders)"
224
- },
225
- "timestamp": {
226
- "type": "string",
227
- "format": "date-time"
228
- },
229
- "comment": {
230
- "type": "string",
231
- "nullable": true
232
- }
233
- }
234
- }
235
- },
236
- "tally": {
237
- "type": "object",
238
- "properties": {
239
- "for": {
240
- "type": "integer",
241
- "default": 0
242
- },
243
- "against": {
244
- "type": "integer",
245
- "default": 0
246
- },
247
- "abstain": {
248
- "type": "integer",
249
- "default": 0
250
- },
251
- "recused": {
252
- "type": "integer",
253
- "default": 0
254
- },
255
- "totalEligible": {
256
- "type": "integer"
257
- },
258
- "totalVoted": {
259
- "type": "integer"
260
- }
261
- }
262
- }
263
- }
264
- },
265
- "writtenConsent": {
266
- "type": "object",
267
- "nullable": true,
268
- "description": "For written consent resolutions (no meeting)",
269
- "properties": {
270
- "consentForm": {
271
- "type": "string",
272
- "description": "Document reference"
273
- },
274
- "circulationDate": {
275
- "type": "string",
276
- "format": "date"
277
- },
278
- "consentDeadline": {
279
- "type": "string",
280
- "format": "date"
281
- },
282
- "consents": {
283
- "type": "array",
284
- "items": {
285
- "type": "object",
286
- "properties": {
287
- "consentorId": {
288
- "type": "string"
289
- },
290
- "consentorName": {
291
- "type": "string"
292
- },
293
- "signedDate": {
294
- "type": "string",
295
- "format": "date"
296
- },
297
- "votingPower": {
298
- "type": "integer",
299
- "default": 1
300
- },
301
- "signatureRef": {
302
- "type": "string"
303
- }
304
- }
305
- }
306
- },
307
- "totalConsentPower": {
308
- "type": "integer"
309
- },
310
- "requiredConsentPower": {
311
- "type": "integer"
312
- }
313
- }
314
- },
315
- "approvalDetails": {
316
- "type": "object",
317
- "nullable": true,
318
- "properties": {
319
- "approved": {
320
- "type": "boolean"
321
- },
322
- "approvalDate": {
323
- "type": "string",
324
- "format": "date"
325
- },
326
- "approvalMethod": {
327
- "type": "string",
328
- "enum": [
329
- "MEETING_VOTE",
330
- "WRITTEN_CONSENT"
331
- ]
332
- },
333
- "certifiedBy": {
334
- "type": "string"
335
- },
336
- "certificationDate": {
337
- "type": "string",
338
- "format": "date"
339
- }
340
- }
341
- },
342
- "effectiveDate": {
343
- "type": "string",
344
- "format": "date",
345
- "nullable": true
346
- },
347
- "expirationDate": {
348
- "type": "string",
349
- "format": "date",
350
- "nullable": true,
351
- "description": "For authorizations with time limits"
352
- },
353
- "executionDetails": {
354
- "type": "object",
355
- "nullable": true,
356
- "properties": {
357
- "executedDate": {
358
- "type": "string",
359
- "format": "date"
360
- },
361
- "executedBy": {
362
- "type": "string"
363
- },
364
- "executionNotes": {
365
- "type": "string"
366
- },
367
- "resultingActions": {
368
- "type": "array",
369
- "items": {
370
- "type": "object",
371
- "properties": {
372
- "actionType": {
373
- "type": "string"
374
- },
375
- "reference": {
376
- "type": "string"
377
- },
378
- "completedDate": {
379
- "type": "string",
380
- "format": "date"
381
- }
382
- }
383
- }
384
- }
385
- }
386
- },
387
- "rescissionDetails": {
388
- "type": "object",
389
- "nullable": true,
390
- "properties": {
391
- "rescindedDate": {
392
- "type": "string",
393
- "format": "date"
394
- },
395
- "rescindingResolutionRef": {
396
- "type": "string"
397
- },
398
- "reason": {
399
- "type": "string"
400
- }
401
- }
402
- },
403
- "relatedResolutions": {
404
- "type": "array",
405
- "items": {
406
- "type": "object",
407
- "properties": {
408
- "resolutionId": {
409
- "type": "string"
410
- },
411
- "relationship": {
412
- "type": "string",
413
- "enum": [
414
- "SUPERSEDES",
415
- "SUPERSEDED_BY",
416
- "AMENDS",
417
- "AMENDED_BY",
418
- "DEPENDS_ON",
419
- "ENABLES"
420
- ]
421
- }
422
- }
423
- }
424
- },
425
- "createdAt": {
426
- "type": "string",
427
- "format": "date-time"
428
- },
429
- "updatedAt": {
430
- "type": "string",
431
- "format": "date-time"
432
- }
433
- },
434
- "states": {
435
- "DRAFT": {
436
- "description": "Resolution drafted but not yet formally proposed",
437
- "metadata": null
438
- },
439
- "PROPOSED": {
440
- "description": "Resolution formally proposed and awaiting vote",
441
- "metadata": null
442
- },
443
- "VOTING": {
444
- "description": "Voting or consent collection in progress",
445
- "metadata": null
446
- },
447
- "APPROVED": {
448
- "description": "Resolution approved but not yet executed/effective",
449
- "metadata": null
450
- },
451
- "EXECUTED": {
452
- "description": "Resolution has been carried out; authorized actions completed",
453
- "metadata": null
454
- },
455
- "REJECTED": {
456
- "description": "Resolution failed to obtain required approval",
457
- "metadata": null,
458
- "terminal": true
459
- },
460
- "EXPIRED": {
461
- "description": "Resolution expired without execution",
462
- "metadata": null,
463
- "terminal": true
464
- },
465
- "RESCINDED": {
466
- "description": "Resolution was rescinded by subsequent action",
467
- "metadata": null,
468
- "terminal": true
469
- }
470
- },
471
- "initialState": "DRAFT",
472
- "transitions": {
473
- "draft_resolution": {
474
- "from": null,
475
- "to": "DRAFT",
476
- "description": "Create a new draft resolution",
477
- "event": {
478
- "name": "draft_resolution",
479
- "payload": {
480
- "resolutionId": {
481
- "type": "string",
482
- "required": true
483
- },
484
- "entityId": {
485
- "type": "string",
486
- "required": true
487
- },
488
- "title": {
489
- "type": "string",
490
- "required": true
491
- },
492
- "resolutionType": {
493
- "type": "string",
494
- "required": true
495
- },
496
- "category": {
497
- "type": "string",
498
- "required": true
499
- },
500
- "whereAsClauses": {
501
- "type": "array"
502
- },
503
- "resolvedClauses": {
504
- "type": "array",
505
- "required": true
506
- },
507
- "approvalRequirements": {
508
- "type": "object",
509
- "required": true
510
- }
511
- }
512
- },
513
- "effects": [
514
- {
515
- "type": "SET_CONTEXT",
516
- "path": "resolutionId",
517
- "value": "{{ event.resolutionId }}"
518
- },
519
- {
520
- "type": "SET_CONTEXT",
521
- "path": "entityId",
522
- "value": "{{ event.entityId }}"
523
- },
524
- {
525
- "type": "SET_CONTEXT",
526
- "path": "title",
527
- "value": "{{ event.title }}"
528
- },
529
- {
530
- "type": "SET_CONTEXT",
531
- "path": "resolutionType",
532
- "value": "{{ event.resolutionType }}"
533
- },
534
- {
535
- "type": "SET_CONTEXT",
536
- "path": "category",
537
- "value": "{{ event.category }}"
538
- },
539
- {
540
- "type": "SET_CONTEXT",
541
- "path": "whereAsClauses",
542
- "value": "{{ event.whereAsClauses }}"
543
- },
544
- {
545
- "type": "SET_CONTEXT",
546
- "path": "resolvedClauses",
547
- "value": "{{ event.resolvedClauses }}"
548
- },
549
- {
550
- "type": "SET_CONTEXT",
551
- "path": "approvalRequirements",
552
- "value": "{{ event.approvalRequirements }}"
553
- },
554
- {
555
- "type": "SET_CONTEXT",
556
- "path": "voting.votes",
557
- "value": []
558
- },
559
- {
560
- "type": "SET_CONTEXT",
561
- "path": "voting.tally",
562
- "value": {
563
- "for": 0,
564
- "against": 0,
565
- "abstain": 0,
566
- "recused": 0,
567
- "totalVoted": 0
568
- }
569
- }
570
- ]
571
- },
572
- "propose": {
573
- "from": "DRAFT",
574
- "to": "PROPOSED",
575
- "description": "Formally propose the resolution for consideration",
576
- "event": {
577
- "name": "propose",
578
- "payload": {
579
- "proposedBy": {
580
- "type": "object",
581
- "required": true
582
- },
583
- "meetingRef": {
584
- "type": "object",
585
- "description": "If proposing for a specific meeting"
586
- },
587
- "resolutionNumber": {
588
- "type": "string",
589
- "required": true
590
- }
591
- }
592
- },
593
- "effects": [
594
- {
595
- "type": "SET_CONTEXT",
596
- "path": "proposedDate",
597
- "value": "{{ today() }}"
598
- },
599
- {
600
- "type": "SET_CONTEXT",
601
- "path": "proposedBy",
602
- "value": "{{ event.proposedBy }}"
603
- },
604
- {
605
- "type": "SET_CONTEXT",
606
- "path": "meetingRef",
607
- "value": "{{ event.meetingRef }}"
608
- },
609
- {
610
- "type": "SET_CONTEXT",
611
- "path": "resolutionNumber",
612
- "value": "{{ event.resolutionNumber }}"
613
- },
614
- {
615
- "type": "EMIT_EVENT",
616
- "eventType": "RESOLUTION_PROPOSED",
617
- "payload": {
618
- "resolutionId": "{{ context.resolutionId }}",
619
- "title": "{{ context.title }}",
620
- "type": "{{ context.resolutionType }}"
621
- }
622
- }
623
- ]
624
- },
625
- "open_voting": {
626
- "from": "PROPOSED",
627
- "to": "VOTING",
628
- "description": "Open voting on the resolution (at meeting or via written consent)",
629
- "event": {
630
- "name": "open_voting",
631
- "payload": {
632
- "votingOpenedAt": {
633
- "type": "string",
634
- "format": "date-time",
635
- "required": true
636
- },
637
- "totalEligibleVoters": {
638
- "type": "integer",
639
- "required": true
640
- },
641
- "isWrittenConsent": {
642
- "type": "boolean",
643
- "default": false
644
- },
645
- "consentDeadline": {
646
- "type": "string",
647
- "format": "date"
648
- }
649
- }
650
- },
651
- "guards": [
652
- {
653
- "name": "meetingHasQuorumIfRequired",
654
- "description": "If board/shareholder vote at meeting, meeting must have quorum",
655
- "expression": "!event.isWrittenConsent || !context.approvalRequirements.quorumRequired"
656
- }
657
- ],
658
- "effects": [
659
- {
660
- "type": "SET_CONTEXT",
661
- "path": "voting.votingOpenedAt",
662
- "value": "{{ event.votingOpenedAt }}"
663
- },
664
- {
665
- "type": "SET_CONTEXT",
666
- "path": "voting.tally.totalEligible",
667
- "value": "{{ event.totalEligibleVoters }}"
668
- },
669
- {
670
- "type": "CONDITIONAL",
671
- "condition": "event.isWrittenConsent",
672
- "then": {
673
- "type": "SET_CONTEXT",
674
- "path": "writtenConsent",
675
- "value": {
676
- "circulationDate": "{{ today() }}",
677
- "consentDeadline": "{{ event.consentDeadline }}",
678
- "consents": [],
679
- "totalConsentPower": 0
680
- }
681
- }
682
- }
683
- ]
684
- },
685
- "record_vote": {
686
- "from": "VOTING",
687
- "to": "VOTING",
688
- "description": "Record an individual vote on the resolution",
689
- "event": {
690
- "name": "record_vote",
691
- "payload": {
692
- "voterId": {
693
- "type": "string",
694
- "required": true
695
- },
696
- "voterName": {
697
- "type": "string",
698
- "required": true
699
- },
700
- "voterType": {
701
- "type": "string",
702
- "required": true
703
- },
704
- "vote": {
705
- "type": "string",
706
- "enum": [
707
- "FOR",
708
- "AGAINST",
709
- "ABSTAIN",
710
- "RECUSE"
711
- ],
712
- "required": true
713
- },
714
- "votingPower": {
715
- "type": "integer",
716
- "default": 1
717
- },
718
- "comment": {
719
- "type": "string"
720
- }
721
- }
722
- },
723
- "guards": [
724
- {
725
- "name": "hasNotAlreadyVoted",
726
- "expression": "!context.voting.votes.some(v => v.voterId === event.voterId)"
727
- }
728
- ],
729
- "effects": [
730
- {
731
- "type": "APPEND_ARRAY",
732
- "path": "voting.votes",
733
- "value": {
734
- "voterId": "{{ event.voterId }}",
735
- "voterName": "{{ event.voterName }}",
736
- "voterType": "{{ event.voterType }}",
737
- "vote": "{{ event.vote }}",
738
- "votingPower": "{{ event.votingPower }}",
739
- "timestamp": "{{ now() }}",
740
- "comment": "{{ event.comment }}"
741
- }
742
- },
743
- {
744
- "type": "CONDITIONAL",
745
- "condition": "event.vote === 'FOR'",
746
- "then": {
747
- "type": "INCREMENT",
748
- "path": "voting.tally.for",
749
- "amount": "{{ event.votingPower }}"
750
- }
751
- },
752
- {
753
- "type": "CONDITIONAL",
754
- "condition": "event.vote === 'AGAINST'",
755
- "then": {
756
- "type": "INCREMENT",
757
- "path": "voting.tally.against",
758
- "amount": "{{ event.votingPower }}"
759
- }
760
- },
761
- {
762
- "type": "CONDITIONAL",
763
- "condition": "event.vote === 'ABSTAIN'",
764
- "then": {
765
- "type": "INCREMENT",
766
- "path": "voting.tally.abstain",
767
- "amount": "{{ event.votingPower }}"
768
- }
769
- },
770
- {
771
- "type": "CONDITIONAL",
772
- "condition": "event.vote === 'RECUSE'",
773
- "then": {
774
- "type": "INCREMENT",
775
- "path": "voting.tally.recused",
776
- "amount": "{{ event.votingPower }}"
777
- }
778
- },
779
- {
780
- "type": "INCREMENT",
781
- "path": "voting.tally.totalVoted",
782
- "amount": "{{ event.votingPower }}"
783
- }
784
- ]
785
- },
786
- "record_consent": {
787
- "from": "VOTING",
788
- "to": "VOTING",
789
- "description": "Record a written consent signature",
790
- "event": {
791
- "name": "record_consent",
792
- "payload": {
793
- "consentorId": {
794
- "type": "string",
795
- "required": true
796
- },
797
- "consentorName": {
798
- "type": "string",
799
- "required": true
800
- },
801
- "signedDate": {
802
- "type": "string",
803
- "format": "date",
804
- "required": true
805
- },
806
- "votingPower": {
807
- "type": "integer",
808
- "default": 1
809
- },
810
- "signatureRef": {
811
- "type": "string"
812
- }
813
- }
814
- },
815
- "guards": [
816
- {
817
- "name": "isWrittenConsentResolution",
818
- "expression": "context.writtenConsent != null"
819
- },
820
- {
821
- "name": "hasNotAlreadyConsented",
822
- "expression": "!context.writtenConsent.consents.some(c => c.consentorId === event.consentorId)"
823
- }
824
- ],
825
- "effects": [
826
- {
827
- "type": "APPEND_ARRAY",
828
- "path": "writtenConsent.consents",
829
- "value": {
830
- "consentorId": "{{ event.consentorId }}",
831
- "consentorName": "{{ event.consentorName }}",
832
- "signedDate": "{{ event.signedDate }}",
833
- "votingPower": "{{ event.votingPower }}",
834
- "signatureRef": "{{ event.signatureRef }}"
835
- }
836
- },
837
- {
838
- "type": "INCREMENT",
839
- "path": "writtenConsent.totalConsentPower",
840
- "amount": "{{ event.votingPower }}"
841
- }
842
- ]
843
- },
844
- "close_voting_approved": {
845
- "from": "VOTING",
846
- "to": "APPROVED",
847
- "description": "Close voting - resolution passes",
848
- "event": {
849
- "name": "close_voting_approved",
850
- "payload": {
851
- "votingClosedAt": {
852
- "type": "string",
853
- "format": "date-time",
854
- "required": true
855
- },
856
- "certifiedBy": {
857
- "type": "string",
858
- "required": true
859
- },
860
- "effectiveDate": {
861
- "type": "string",
862
- "format": "date"
863
- },
864
- "expirationDate": {
865
- "type": "string",
866
- "format": "date"
867
- }
868
- }
869
- },
870
- "guards": [
871
- {
872
- "name": "meetsApprovalThreshold",
873
- "description": "Vote tally meets required threshold",
874
- "expression": "context.voting.tally.for > context.voting.tally.against"
875
- }
876
- ],
877
- "effects": [
878
- {
879
- "type": "SET_CONTEXT",
880
- "path": "voting.votingClosedAt",
881
- "value": "{{ event.votingClosedAt }}"
882
- },
883
- {
884
- "type": "SET_CONTEXT",
885
- "path": "approvalDetails",
886
- "value": {
887
- "approved": true,
888
- "approvalDate": "{{ today() }}",
889
- "approvalMethod": "{{ context.writtenConsent ? 'WRITTEN_CONSENT' : 'MEETING_VOTE' }}",
890
- "certifiedBy": "{{ event.certifiedBy }}",
891
- "certificationDate": "{{ today() }}"
892
- }
893
- },
894
- {
895
- "type": "SET_CONTEXT",
896
- "path": "effectiveDate",
897
- "value": "{{ event.effectiveDate || today() }}"
898
- },
899
- {
900
- "type": "SET_CONTEXT",
901
- "path": "expirationDate",
902
- "value": "{{ event.expirationDate }}"
903
- },
904
- {
905
- "type": "EMIT_EVENT",
906
- "eventType": "RESOLUTION_APPROVED",
907
- "payload": {
908
- "resolutionId": "{{ context.resolutionId }}",
909
- "title": "{{ context.title }}",
910
- "votesFor": "{{ context.voting.tally.for }}",
911
- "votesAgainst": "{{ context.voting.tally.against }}"
912
- }
913
- }
914
- ]
915
- },
916
- "close_voting_rejected": {
917
- "from": "VOTING",
918
- "to": "REJECTED",
919
- "description": "Close voting - resolution fails",
920
- "event": {
921
- "name": "close_voting_rejected",
922
- "payload": {
923
- "votingClosedAt": {
924
- "type": "string",
925
- "format": "date-time",
926
- "required": true
927
- },
928
- "certifiedBy": {
929
- "type": "string",
930
- "required": true
931
- }
932
- }
933
- },
934
- "effects": [
935
- {
936
- "type": "SET_CONTEXT",
937
- "path": "voting.votingClosedAt",
938
- "value": "{{ event.votingClosedAt }}"
939
- },
940
- {
941
- "type": "SET_CONTEXT",
942
- "path": "approvalDetails",
943
- "value": {
944
- "approved": false,
945
- "approvalDate": "{{ today() }}",
946
- "approvalMethod": "{{ context.writtenConsent ? 'WRITTEN_CONSENT' : 'MEETING_VOTE' }}",
947
- "certifiedBy": "{{ event.certifiedBy }}",
948
- "certificationDate": "{{ today() }}"
949
- }
950
- },
951
- {
952
- "type": "EMIT_EVENT",
953
- "eventType": "RESOLUTION_REJECTED",
954
- "payload": {
955
- "resolutionId": "{{ context.resolutionId }}",
956
- "title": "{{ context.title }}"
957
- }
958
- }
959
- ]
960
- },
961
- "execute": {
962
- "from": "APPROVED",
963
- "to": "EXECUTED",
964
- "description": "Execute the resolution - carry out authorized actions",
965
- "event": {
966
- "name": "execute",
967
- "payload": {
968
- "executedBy": {
969
- "type": "string",
970
- "required": true
971
- },
972
- "executionNotes": {
973
- "type": "string"
974
- },
975
- "resultingActions": {
976
- "type": "array"
977
- }
978
- }
979
- },
980
- "guards": [
981
- {
982
- "name": "effectiveDateReached",
983
- "description": "Cannot execute before effective date",
984
- "expression": "new Date() >= new Date(context.effectiveDate)"
985
- },
986
- {
987
- "name": "notExpired",
988
- "description": "Cannot execute after expiration",
989
- "expression": "context.expirationDate == null || new Date() <= new Date(context.expirationDate)"
990
- }
991
- ],
992
- "effects": [
993
- {
994
- "type": "SET_CONTEXT",
995
- "path": "executionDetails",
996
- "value": {
997
- "executedDate": "{{ today() }}",
998
- "executedBy": "{{ event.executedBy }}",
999
- "executionNotes": "{{ event.executionNotes }}",
1000
- "resultingActions": "{{ event.resultingActions }}"
1001
- }
1002
- },
1003
- {
1004
- "type": "EMIT_EVENT",
1005
- "eventType": "RESOLUTION_EXECUTED",
1006
- "payload": {
1007
- "resolutionId": "{{ context.resolutionId }}",
1008
- "title": "{{ context.title }}",
1009
- "category": "{{ context.category }}"
1010
- }
1011
- }
1012
- ]
1013
- },
1014
- "expire": {
1015
- "from": "APPROVED",
1016
- "to": "EXPIRED",
1017
- "description": "Resolution expires without being executed",
1018
- "event": {
1019
- "name": "expire",
1020
- "payload": {
1021
- "expiredDate": {
1022
- "type": "string",
1023
- "format": "date",
1024
- "required": true
1025
- }
1026
- }
1027
- },
1028
- "guards": [
1029
- {
1030
- "name": "hasExpirationDate",
1031
- "expression": "context.expirationDate != null"
1032
- },
1033
- {
1034
- "name": "isPastExpiration",
1035
- "expression": "new Date(event.expiredDate) >= new Date(context.expirationDate)"
1036
- }
1037
- ],
1038
- "effects": [
1039
- {
1040
- "type": "EMIT_EVENT",
1041
- "eventType": "RESOLUTION_EXPIRED",
1042
- "payload": {
1043
- "resolutionId": "{{ context.resolutionId }}",
1044
- "title": "{{ context.title }}"
1045
- }
1046
- }
1047
- ]
1048
- },
1049
- "rescind": {
1050
- "from": [
1051
- "APPROVED",
1052
- "EXECUTED"
1053
- ],
1054
- "to": "RESCINDED",
1055
- "description": "Rescind the resolution by subsequent formal action",
1056
- "event": {
1057
- "name": "rescind",
1058
- "payload": {
1059
- "rescindingResolutionRef": {
1060
- "type": "string",
1061
- "required": true
1062
- },
1063
- "reason": {
1064
- "type": "string",
1065
- "required": true
1066
- },
1067
- "rescindedDate": {
1068
- "type": "string",
1069
- "format": "date",
1070
- "required": true
1071
- }
1072
- }
1073
- },
1074
- "guards": [
1075
- {
1076
- "name": "hasRescindingResolution",
1077
- "description": "Must have a subsequent resolution authorizing rescission",
1078
- "crossMachine": {
1079
- "machine": "corporate-resolution",
1080
- "instanceRef": "{{ event.rescindingResolutionRef }}",
1081
- "requiredState": "APPROVED"
1082
- }
1083
- }
1084
- ],
1085
- "effects": [
1086
- {
1087
- "type": "SET_CONTEXT",
1088
- "path": "rescissionDetails",
1089
- "value": {
1090
- "rescindedDate": "{{ event.rescindedDate }}",
1091
- "rescindingResolutionRef": "{{ event.rescindingResolutionRef }}",
1092
- "reason": "{{ event.reason }}"
1093
- }
1094
- },
1095
- {
1096
- "type": "APPEND_ARRAY",
1097
- "path": "relatedResolutions",
1098
- "value": {
1099
- "resolutionId": "{{ event.rescindingResolutionRef }}",
1100
- "relationship": "SUPERSEDED_BY"
1101
- }
1102
- },
1103
- {
1104
- "type": "EMIT_EVENT",
1105
- "eventType": "RESOLUTION_RESCINDED",
1106
- "payload": {
1107
- "resolutionId": "{{ context.resolutionId }}",
1108
- "rescindedBy": "{{ event.rescindingResolutionRef }}"
1109
- }
1110
- }
1111
- ]
1112
- },
1113
- "withdraw": {
1114
- "from": [
1115
- "DRAFT",
1116
- "PROPOSED"
1117
- ],
1118
- "to": "REJECTED",
1119
- "description": "Withdraw the resolution before voting",
1120
- "event": {
1121
- "name": "withdraw",
1122
- "payload": {
1123
- "withdrawnBy": {
1124
- "type": "string",
1125
- "required": true
1126
- },
1127
- "reason": {
1128
- "type": "string"
1129
- }
1130
- }
1131
- },
1132
- "effects": [
1133
- {
1134
- "type": "EMIT_EVENT",
1135
- "eventType": "RESOLUTION_WITHDRAWN",
1136
- "payload": {
1137
- "resolutionId": "{{ context.resolutionId }}",
1138
- "withdrawnBy": "{{ event.withdrawnBy }}"
1139
- }
1140
- }
1141
- ]
1142
- }
1143
- },
1144
- "crossMachineRefs": {
1145
- "entity": {
1146
- "machine": "corporate-entity",
1147
- "description": "Parent corporate entity",
1148
- "foreignKey": "entityId"
1149
- },
1150
- "board": {
1151
- "machine": "corporate-board",
1152
- "description": "Board for board resolutions",
1153
- "foreignKey": "entityId"
1154
- },
1155
- "shareholders": {
1156
- "machine": "corporate-shareholders",
1157
- "description": "Shareholder meeting for shareholder resolutions",
1158
- "foreignKey": "meetingRef.meetingId"
1159
- }
1160
- },
1161
- "metadata": {
1162
- "author": "OttoChain",
1163
- "license": "MIT",
1164
- "tags": [
1165
- "corporate",
1166
- "governance",
1167
- "resolution",
1168
- "voting",
1169
- "board",
1170
- "shareholders"
1171
- ],
1172
- "documentation": "https://ottochain.dev/docs/corporate/resolution"
1173
- }
1174
- }