@ottochain/sdk 2.0.0 → 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 (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 +55 -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 +47 -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 +139 -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
@@ -1,4442 +1,18 @@
1
1
  /**
2
- * Auto-generated from JSON state machine definitions.
3
- * DO NOT EDIT - regenerate with: npm run prebuild
2
+ * Corporate Governance State Machines
3
+ *
4
+ * TypeScript definitions using defineFiberApp() pattern.
5
+ * Converted from JSON state machine definitions.
4
6
  */
5
- export const corpBoardDef = {
6
- "$schema": "https://ottochain.dev/schemas/state-machine-v1.json",
7
- "name": "CorpBoard",
8
- "version": "1.0.0",
9
- "category": "corporate-governance",
10
- "description": "Board of directors state machine managing director seats, meetings, quorum, and formal board actions. Supports staggered boards with classified directors.",
11
- "context": {
12
- "boardId": {
13
- "type": "string",
14
- "description": "Unique identifier for this board instance"
15
- },
16
- "entityId": {
17
- "type": "string",
18
- "description": "Reference to parent corporate-entity"
19
- },
20
- "directors": {
21
- "type": "array",
22
- "items": {
23
- "type": "object",
24
- "properties": {
25
- "directorId": {
26
- "type": "string"
27
- },
28
- "name": {
29
- "type": "string"
30
- },
31
- "email": {
32
- "type": "string"
33
- },
34
- "termStart": {
35
- "type": "string",
36
- "format": "date"
37
- },
38
- "termEnd": {
39
- "type": "string",
40
- "format": "date"
41
- },
42
- "class": {
43
- "type": "string",
44
- "enum": [
45
- "CLASS_I",
46
- "CLASS_II",
47
- "CLASS_III",
48
- "UNCLASSIFIED"
49
- ],
50
- "description": "For staggered boards"
51
- },
52
- "status": {
53
- "type": "string",
54
- "enum": [
55
- "ACTIVE",
56
- "RESIGNED",
57
- "REMOVED",
58
- "TERM_EXPIRED"
59
- ]
60
- },
61
- "isIndependent": {
62
- "type": "boolean",
63
- "description": "Independence under applicable rules"
64
- },
65
- "isChair": {
66
- "type": "boolean",
67
- "default": false
68
- },
69
- "isLeadIndependent": {
70
- "type": "boolean",
71
- "default": false
72
- },
73
- "committees": {
74
- "type": "array",
75
- "items": {
76
- "type": "string"
77
- },
78
- "description": "Committee memberships by committee ID"
79
- },
80
- "electedBy": {
81
- "type": "string",
82
- "description": "Resolution reference for election"
83
- },
84
- "compensationAgreementRef": {
85
- "type": "string",
86
- "nullable": true
87
- }
88
- }
89
- }
90
- },
91
- "seats": {
92
- "type": "object",
93
- "properties": {
94
- "authorized": {
95
- "type": "integer",
96
- "description": "Number of board seats authorized by bylaws"
97
- },
98
- "filled": {
99
- "type": "integer"
100
- },
101
- "vacant": {
102
- "type": "integer"
103
- }
104
- }
105
- },
106
- "boardStructure": {
107
- "type": "object",
108
- "properties": {
109
- "isClassified": {
110
- "type": "boolean",
111
- "description": "Whether board has staggered terms"
112
- },
113
- "termYears": {
114
- "type": "integer",
115
- "default": 1,
116
- "description": "Director term length"
117
- },
118
- "classTerms": {
119
- "type": "object",
120
- "properties": {
121
- "CLASS_I": {
122
- "type": "integer"
123
- },
124
- "CLASS_II": {
125
- "type": "integer"
126
- },
127
- "CLASS_III": {
128
- "type": "integer"
129
- }
130
- }
131
- }
132
- }
133
- },
134
- "quorumRules": {
135
- "type": "object",
136
- "properties": {
137
- "type": {
138
- "type": "string",
139
- "enum": [
140
- "MAJORITY",
141
- "SUPERMAJORITY",
142
- "FIXED_NUMBER"
143
- ],
144
- "default": "MAJORITY"
145
- },
146
- "threshold": {
147
- "type": "number",
148
- "description": "Fraction for majority/super, or count for fixed"
149
- },
150
- "minimumRequired": {
151
- "type": "integer",
152
- "description": "Absolute minimum regardless of formula"
153
- }
154
- }
155
- },
156
- "votingRules": {
157
- "type": "object",
158
- "properties": {
159
- "standardApproval": {
160
- "type": "string",
161
- "enum": [
162
- "MAJORITY_PRESENT",
163
- "MAJORITY_FULL_BOARD"
164
- ],
165
- "default": "MAJORITY_PRESENT"
166
- },
167
- "supermajorityMatters": {
168
- "type": "array",
169
- "items": {
170
- "type": "string"
171
- },
172
- "description": "Action types requiring supermajority"
173
- },
174
- "supermajorityThreshold": {
175
- "type": "number",
176
- "default": 0.6667
177
- }
178
- }
179
- },
180
- "currentMeeting": {
181
- "type": "object",
182
- "nullable": true,
183
- "properties": {
184
- "meetingId": {
185
- "type": "string"
186
- },
187
- "type": {
188
- "type": "string",
189
- "enum": [
190
- "REGULAR",
191
- "SPECIAL",
192
- "ANNUAL",
193
- "ORGANIZATIONAL"
194
- ]
195
- },
196
- "scheduledDate": {
197
- "type": "string",
198
- "format": "date-time"
199
- },
200
- "location": {
201
- "type": "string"
202
- },
203
- "isVirtual": {
204
- "type": "boolean"
205
- },
206
- "calledBy": {
207
- "type": "string"
208
- },
209
- "noticeDate": {
210
- "type": "string",
211
- "format": "date"
212
- },
213
- "agenda": {
214
- "type": "array",
215
- "items": {
216
- "type": "string"
217
- }
218
- },
219
- "attendees": {
220
- "type": "array",
221
- "items": {
222
- "type": "object",
223
- "properties": {
224
- "directorId": {
225
- "type": "string"
226
- },
227
- "present": {
228
- "type": "boolean"
229
- },
230
- "arrivedAt": {
231
- "type": "string",
232
- "format": "date-time",
233
- "nullable": true
234
- },
235
- "departedAt": {
236
- "type": "string",
237
- "format": "date-time",
238
- "nullable": true
239
- },
240
- "viaProxy": {
241
- "type": "boolean",
242
- "default": false
243
- }
244
- }
245
- }
246
- },
247
- "quorumPresent": {
248
- "type": "boolean"
249
- },
250
- "quorumCount": {
251
- "type": "integer"
252
- },
253
- "openedAt": {
254
- "type": "string",
255
- "format": "date-time",
256
- "nullable": true
257
- },
258
- "closedAt": {
259
- "type": "string",
260
- "format": "date-time",
261
- "nullable": true
262
- },
263
- "minutesRef": {
264
- "type": "string",
265
- "nullable": true
266
- }
267
- }
268
- },
269
- "meetingHistory": {
270
- "type": "array",
271
- "items": {
272
- "type": "object",
273
- "properties": {
274
- "meetingId": {
275
- "type": "string"
276
- },
277
- "type": {
278
- "type": "string"
279
- },
280
- "date": {
281
- "type": "string",
282
- "format": "date"
283
- },
284
- "quorumAchieved": {
285
- "type": "boolean"
286
- },
287
- "attendeeCount": {
288
- "type": "integer"
289
- },
290
- "resolutionsPassed": {
291
- "type": "array",
292
- "items": {
293
- "type": "string"
294
- }
295
- },
296
- "minutesRef": {
297
- "type": "string"
298
- }
299
- }
300
- }
301
- },
302
- "createdAt": {
303
- "type": "string",
304
- "format": "date-time"
305
- },
306
- "updatedAt": {
307
- "type": "string",
308
- "format": "date-time"
309
- }
310
- },
311
- "states": {
312
- "ACTIVE": {
313
- "description": "Board is constituted and able to conduct business. Default state between meetings.",
314
- "metadata": null
315
- },
316
- "IN_MEETING": {
317
- "description": "Board meeting is in session with quorum present. Can take formal actions.",
318
- "metadata": null
319
- },
320
- "QUORUM_LOST": {
321
- "description": "Meeting in progress but quorum lost due to departures. No further action until quorum restored or adjourned.",
322
- "metadata": null
323
- }
324
- },
325
- "initialState": "ACTIVE",
326
- "transitions": {
327
- "elect_director": {
328
- "from": "ACTIVE",
329
- "to": "ACTIVE",
330
- "description": "Add a new director to the board (election typically done at shareholder meeting or by board to fill vacancy)",
331
- "event": {
332
- "name": "elect_director",
333
- "payload": {
334
- "directorId": {
335
- "type": "string",
336
- "required": true
337
- },
338
- "name": {
339
- "type": "string",
340
- "required": true
341
- },
342
- "email": {
343
- "type": "string"
344
- },
345
- "termStart": {
346
- "type": "string",
347
- "format": "date",
348
- "required": true
349
- },
350
- "termEnd": {
351
- "type": "string",
352
- "format": "date",
353
- "required": true
354
- },
355
- "class": {
356
- "type": "string",
357
- "enum": [
358
- "CLASS_I",
359
- "CLASS_II",
360
- "CLASS_III",
361
- "UNCLASSIFIED"
362
- ]
363
- },
364
- "isIndependent": {
365
- "type": "boolean",
366
- "required": true
367
- },
368
- "electionResolutionRef": {
369
- "type": "string",
370
- "required": true,
371
- "description": "Shareholder or board resolution"
372
- },
373
- "isFillingVacancy": {
374
- "type": "boolean",
375
- "default": false
376
- }
377
- }
378
- },
379
- "guards": [
380
- {
381
- "name": "hasAvailableSeat",
382
- "description": "Must have vacant seat or be filling expired term",
383
- "expression": "context.seats.vacant > 0 || event.isFillingVacancy"
384
- },
385
- {
386
- "name": "hasElectionResolution",
387
- "description": "Must have valid election resolution (shareholder for annual, board for vacancy fill)",
388
- "expression": "event.electionResolutionRef != null"
389
- },
390
- {
391
- "name": "notAlreadyDirector",
392
- "description": "Person not already serving on board",
393
- "expression": "!context.directors.some(d => d.directorId === event.directorId && d.status === 'ACTIVE')"
394
- }
395
- ],
396
- "effects": [
397
- {
398
- "type": "APPEND_ARRAY",
399
- "path": "directors",
400
- "value": {
401
- "directorId": "{{ event.directorId }}",
402
- "name": "{{ event.name }}",
403
- "email": "{{ event.email }}",
404
- "termStart": "{{ event.termStart }}",
405
- "termEnd": "{{ event.termEnd }}",
406
- "class": "{{ event.class }}",
407
- "status": "ACTIVE",
408
- "isIndependent": "{{ event.isIndependent }}",
409
- "isChair": false,
410
- "isLeadIndependent": false,
411
- "committees": [],
412
- "electedBy": "{{ event.electionResolutionRef }}"
413
- }
414
- },
415
- {
416
- "type": "INCREMENT",
417
- "path": "seats.filled",
418
- "amount": 1
419
- },
420
- {
421
- "type": "DECREMENT",
422
- "path": "seats.vacant",
423
- "amount": 1
424
- },
425
- {
426
- "type": "EMIT_EVENT",
427
- "eventType": "DIRECTOR_ELECTED",
428
- "payload": {
429
- "boardId": "{{ context.boardId }}",
430
- "directorId": "{{ event.directorId }}",
431
- "name": "{{ event.name }}",
432
- "termEnd": "{{ event.termEnd }}"
433
- }
434
- }
435
- ]
436
- },
437
- "resign_director": {
438
- "from": [
439
- "ACTIVE",
440
- "IN_MEETING"
441
- ],
442
- "to": "ACTIVE",
443
- "description": "Director resigns from the board",
444
- "event": {
445
- "name": "resign_director",
446
- "payload": {
447
- "directorId": {
448
- "type": "string",
449
- "required": true
450
- },
451
- "effectiveDate": {
452
- "type": "string",
453
- "format": "date",
454
- "required": true
455
- },
456
- "reason": {
457
- "type": "string"
458
- },
459
- "resignationLetter": {
460
- "type": "string",
461
- "description": "Document reference"
462
- }
463
- }
464
- },
465
- "guards": [
466
- {
467
- "name": "isActiveDirector",
468
- "expression": "context.directors.some(d => d.directorId === event.directorId && d.status === 'ACTIVE')"
469
- }
470
- ],
471
- "effects": [
472
- {
473
- "type": "UPDATE_ARRAY_ITEM",
474
- "path": "directors",
475
- "matchKey": "directorId",
476
- "matchValue": "{{ event.directorId }}",
477
- "updates": {
478
- "status": "RESIGNED",
479
- "termEnd": "{{ event.effectiveDate }}"
480
- }
481
- },
482
- {
483
- "type": "DECREMENT",
484
- "path": "seats.filled",
485
- "amount": 1
486
- },
487
- {
488
- "type": "INCREMENT",
489
- "path": "seats.vacant",
490
- "amount": 1
491
- },
492
- {
493
- "type": "EMIT_EVENT",
494
- "eventType": "DIRECTOR_RESIGNED",
495
- "payload": {
496
- "boardId": "{{ context.boardId }}",
497
- "directorId": "{{ event.directorId }}",
498
- "effectiveDate": "{{ event.effectiveDate }}"
499
- }
500
- }
501
- ]
502
- },
503
- "remove_for_cause": {
504
- "from": "ACTIVE",
505
- "to": "ACTIVE",
506
- "description": "Remove a director for cause (requires board or shareholder action depending on bylaws)",
507
- "event": {
508
- "name": "remove_for_cause",
509
- "payload": {
510
- "directorId": {
511
- "type": "string",
512
- "required": true
513
- },
514
- "cause": {
515
- "type": "string",
516
- "required": true
517
- },
518
- "removalResolutionRef": {
519
- "type": "string",
520
- "required": true
521
- },
522
- "effectiveDate": {
523
- "type": "string",
524
- "format": "date",
525
- "required": true
526
- }
527
- }
528
- },
529
- "guards": [
530
- {
531
- "name": "isActiveDirector",
532
- "expression": "context.directors.some(d => d.directorId === event.directorId && d.status === 'ACTIVE')"
533
- },
534
- {
535
- "name": "hasRemovalResolution",
536
- "crossMachine": {
537
- "machine": "corporate-resolution",
538
- "instanceRef": "{{ event.removalResolutionRef }}",
539
- "requiredState": "EXECUTED"
540
- }
541
- }
542
- ],
543
- "effects": [
544
- {
545
- "type": "UPDATE_ARRAY_ITEM",
546
- "path": "directors",
547
- "matchKey": "directorId",
548
- "matchValue": "{{ event.directorId }}",
549
- "updates": {
550
- "status": "REMOVED",
551
- "termEnd": "{{ event.effectiveDate }}"
552
- }
553
- },
554
- {
555
- "type": "DECREMENT",
556
- "path": "seats.filled",
557
- "amount": 1
558
- },
559
- {
560
- "type": "INCREMENT",
561
- "path": "seats.vacant",
562
- "amount": 1
563
- },
564
- {
565
- "type": "EMIT_EVENT",
566
- "eventType": "DIRECTOR_REMOVED",
567
- "payload": {
568
- "boardId": "{{ context.boardId }}",
569
- "directorId": "{{ event.directorId }}",
570
- "cause": "{{ event.cause }}"
571
- }
572
- }
573
- ]
574
- },
575
- "designate_chair": {
576
- "from": "ACTIVE",
577
- "to": "ACTIVE",
578
- "description": "Designate a director as board chair",
579
- "event": {
580
- "name": "designate_chair",
581
- "payload": {
582
- "directorId": {
583
- "type": "string",
584
- "required": true
585
- },
586
- "resolutionRef": {
587
- "type": "string",
588
- "required": true
589
- }
590
- }
591
- },
592
- "guards": [
593
- {
594
- "name": "isActiveDirector",
595
- "expression": "context.directors.some(d => d.directorId === event.directorId && d.status === 'ACTIVE')"
596
- }
597
- ],
598
- "effects": [
599
- {
600
- "type": "UPDATE_ARRAY_ALL",
601
- "path": "directors",
602
- "updates": {
603
- "isChair": false
604
- }
605
- },
606
- {
607
- "type": "UPDATE_ARRAY_ITEM",
608
- "path": "directors",
609
- "matchKey": "directorId",
610
- "matchValue": "{{ event.directorId }}",
611
- "updates": {
612
- "isChair": true
613
- }
614
- }
615
- ]
616
- },
617
- "call_meeting": {
618
- "from": "ACTIVE",
619
- "to": "ACTIVE",
620
- "description": "Schedule a board meeting (can be called by chair, CEO, or directors per bylaws)",
621
- "event": {
622
- "name": "call_meeting",
623
- "payload": {
624
- "meetingId": {
625
- "type": "string",
626
- "required": true
627
- },
628
- "type": {
629
- "type": "string",
630
- "enum": [
631
- "REGULAR",
632
- "SPECIAL",
633
- "ANNUAL",
634
- "ORGANIZATIONAL"
635
- ],
636
- "required": true
637
- },
638
- "scheduledDate": {
639
- "type": "string",
640
- "format": "date-time",
641
- "required": true
642
- },
643
- "location": {
644
- "type": "string"
645
- },
646
- "isVirtual": {
647
- "type": "boolean",
648
- "default": false
649
- },
650
- "calledBy": {
651
- "type": "string",
652
- "required": true,
653
- "description": "Director ID or officer title"
654
- },
655
- "noticeDate": {
656
- "type": "string",
657
- "format": "date",
658
- "required": true
659
- },
660
- "agenda": {
661
- "type": "array",
662
- "items": {
663
- "type": "string"
664
- }
665
- },
666
- "waiverOfNotice": {
667
- "type": "boolean",
668
- "default": false,
669
- "description": "If all directors waive notice"
670
- }
671
- }
672
- },
673
- "guards": [
674
- {
675
- "name": "sufficientNotice",
676
- "description": "Must provide notice per bylaws (typically 2-10 days for special, less for regular)",
677
- "expression": "event.waiverOfNotice || (new Date(event.scheduledDate) - new Date(event.noticeDate)) >= 2 * 24 * 60 * 60 * 1000"
678
- },
679
- {
680
- "name": "noConflictingMeeting",
681
- "description": "No other meeting currently scheduled/in progress",
682
- "expression": "context.currentMeeting == null || context.currentMeeting.closedAt != null"
683
- }
684
- ],
685
- "effects": [
686
- {
687
- "type": "SET_CONTEXT",
688
- "path": "currentMeeting",
689
- "value": {
690
- "meetingId": "{{ event.meetingId }}",
691
- "type": "{{ event.type }}",
692
- "scheduledDate": "{{ event.scheduledDate }}",
693
- "location": "{{ event.location }}",
694
- "isVirtual": "{{ event.isVirtual }}",
695
- "calledBy": "{{ event.calledBy }}",
696
- "noticeDate": "{{ event.noticeDate }}",
697
- "agenda": "{{ event.agenda }}",
698
- "attendees": [],
699
- "quorumPresent": false,
700
- "quorumCount": 0
701
- }
702
- },
703
- {
704
- "type": "EMIT_EVENT",
705
- "eventType": "BOARD_MEETING_SCHEDULED",
706
- "payload": {
707
- "boardId": "{{ context.boardId }}",
708
- "meetingId": "{{ event.meetingId }}",
709
- "scheduledDate": "{{ event.scheduledDate }}"
710
- }
711
- }
712
- ]
713
- },
714
- "record_attendance": {
715
- "from": "ACTIVE",
716
- "to": "ACTIVE",
717
- "description": "Record a director's attendance before meeting opens",
718
- "event": {
719
- "name": "record_attendance",
720
- "payload": {
721
- "directorId": {
722
- "type": "string",
723
- "required": true
724
- },
725
- "present": {
726
- "type": "boolean",
727
- "required": true
728
- },
729
- "arrivedAt": {
730
- "type": "string",
731
- "format": "date-time"
732
- }
733
- }
734
- },
735
- "guards": [
736
- {
737
- "name": "hasPendingMeeting",
738
- "expression": "context.currentMeeting != null && context.currentMeeting.openedAt == null"
739
- },
740
- {
741
- "name": "isActiveDirector",
742
- "expression": "context.directors.some(d => d.directorId === event.directorId && d.status === 'ACTIVE')"
743
- }
744
- ],
745
- "effects": [
746
- {
747
- "type": "APPEND_ARRAY",
748
- "path": "currentMeeting.attendees",
749
- "value": {
750
- "directorId": "{{ event.directorId }}",
751
- "present": "{{ event.present }}",
752
- "arrivedAt": "{{ event.arrivedAt }}",
753
- "viaProxy": false
754
- }
755
- },
756
- {
757
- "type": "COMPUTE",
758
- "path": "currentMeeting.quorumCount",
759
- "expression": "context.currentMeeting.attendees.filter(a => a.present).length"
760
- },
761
- {
762
- "type": "COMPUTE",
763
- "path": "currentMeeting.quorumPresent",
764
- "expression": "context.currentMeeting.attendees.filter(a => a.present).length >= Math.ceil(context.seats.filled * 0.5)"
765
- }
766
- ]
767
- },
768
- "open_meeting": {
769
- "from": "ACTIVE",
770
- "to": "IN_MEETING",
771
- "description": "Officially open the board meeting once quorum is established",
772
- "event": {
773
- "name": "open_meeting",
774
- "payload": {
775
- "openedAt": {
776
- "type": "string",
777
- "format": "date-time",
778
- "required": true
779
- },
780
- "chairPresiding": {
781
- "type": "string",
782
- "description": "Director ID presiding"
783
- }
784
- }
785
- },
786
- "guards": [
787
- {
788
- "name": "hasPendingMeeting",
789
- "expression": "context.currentMeeting != null && context.currentMeeting.openedAt == null"
790
- },
791
- {
792
- "name": "quorumPresent",
793
- "description": "Cannot open meeting without quorum",
794
- "expression": "context.currentMeeting.quorumPresent === true"
795
- }
796
- ],
797
- "effects": [
798
- {
799
- "type": "SET_CONTEXT",
800
- "path": "currentMeeting.openedAt",
801
- "value": "{{ event.openedAt }}"
802
- },
803
- {
804
- "type": "EMIT_EVENT",
805
- "eventType": "BOARD_MEETING_OPENED",
806
- "payload": {
807
- "boardId": "{{ context.boardId }}",
808
- "meetingId": "{{ context.currentMeeting.meetingId }}",
809
- "quorumCount": "{{ context.currentMeeting.quorumCount }}"
810
- }
811
- }
812
- ]
813
- },
814
- "director_departs": {
815
- "from": "IN_MEETING",
816
- "to": "IN_MEETING",
817
- "description": "Record a director leaving the meeting (may affect quorum)",
818
- "event": {
819
- "name": "director_departs",
820
- "payload": {
821
- "directorId": {
822
- "type": "string",
823
- "required": true
824
- },
825
- "departedAt": {
826
- "type": "string",
827
- "format": "date-time",
828
- "required": true
829
- }
830
- }
831
- },
832
- "effects": [
833
- {
834
- "type": "UPDATE_ARRAY_ITEM",
835
- "path": "currentMeeting.attendees",
836
- "matchKey": "directorId",
837
- "matchValue": "{{ event.directorId }}",
838
- "updates": {
839
- "present": false,
840
- "departedAt": "{{ event.departedAt }}"
841
- }
842
- },
843
- {
844
- "type": "COMPUTE",
845
- "path": "currentMeeting.quorumCount",
846
- "expression": "context.currentMeeting.attendees.filter(a => a.present).length"
847
- },
848
- {
849
- "type": "COMPUTE",
850
- "path": "currentMeeting.quorumPresent",
851
- "expression": "context.currentMeeting.attendees.filter(a => a.present).length >= Math.ceil(context.seats.filled * 0.5)"
852
- }
853
- ]
854
- },
855
- "quorum_lost": {
856
- "from": "IN_MEETING",
857
- "to": "QUORUM_LOST",
858
- "description": "Automatic transition when quorum is lost during meeting",
859
- "event": {
860
- "name": "quorum_lost",
861
- "payload": {
862
- "lostAt": {
863
- "type": "string",
864
- "format": "date-time",
865
- "required": true
866
- }
867
- }
868
- },
869
- "guards": [
870
- {
871
- "name": "noLongerQuorate",
872
- "expression": "context.currentMeeting.quorumPresent === false"
873
- }
874
- ],
875
- "effects": [
876
- {
877
- "type": "EMIT_EVENT",
878
- "eventType": "BOARD_QUORUM_LOST",
879
- "payload": {
880
- "boardId": "{{ context.boardId }}",
881
- "meetingId": "{{ context.currentMeeting.meetingId }}",
882
- "remainingDirectors": "{{ context.currentMeeting.quorumCount }}"
883
- }
884
- }
885
- ]
886
- },
887
- "quorum_restored": {
888
- "from": "QUORUM_LOST",
889
- "to": "IN_MEETING",
890
- "description": "Quorum restored after additional director(s) join",
891
- "event": {
892
- "name": "quorum_restored",
893
- "payload": {
894
- "restoredAt": {
895
- "type": "string",
896
- "format": "date-time",
897
- "required": true
898
- },
899
- "directorId": {
900
- "type": "string",
901
- "required": true,
902
- "description": "Joining director"
903
- }
904
- }
905
- },
906
- "guards": [
907
- {
908
- "name": "nowQuorate",
909
- "expression": "context.currentMeeting.quorumPresent === true"
910
- }
911
- ],
912
- "effects": [
913
- {
914
- "type": "EMIT_EVENT",
915
- "eventType": "BOARD_QUORUM_RESTORED",
916
- "payload": {
917
- "boardId": "{{ context.boardId }}",
918
- "meetingId": "{{ context.currentMeeting.meetingId }}"
919
- }
920
- }
921
- ]
922
- },
923
- "adjourn": {
924
- "from": [
925
- "IN_MEETING",
926
- "QUORUM_LOST"
927
- ],
928
- "to": "ACTIVE",
929
- "description": "Adjourn the board meeting",
930
- "event": {
931
- "name": "adjourn",
932
- "payload": {
933
- "closedAt": {
934
- "type": "string",
935
- "format": "date-time",
936
- "required": true
937
- },
938
- "minutesRef": {
939
- "type": "string",
940
- "description": "Reference to meeting minutes document"
941
- },
942
- "resolutionsPassed": {
943
- "type": "array",
944
- "items": {
945
- "type": "string"
946
- }
947
- },
948
- "adjournedTo": {
949
- "type": "string",
950
- "format": "date-time",
951
- "nullable": true,
952
- "description": "If adjourning to later date"
953
- }
954
- }
955
- },
956
- "effects": [
957
- {
958
- "type": "SET_CONTEXT",
959
- "path": "currentMeeting.closedAt",
960
- "value": "{{ event.closedAt }}"
961
- },
962
- {
963
- "type": "SET_CONTEXT",
964
- "path": "currentMeeting.minutesRef",
965
- "value": "{{ event.minutesRef }}"
966
- },
967
- {
968
- "type": "APPEND_ARRAY",
969
- "path": "meetingHistory",
970
- "value": {
971
- "meetingId": "{{ context.currentMeeting.meetingId }}",
972
- "type": "{{ context.currentMeeting.type }}",
973
- "date": "{{ context.currentMeeting.scheduledDate }}",
974
- "quorumAchieved": "{{ context.currentMeeting.quorumPresent }}",
975
- "attendeeCount": "{{ context.currentMeeting.attendees.filter(a => a.present).length }}",
976
- "resolutionsPassed": "{{ event.resolutionsPassed }}",
977
- "minutesRef": "{{ event.minutesRef }}"
978
- }
979
- },
980
- {
981
- "type": "SET_CONTEXT",
982
- "path": "currentMeeting",
983
- "value": null
984
- },
985
- {
986
- "type": "EMIT_EVENT",
987
- "eventType": "BOARD_MEETING_ADJOURNED",
988
- "payload": {
989
- "boardId": "{{ context.boardId }}",
990
- "meetingId": "{{ context.currentMeeting.meetingId }}",
991
- "resolutionsPassed": "{{ event.resolutionsPassed }}"
992
- }
993
- }
994
- ]
995
- },
996
- "update_seats": {
997
- "from": "ACTIVE",
998
- "to": "ACTIVE",
999
- "description": "Change the number of authorized board seats (requires bylaw amendment)",
1000
- "event": {
1001
- "name": "update_seats",
1002
- "payload": {
1003
- "newAuthorizedSeats": {
1004
- "type": "integer",
1005
- "required": true
1006
- },
1007
- "bylawAmendmentRef": {
1008
- "type": "string",
1009
- "required": true
1010
- }
1011
- }
1012
- },
1013
- "guards": [
1014
- {
1015
- "name": "seatsNotLessThanFilled",
1016
- "description": "Cannot reduce below current filled seats",
1017
- "expression": "event.newAuthorizedSeats >= context.seats.filled"
1018
- }
1019
- ],
1020
- "effects": [
1021
- {
1022
- "type": "SET_CONTEXT",
1023
- "path": "seats.authorized",
1024
- "value": "{{ event.newAuthorizedSeats }}"
1025
- },
1026
- {
1027
- "type": "COMPUTE",
1028
- "path": "seats.vacant",
1029
- "expression": "event.newAuthorizedSeats - context.seats.filled"
1030
- }
1031
- ]
1032
- }
1033
- },
1034
- "crossMachineRefs": {
1035
- "entity": {
1036
- "machine": "corporate-entity",
1037
- "description": "Parent corporate entity",
1038
- "foreignKey": "entityId"
1039
- },
1040
- "resolutions": {
1041
- "machine": "corporate-resolution",
1042
- "description": "Board resolutions",
1043
- "foreignKey": "boardId"
1044
- },
1045
- "committees": {
1046
- "machine": "corporate-committee",
1047
- "description": "Board committees",
1048
- "foreignKey": "boardId"
1049
- },
1050
- "officers": {
1051
- "machine": "corporate-officers",
1052
- "description": "Officers appointed by board",
1053
- "foreignKey": "entityId"
1054
- }
1055
- },
1056
- "metadata": {
1057
- "author": "OttoChain",
1058
- "license": "MIT",
1059
- "tags": [
1060
- "corporate",
1061
- "governance",
1062
- "board",
1063
- "directors",
1064
- "meetings"
1065
- ],
1066
- "documentation": "https://ottochain.dev/docs/corporate/board"
1067
- }
1068
- };
1069
- export const corpEntityDef = {
1070
- "$schema": "https://ottochain.dev/schemas/state-machine-v1.json",
1071
- "name": "CorpEntity",
1072
- "version": "1.0.0",
1073
- "category": "corporate-governance",
1074
- "description": "Master corporate record tracking the lifecycle of a business entity from incorporation through dissolution. Manages legal identity, share structure, and corporate status.",
1075
- "context": {
1076
- "entityId": {
1077
- "type": "string",
1078
- "description": "Unique identifier for this corporate entity"
1079
- },
1080
- "legalName": {
1081
- "type": "string",
1082
- "description": "Full legal name of the corporation"
1083
- },
1084
- "tradeName": {
1085
- "type": "string",
1086
- "nullable": true,
1087
- "description": "DBA or trade name if different"
1088
- },
1089
- "entityType": {
1090
- "type": "string",
1091
- "enum": [
1092
- "C_CORP",
1093
- "S_CORP",
1094
- "B_CORP",
1095
- "LLC",
1096
- "LP",
1097
- "LLP"
1098
- ],
1099
- "description": "Legal entity type"
1100
- },
1101
- "jurisdiction": {
1102
- "type": "object",
1103
- "properties": {
1104
- "state": {
1105
- "type": "string",
1106
- "description": "State of incorporation (e.g., DE, NV, WY)"
1107
- },
1108
- "country": {
1109
- "type": "string",
1110
- "default": "USA"
1111
- },
1112
- "foreignQualifications": {
1113
- "type": "array",
1114
- "items": {
1115
- "type": "string"
1116
- },
1117
- "description": "States where foreign qualified to do business"
1118
- }
1119
- }
1120
- },
1121
- "formationDate": {
1122
- "type": "string",
1123
- "format": "date",
1124
- "description": "Date of incorporation"
1125
- },
1126
- "fiscalYearEnd": {
1127
- "type": "string",
1128
- "description": "Fiscal year end (MM-DD format)"
1129
- },
1130
- "registeredAgent": {
1131
- "type": "object",
1132
- "properties": {
1133
- "name": {
1134
- "type": "string"
1135
- },
1136
- "address": {
1137
- "type": "object"
1138
- },
1139
- "phone": {
1140
- "type": "string"
1141
- },
1142
- "email": {
1143
- "type": "string"
1144
- },
1145
- "effectiveDate": {
1146
- "type": "string",
1147
- "format": "date"
1148
- }
1149
- }
1150
- },
1151
- "principalOffice": {
1152
- "type": "object",
1153
- "properties": {
1154
- "street": {
1155
- "type": "string"
1156
- },
1157
- "city": {
1158
- "type": "string"
1159
- },
1160
- "state": {
1161
- "type": "string"
1162
- },
1163
- "zip": {
1164
- "type": "string"
1165
- },
1166
- "country": {
1167
- "type": "string",
1168
- "default": "USA"
1169
- }
1170
- }
1171
- },
1172
- "shareStructure": {
1173
- "type": "object",
1174
- "properties": {
1175
- "classes": {
1176
- "type": "array",
1177
- "items": {
1178
- "type": "object",
1179
- "properties": {
1180
- "className": {
1181
- "type": "string",
1182
- "description": "e.g., Common, Series A Preferred"
1183
- },
1184
- "classId": {
1185
- "type": "string"
1186
- },
1187
- "authorized": {
1188
- "type": "integer",
1189
- "description": "Total shares authorized"
1190
- },
1191
- "issued": {
1192
- "type": "integer",
1193
- "description": "Shares currently issued"
1194
- },
1195
- "outstanding": {
1196
- "type": "integer",
1197
- "description": "Issued minus treasury"
1198
- },
1199
- "treasury": {
1200
- "type": "integer",
1201
- "description": "Shares held by company"
1202
- },
1203
- "parValue": {
1204
- "type": "number",
1205
- "description": "Par value per share"
1206
- },
1207
- "votingRights": {
1208
- "type": "boolean",
1209
- "description": "Whether class has voting rights"
1210
- },
1211
- "votesPerShare": {
1212
- "type": "number",
1213
- "default": 1
1214
- },
1215
- "liquidationPreference": {
1216
- "type": "number",
1217
- "nullable": true,
1218
- "description": "Liquidation preference multiple"
1219
- },
1220
- "dividendRate": {
1221
- "type": "number",
1222
- "nullable": true,
1223
- "description": "Annual dividend rate %"
1224
- },
1225
- "convertible": {
1226
- "type": "boolean",
1227
- "default": false
1228
- },
1229
- "conversionRatio": {
1230
- "type": "number",
1231
- "nullable": true
1232
- },
1233
- "antidilution": {
1234
- "type": "string",
1235
- "enum": [
1236
- "NONE",
1237
- "BROAD_BASED",
1238
- "NARROW_BASED",
1239
- "FULL_RATCHET"
1240
- ],
1241
- "nullable": true
1242
- }
1243
- }
1244
- }
1245
- },
1246
- "totalAuthorized": {
1247
- "type": "integer",
1248
- "description": "Sum of all authorized shares"
1249
- },
1250
- "totalIssued": {
1251
- "type": "integer"
1252
- },
1253
- "totalOutstanding": {
1254
- "type": "integer"
1255
- }
1256
- }
1257
- },
1258
- "incorporators": {
1259
- "type": "array",
1260
- "items": {
1261
- "type": "object",
1262
- "properties": {
1263
- "name": {
1264
- "type": "string"
1265
- },
1266
- "address": {
1267
- "type": "object"
1268
- },
1269
- "signatureDate": {
1270
- "type": "string",
1271
- "format": "date"
1272
- }
1273
- }
1274
- }
1275
- },
1276
- "ein": {
1277
- "type": "string",
1278
- "nullable": true,
1279
- "description": "Federal EIN"
1280
- },
1281
- "stateIds": {
1282
- "type": "object",
1283
- "additionalProperties": {
1284
- "type": "string"
1285
- },
1286
- "description": "State-specific entity IDs keyed by state code"
1287
- },
1288
- "suspensionReason": {
1289
- "type": "string",
1290
- "nullable": true
1291
- },
1292
- "suspensionDate": {
1293
- "type": "string",
1294
- "format": "date",
1295
- "nullable": true
1296
- },
1297
- "dissolutionDate": {
1298
- "type": "string",
1299
- "format": "date",
1300
- "nullable": true
1301
- },
1302
- "dissolutionReason": {
1303
- "type": "string",
1304
- "nullable": true
1305
- },
1306
- "charterAmendments": {
1307
- "type": "array",
1308
- "items": {
1309
- "type": "object",
1310
- "properties": {
1311
- "amendmentId": {
1312
- "type": "string"
1313
- },
1314
- "description": {
1315
- "type": "string"
1316
- },
1317
- "effectiveDate": {
1318
- "type": "string",
1319
- "format": "date"
1320
- },
1321
- "resolutionRef": {
1322
- "type": "string",
1323
- "description": "Reference to approving resolution"
1324
- },
1325
- "filedDate": {
1326
- "type": "string",
1327
- "format": "date"
1328
- }
1329
- }
1330
- }
1331
- },
1332
- "createdAt": {
1333
- "type": "string",
1334
- "format": "date-time"
1335
- },
1336
- "updatedAt": {
1337
- "type": "string",
1338
- "format": "date-time"
1339
- }
1340
- },
1341
- "states": {
1342
- "INCORPORATING": {
1343
- "description": "Initial state during formation process. Articles filed but not yet approved by state.",
1344
- "metadata": null
1345
- },
1346
- "ACTIVE": {
1347
- "description": "Corporation is in good standing and authorized to conduct business.",
1348
- "metadata": null
1349
- },
1350
- "SUSPENDED": {
1351
- "description": "Corporate powers suspended due to compliance failure (tax, filings, etc). Can be reinstated.",
1352
- "metadata": null
1353
- },
1354
- "DISSOLVED": {
1355
- "description": "Corporation has been legally dissolved. Terminal state.",
1356
- "metadata": null,
1357
- "terminal": true
1358
- }
1359
- },
1360
- "initialState": "INCORPORATING",
1361
- "transitions": {
1362
- "incorporate": {
1363
- "from": "INCORPORATING",
1364
- "to": "ACTIVE",
1365
- "description": "State approves articles of incorporation, corporation comes into existence",
1366
- "event": {
1367
- "name": "incorporate",
1368
- "payload": {
1369
- "approvalDate": {
1370
- "type": "string",
1371
- "format": "date",
1372
- "required": true
1373
- },
1374
- "stateFileNumber": {
1375
- "type": "string",
1376
- "required": true
1377
- },
1378
- "certificateOfIncorporation": {
1379
- "type": "string",
1380
- "description": "Document reference"
1381
- }
1382
- }
1383
- },
1384
- "guards": [
1385
- {
1386
- "name": "hasRequiredFormationDocs",
1387
- "description": "Articles of incorporation filed, incorporators signed, registered agent designated",
1388
- "expression": "context.legalName != null && context.jurisdiction.state != null && context.registeredAgent != null && context.incorporators.length > 0"
1389
- },
1390
- {
1391
- "name": "hasAuthorizedShares",
1392
- "description": "At least one share class authorized",
1393
- "expression": "context.shareStructure.classes.length > 0 && context.shareStructure.totalAuthorized > 0"
1394
- }
1395
- ],
1396
- "effects": [
1397
- {
1398
- "type": "SET_CONTEXT",
1399
- "path": "formationDate",
1400
- "value": "{{ event.approvalDate }}"
1401
- },
1402
- {
1403
- "type": "SET_CONTEXT",
1404
- "path": "stateIds.{{ context.jurisdiction.state }}",
1405
- "value": "{{ event.stateFileNumber }}"
1406
- },
1407
- {
1408
- "type": "SET_CONTEXT",
1409
- "path": "updatedAt",
1410
- "value": "{{ now() }}"
1411
- },
1412
- {
1413
- "type": "EMIT_EVENT",
1414
- "eventType": "CORPORATION_FORMED",
1415
- "payload": {
1416
- "entityId": "{{ context.entityId }}",
1417
- "legalName": "{{ context.legalName }}",
1418
- "jurisdiction": "{{ context.jurisdiction.state }}",
1419
- "formationDate": "{{ event.approvalDate }}"
1420
- }
1421
- }
1422
- ]
1423
- },
1424
- "amend_charter": {
1425
- "from": "ACTIVE",
1426
- "to": "ACTIVE",
1427
- "description": "Amend the certificate/articles of incorporation (requires shareholder approval for most amendments)",
1428
- "event": {
1429
- "name": "amend_charter",
1430
- "payload": {
1431
- "amendmentId": {
1432
- "type": "string",
1433
- "required": true
1434
- },
1435
- "description": {
1436
- "type": "string",
1437
- "required": true
1438
- },
1439
- "amendmentType": {
1440
- "type": "string",
1441
- "enum": [
1442
- "NAME_CHANGE",
1443
- "SHARE_AUTHORIZATION",
1444
- "PURPOSE_CHANGE",
1445
- "OTHER"
1446
- ],
1447
- "required": true
1448
- },
1449
- "resolutionRef": {
1450
- "type": "string",
1451
- "required": true,
1452
- "description": "Reference to board/shareholder resolution"
1453
- },
1454
- "effectiveDate": {
1455
- "type": "string",
1456
- "format": "date",
1457
- "required": true
1458
- },
1459
- "filedDate": {
1460
- "type": "string",
1461
- "format": "date",
1462
- "required": true
1463
- },
1464
- "newShareAuthorization": {
1465
- "type": "object",
1466
- "nullable": true,
1467
- "description": "If increasing/changing authorized shares"
1468
- },
1469
- "newLegalName": {
1470
- "type": "string",
1471
- "nullable": true
1472
- }
1473
- }
1474
- },
1475
- "guards": [
1476
- {
1477
- "name": "hasApprovedResolution",
1478
- "description": "Charter amendment must be backed by an executed resolution",
1479
- "expression": "event.resolutionRef != null",
1480
- "crossMachine": {
1481
- "machine": "corporate-resolution",
1482
- "instanceRef": "{{ event.resolutionRef }}",
1483
- "requiredState": "EXECUTED"
1484
- }
1485
- }
1486
- ],
1487
- "effects": [
1488
- {
1489
- "type": "APPEND_ARRAY",
1490
- "path": "charterAmendments",
1491
- "value": {
1492
- "amendmentId": "{{ event.amendmentId }}",
1493
- "description": "{{ event.description }}",
1494
- "effectiveDate": "{{ event.effectiveDate }}",
1495
- "resolutionRef": "{{ event.resolutionRef }}",
1496
- "filedDate": "{{ event.filedDate }}"
1497
- }
1498
- },
1499
- {
1500
- "type": "CONDITIONAL",
1501
- "condition": "event.newLegalName != null",
1502
- "then": {
1503
- "type": "SET_CONTEXT",
1504
- "path": "legalName",
1505
- "value": "{{ event.newLegalName }}"
1506
- }
1507
- },
1508
- {
1509
- "type": "SET_CONTEXT",
1510
- "path": "updatedAt",
1511
- "value": "{{ now() }}"
1512
- },
1513
- {
1514
- "type": "EMIT_EVENT",
1515
- "eventType": "CHARTER_AMENDED",
1516
- "payload": {
1517
- "entityId": "{{ context.entityId }}",
1518
- "amendmentId": "{{ event.amendmentId }}",
1519
- "amendmentType": "{{ event.amendmentType }}"
1520
- }
1521
- }
1522
- ]
1523
- },
1524
- "update_share_class": {
1525
- "from": "ACTIVE",
1526
- "to": "ACTIVE",
1527
- "description": "Update authorized shares for an existing class or add new class (requires charter amendment)",
1528
- "event": {
1529
- "name": "update_share_class",
1530
- "payload": {
1531
- "classId": {
1532
- "type": "string",
1533
- "required": true
1534
- },
1535
- "className": {
1536
- "type": "string",
1537
- "required": true
1538
- },
1539
- "authorized": {
1540
- "type": "integer",
1541
- "required": true
1542
- },
1543
- "parValue": {
1544
- "type": "number",
1545
- "required": true
1546
- },
1547
- "votingRights": {
1548
- "type": "boolean",
1549
- "required": true
1550
- },
1551
- "votesPerShare": {
1552
- "type": "number",
1553
- "default": 1
1554
- },
1555
- "liquidationPreference": {
1556
- "type": "number",
1557
- "nullable": true
1558
- },
1559
- "dividendRate": {
1560
- "type": "number",
1561
- "nullable": true
1562
- },
1563
- "convertible": {
1564
- "type": "boolean",
1565
- "default": false
1566
- },
1567
- "charterAmendmentRef": {
1568
- "type": "string",
1569
- "required": true
1570
- }
1571
- }
1572
- },
1573
- "guards": [
1574
- {
1575
- "name": "charterAmended",
1576
- "description": "Share class changes require charter amendment to be filed",
1577
- "expression": "context.charterAmendments.some(a => a.amendmentId === event.charterAmendmentRef)"
1578
- }
1579
- ],
1580
- "effects": [
1581
- {
1582
- "type": "UPSERT_ARRAY",
1583
- "path": "shareStructure.classes",
1584
- "matchKey": "classId",
1585
- "matchValue": "{{ event.classId }}",
1586
- "value": {
1587
- "classId": "{{ event.classId }}",
1588
- "className": "{{ event.className }}",
1589
- "authorized": "{{ event.authorized }}",
1590
- "issued": 0,
1591
- "outstanding": 0,
1592
- "treasury": 0,
1593
- "parValue": "{{ event.parValue }}",
1594
- "votingRights": "{{ event.votingRights }}",
1595
- "votesPerShare": "{{ event.votesPerShare }}",
1596
- "liquidationPreference": "{{ event.liquidationPreference }}",
1597
- "dividendRate": "{{ event.dividendRate }}",
1598
- "convertible": "{{ event.convertible }}"
1599
- }
1600
- },
1601
- {
1602
- "type": "COMPUTE",
1603
- "path": "shareStructure.totalAuthorized",
1604
- "expression": "context.shareStructure.classes.reduce((sum, c) => sum + c.authorized, 0)"
1605
- }
1606
- ]
1607
- },
1608
- "update_registered_agent": {
1609
- "from": "ACTIVE",
1610
- "to": "ACTIVE",
1611
- "description": "Change the registered agent on file with the state",
1612
- "event": {
1613
- "name": "update_registered_agent",
1614
- "payload": {
1615
- "name": {
1616
- "type": "string",
1617
- "required": true
1618
- },
1619
- "address": {
1620
- "type": "object",
1621
- "required": true
1622
- },
1623
- "phone": {
1624
- "type": "string"
1625
- },
1626
- "email": {
1627
- "type": "string"
1628
- },
1629
- "effectiveDate": {
1630
- "type": "string",
1631
- "format": "date",
1632
- "required": true
1633
- },
1634
- "filingConfirmation": {
1635
- "type": "string",
1636
- "description": "State filing confirmation number"
1637
- }
1638
- }
1639
- },
1640
- "effects": [
1641
- {
1642
- "type": "SET_CONTEXT",
1643
- "path": "registeredAgent",
1644
- "value": {
1645
- "name": "{{ event.name }}",
1646
- "address": "{{ event.address }}",
1647
- "phone": "{{ event.phone }}",
1648
- "email": "{{ event.email }}",
1649
- "effectiveDate": "{{ event.effectiveDate }}"
1650
- }
1651
- },
1652
- {
1653
- "type": "EMIT_EVENT",
1654
- "eventType": "REGISTERED_AGENT_CHANGED",
1655
- "payload": {
1656
- "entityId": "{{ context.entityId }}",
1657
- "newAgent": "{{ event.name }}",
1658
- "effectiveDate": "{{ event.effectiveDate }}"
1659
- }
1660
- }
1661
- ]
1662
- },
1663
- "suspend": {
1664
- "from": "ACTIVE",
1665
- "to": "SUSPENDED",
1666
- "description": "State suspends corporate powers (typically for tax/filing noncompliance)",
1667
- "event": {
1668
- "name": "suspend",
1669
- "payload": {
1670
- "reason": {
1671
- "type": "string",
1672
- "enum": [
1673
- "FRANCHISE_TAX_DELINQUENT",
1674
- "ANNUAL_REPORT_MISSING",
1675
- "REGISTERED_AGENT_LAPSE",
1676
- "ADMINISTRATIVE",
1677
- "OTHER"
1678
- ],
1679
- "required": true
1680
- },
1681
- "suspensionDate": {
1682
- "type": "string",
1683
- "format": "date",
1684
- "required": true
1685
- },
1686
- "stateNotice": {
1687
- "type": "string",
1688
- "description": "Reference to state notice"
1689
- },
1690
- "cureDeadline": {
1691
- "type": "string",
1692
- "format": "date",
1693
- "nullable": true
1694
- }
1695
- }
1696
- },
1697
- "effects": [
1698
- {
1699
- "type": "SET_CONTEXT",
1700
- "path": "suspensionReason",
1701
- "value": "{{ event.reason }}"
1702
- },
1703
- {
1704
- "type": "SET_CONTEXT",
1705
- "path": "suspensionDate",
1706
- "value": "{{ event.suspensionDate }}"
1707
- },
1708
- {
1709
- "type": "EMIT_EVENT",
1710
- "eventType": "CORPORATION_SUSPENDED",
1711
- "payload": {
1712
- "entityId": "{{ context.entityId }}",
1713
- "reason": "{{ event.reason }}",
1714
- "cureDeadline": "{{ event.cureDeadline }}"
1715
- }
1716
- }
1717
- ]
1718
- },
1719
- "reinstate": {
1720
- "from": "SUSPENDED",
1721
- "to": "ACTIVE",
1722
- "description": "Cure deficiencies and reinstate corporate powers",
1723
- "event": {
1724
- "name": "reinstate",
1725
- "payload": {
1726
- "reinstatementDate": {
1727
- "type": "string",
1728
- "format": "date",
1729
- "required": true
1730
- },
1731
- "curativeActions": {
1732
- "type": "array",
1733
- "items": {
1734
- "type": "string"
1735
- },
1736
- "description": "List of actions taken to cure",
1737
- "required": true
1738
- },
1739
- "stateConfirmation": {
1740
- "type": "string",
1741
- "required": true
1742
- },
1743
- "penaltiesPaid": {
1744
- "type": "number",
1745
- "nullable": true
1746
- }
1747
- }
1748
- },
1749
- "effects": [
1750
- {
1751
- "type": "SET_CONTEXT",
1752
- "path": "suspensionReason",
1753
- "value": null
1754
- },
1755
- {
1756
- "type": "SET_CONTEXT",
1757
- "path": "suspensionDate",
1758
- "value": null
1759
- },
1760
- {
1761
- "type": "EMIT_EVENT",
1762
- "eventType": "CORPORATION_REINSTATED",
1763
- "payload": {
1764
- "entityId": "{{ context.entityId }}",
1765
- "reinstatementDate": "{{ event.reinstatementDate }}"
1766
- }
1767
- }
1768
- ]
1769
- },
1770
- "dissolve_voluntary": {
1771
- "from": "ACTIVE",
1772
- "to": "DISSOLVED",
1773
- "description": "Voluntary dissolution approved by board and shareholders",
1774
- "event": {
1775
- "name": "dissolve_voluntary",
1776
- "payload": {
1777
- "dissolutionDate": {
1778
- "type": "string",
1779
- "format": "date",
1780
- "required": true
1781
- },
1782
- "boardResolutionRef": {
1783
- "type": "string",
1784
- "required": true
1785
- },
1786
- "shareholderResolutionRef": {
1787
- "type": "string",
1788
- "required": true
1789
- },
1790
- "windingUpPlan": {
1791
- "type": "string",
1792
- "description": "Reference to winding up plan"
1793
- },
1794
- "certificateOfDissolution": {
1795
- "type": "string"
1796
- }
1797
- }
1798
- },
1799
- "guards": [
1800
- {
1801
- "name": "boardApproved",
1802
- "description": "Board must approve dissolution",
1803
- "crossMachine": {
1804
- "machine": "corporate-resolution",
1805
- "instanceRef": "{{ event.boardResolutionRef }}",
1806
- "requiredState": "EXECUTED"
1807
- }
1808
- },
1809
- {
1810
- "name": "shareholdersApproved",
1811
- "description": "Shareholders must approve dissolution (typically majority or supermajority)",
1812
- "crossMachine": {
1813
- "machine": "corporate-resolution",
1814
- "instanceRef": "{{ event.shareholderResolutionRef }}",
1815
- "requiredState": "EXECUTED"
1816
- }
1817
- }
1818
- ],
1819
- "effects": [
1820
- {
1821
- "type": "SET_CONTEXT",
1822
- "path": "dissolutionDate",
1823
- "value": "{{ event.dissolutionDate }}"
1824
- },
1825
- {
1826
- "type": "SET_CONTEXT",
1827
- "path": "dissolutionReason",
1828
- "value": "VOLUNTARY"
1829
- },
1830
- {
1831
- "type": "EMIT_EVENT",
1832
- "eventType": "CORPORATION_DISSOLVED",
1833
- "payload": {
1834
- "entityId": "{{ context.entityId }}",
1835
- "dissolutionType": "VOLUNTARY",
1836
- "dissolutionDate": "{{ event.dissolutionDate }}"
1837
- }
1838
- }
1839
- ]
1840
- },
1841
- "dissolve_administrative": {
1842
- "from": "SUSPENDED",
1843
- "to": "DISSOLVED",
1844
- "description": "Administrative dissolution by state after prolonged suspension",
1845
- "event": {
1846
- "name": "dissolve_administrative",
1847
- "payload": {
1848
- "dissolutionDate": {
1849
- "type": "string",
1850
- "format": "date",
1851
- "required": true
1852
- },
1853
- "stateOrder": {
1854
- "type": "string",
1855
- "required": true
1856
- },
1857
- "reason": {
1858
- "type": "string",
1859
- "required": true
1860
- }
1861
- }
1862
- },
1863
- "effects": [
1864
- {
1865
- "type": "SET_CONTEXT",
1866
- "path": "dissolutionDate",
1867
- "value": "{{ event.dissolutionDate }}"
1868
- },
1869
- {
1870
- "type": "SET_CONTEXT",
1871
- "path": "dissolutionReason",
1872
- "value": "ADMINISTRATIVE: {{ event.reason }}"
1873
- },
1874
- {
1875
- "type": "EMIT_EVENT",
1876
- "eventType": "CORPORATION_DISSOLVED",
1877
- "payload": {
1878
- "entityId": "{{ context.entityId }}",
1879
- "dissolutionType": "ADMINISTRATIVE",
1880
- "dissolutionDate": "{{ event.dissolutionDate }}"
1881
- }
1882
- }
1883
- ]
1884
- }
1885
- },
1886
- "crossMachineRefs": {
1887
- "board": {
1888
- "machine": "corporate-board",
1889
- "description": "Board of directors for this entity",
1890
- "foreignKey": "entityId"
1891
- },
1892
- "officers": {
1893
- "machine": "corporate-officers",
1894
- "description": "Executive officers for this entity",
1895
- "foreignKey": "entityId"
1896
- },
1897
- "bylaws": {
1898
- "machine": "corporate-bylaws",
1899
- "description": "Governing bylaws for this entity",
1900
- "foreignKey": "entityId"
1901
- },
1902
- "shareholders": {
1903
- "machine": "corporate-shareholders",
1904
- "description": "Shareholder meeting instances",
1905
- "foreignKey": "entityId"
1906
- },
1907
- "securities": {
1908
- "machine": "corporate-securities",
1909
- "description": "Stock issuance records",
1910
- "foreignKey": "entityId"
1911
- },
1912
- "compliance": {
1913
- "machine": "corporate-compliance",
1914
- "description": "Regulatory compliance tracking",
1915
- "foreignKey": "entityId"
1916
- }
1917
- },
1918
- "metadata": {
1919
- "author": "OttoChain",
1920
- "license": "MIT",
1921
- "tags": [
1922
- "corporate",
1923
- "governance",
1924
- "entity",
1925
- "formation"
1926
- ],
1927
- "documentation": "https://ottochain.dev/docs/corporate/entity"
1928
- }
1929
- };
1930
- export const corpSecuritiesDef = {
1931
- "$schema": "https://ottochain.dev/schemas/state-machine-v1.json",
1932
- "name": "CorpSecurities",
1933
- "version": "1.0.0",
1934
- "category": "corporate-governance",
1935
- "description": "Securities state machine tracking the lifecycle of equity from authorization through issuance, transfer, and retirement. Manages stock certificates, book entry positions, and restricted securities.",
1936
- "context": {
1937
- "securityId": {
1938
- "type": "string",
1939
- "description": "Unique identifier for this security lot/certificate"
1940
- },
1941
- "entityId": {
1942
- "type": "string",
1943
- "description": "Reference to parent corporate-entity"
1944
- },
1945
- "shareClass": {
1946
- "type": "string",
1947
- "description": "Share class ID from corporate-entity"
1948
- },
1949
- "shareClassName": {
1950
- "type": "string",
1951
- "description": "Human-readable class name"
1952
- },
1953
- "certificateNumber": {
1954
- "type": "string",
1955
- "nullable": true,
1956
- "description": "For certificated shares"
1957
- },
1958
- "cusip": {
1959
- "type": "string",
1960
- "nullable": true,
1961
- "description": "CUSIP number if assigned"
1962
- },
1963
- "shareCount": {
1964
- "type": "integer",
1965
- "description": "Number of shares in this lot"
1966
- },
1967
- "parValue": {
1968
- "type": "number",
1969
- "description": "Par value per share"
1970
- },
1971
- "issuancePrice": {
1972
- "type": "number",
1973
- "nullable": true,
1974
- "description": "Price per share at issuance"
1975
- },
1976
- "issuanceDate": {
1977
- "type": "string",
1978
- "format": "date",
1979
- "nullable": true
1980
- },
1981
- "form": {
1982
- "type": "string",
1983
- "enum": [
1984
- "CERTIFICATED",
1985
- "BOOK_ENTRY",
1986
- "DRS"
1987
- ],
1988
- "description": "Physical certificate, book entry, or Direct Registration System"
1989
- },
1990
- "holder": {
1991
- "type": "object",
1992
- "nullable": true,
1993
- "properties": {
1994
- "holderId": {
1995
- "type": "string"
1996
- },
1997
- "holderType": {
1998
- "type": "string",
1999
- "enum": [
2000
- "INDIVIDUAL",
2001
- "ENTITY",
2002
- "TRUST",
2003
- "TREASURY"
2004
- ]
2005
- },
2006
- "name": {
2007
- "type": "string"
2008
- },
2009
- "taxId": {
2010
- "type": "string",
2011
- "nullable": true
2012
- },
2013
- "address": {
2014
- "type": "object",
2015
- "nullable": true
2016
- },
2017
- "acquisitionDate": {
2018
- "type": "string",
2019
- "format": "date"
2020
- },
2021
- "acquisitionMethod": {
2022
- "type": "string",
2023
- "enum": [
2024
- "ORIGINAL_ISSUANCE",
2025
- "PURCHASE",
2026
- "GIFT",
2027
- "INHERITANCE",
2028
- "STOCK_SPLIT",
2029
- "CONVERSION",
2030
- "EXERCISE"
2031
- ]
2032
- },
2033
- "costBasis": {
2034
- "type": "number",
2035
- "nullable": true
2036
- }
2037
- }
2038
- },
2039
- "restrictions": {
2040
- "type": "object",
2041
- "properties": {
2042
- "isRestricted": {
2043
- "type": "boolean",
2044
- "default": false
2045
- },
2046
- "restrictionType": {
2047
- "type": "array",
2048
- "items": {
2049
- "type": "string",
2050
- "enum": [
2051
- "RULE_144",
2052
- "SECTION_4(a)(2)",
2053
- "REG_D",
2054
- "REG_S",
2055
- "LOCK_UP",
2056
- "VESTING",
2057
- "RIGHT_OF_FIRST_REFUSAL"
2058
- ]
2059
- }
2060
- },
2061
- "restrictionEndDate": {
2062
- "type": "string",
2063
- "format": "date",
2064
- "nullable": true
2065
- },
2066
- "legends": {
2067
- "type": "array",
2068
- "items": {
2069
- "type": "string"
2070
- },
2071
- "description": "Legend text on certificates"
2072
- },
2073
- "vestingSchedule": {
2074
- "type": "object",
2075
- "nullable": true,
2076
- "properties": {
2077
- "vestingStartDate": {
2078
- "type": "string",
2079
- "format": "date"
2080
- },
2081
- "totalShares": {
2082
- "type": "integer"
2083
- },
2084
- "vestedShares": {
2085
- "type": "integer"
2086
- },
2087
- "vestingScheduleRef": {
2088
- "type": "string"
2089
- }
2090
- }
2091
- },
2092
- "lockUpExpiration": {
2093
- "type": "string",
2094
- "format": "date",
2095
- "nullable": true
2096
- },
2097
- "rofr": {
2098
- "type": "object",
2099
- "nullable": true,
2100
- "description": "Right of First Refusal",
2101
- "properties": {
2102
- "holderIds": {
2103
- "type": "array",
2104
- "items": {
2105
- "type": "string"
2106
- }
2107
- },
2108
- "noticePeriodDays": {
2109
- "type": "integer"
2110
- }
2111
- }
2112
- }
2113
- }
2114
- },
2115
- "authorization": {
2116
- "type": "object",
2117
- "nullable": true,
2118
- "description": "For shares in AUTHORIZED state",
2119
- "properties": {
2120
- "authorizedDate": {
2121
- "type": "string",
2122
- "format": "date"
2123
- },
2124
- "charterProvision": {
2125
- "type": "string"
2126
- },
2127
- "authorizedShares": {
2128
- "type": "integer"
2129
- }
2130
- }
2131
- },
2132
- "issuanceDetails": {
2133
- "type": "object",
2134
- "nullable": true,
2135
- "properties": {
2136
- "boardResolutionRef": {
2137
- "type": "string"
2138
- },
2139
- "issuanceAgreementRef": {
2140
- "type": "string"
2141
- },
2142
- "consideration": {
2143
- "type": "object",
2144
- "properties": {
2145
- "type": {
2146
- "type": "string",
2147
- "enum": [
2148
- "CASH",
2149
- "PROPERTY",
2150
- "SERVICES",
2151
- "DEBT_CONVERSION",
2152
- "STOCK_CONVERSION"
2153
- ]
2154
- },
2155
- "value": {
2156
- "type": "number"
2157
- },
2158
- "description": {
2159
- "type": "string"
2160
- }
2161
- }
2162
- },
2163
- "exemptionUsed": {
2164
- "type": "string",
2165
- "nullable": true
2166
- },
2167
- "accreditedInvestor": {
2168
- "type": "boolean",
2169
- "nullable": true
2170
- }
2171
- }
2172
- },
2173
- "transferHistory": {
2174
- "type": "array",
2175
- "items": {
2176
- "type": "object",
2177
- "properties": {
2178
- "transferId": {
2179
- "type": "string"
2180
- },
2181
- "transferDate": {
2182
- "type": "string",
2183
- "format": "date"
2184
- },
2185
- "fromHolderId": {
2186
- "type": "string"
2187
- },
2188
- "toHolderId": {
2189
- "type": "string"
2190
- },
2191
- "shares": {
2192
- "type": "integer"
2193
- },
2194
- "transferType": {
2195
- "type": "string",
2196
- "enum": [
2197
- "SALE",
2198
- "GIFT",
2199
- "INHERITANCE",
2200
- "INTERNAL"
2201
- ]
2202
- },
2203
- "pricePerShare": {
2204
- "type": "number",
2205
- "nullable": true
2206
- },
2207
- "transferAgentConfirmation": {
2208
- "type": "string",
2209
- "nullable": true
2210
- }
2211
- }
2212
- }
2213
- },
2214
- "corporateActions": {
2215
- "type": "array",
2216
- "description": "Stock splits, dividends, etc. affecting this lot",
2217
- "items": {
2218
- "type": "object",
2219
- "properties": {
2220
- "actionId": {
2221
- "type": "string"
2222
- },
2223
- "actionType": {
2224
- "type": "string",
2225
- "enum": [
2226
- "STOCK_SPLIT",
2227
- "REVERSE_SPLIT",
2228
- "STOCK_DIVIDEND",
2229
- "CONVERSION",
2230
- "RECLASSIFICATION"
2231
- ]
2232
- },
2233
- "actionDate": {
2234
- "type": "string",
2235
- "format": "date"
2236
- },
2237
- "ratio": {
2238
- "type": "string",
2239
- "nullable": true,
2240
- "description": "e.g., 2:1 for split"
2241
- },
2242
- "sharesBeforeAction": {
2243
- "type": "integer"
2244
- },
2245
- "sharesAfterAction": {
2246
- "type": "integer"
2247
- },
2248
- "resolutionRef": {
2249
- "type": "string"
2250
- }
2251
- }
2252
- }
2253
- },
2254
- "retirementDetails": {
2255
- "type": "object",
2256
- "nullable": true,
2257
- "properties": {
2258
- "retiredDate": {
2259
- "type": "string",
2260
- "format": "date"
2261
- },
2262
- "retirementMethod": {
2263
- "type": "string",
2264
- "enum": [
2265
- "REPURCHASE",
2266
- "REDEMPTION",
2267
- "CANCELLATION",
2268
- "CONVERSION"
2269
- ]
2270
- },
2271
- "repurchasePrice": {
2272
- "type": "number",
2273
- "nullable": true
2274
- },
2275
- "boardResolutionRef": {
2276
- "type": "string"
2277
- }
2278
- }
2279
- },
2280
- "createdAt": {
2281
- "type": "string",
2282
- "format": "date-time"
2283
- },
2284
- "updatedAt": {
2285
- "type": "string",
2286
- "format": "date-time"
2287
- }
2288
- },
2289
- "states": {
2290
- "AUTHORIZED": {
2291
- "description": "Shares authorized by charter but not yet issued",
2292
- "metadata": null
2293
- },
2294
- "ISSUED": {
2295
- "description": "Shares issued and held by a shareholder",
2296
- "metadata": null
2297
- },
2298
- "TREASURY": {
2299
- "description": "Shares repurchased and held by the company",
2300
- "metadata": null
2301
- },
2302
- "TRANSFERRED": {
2303
- "description": "Transitional state during transfer between holders",
2304
- "metadata": null
2305
- },
2306
- "RETIRED": {
2307
- "description": "Shares cancelled and returned to authorized but unissued",
2308
- "metadata": null,
2309
- "terminal": true
2310
- }
2311
- },
2312
- "initialState": "AUTHORIZED",
2313
- "transitions": {
2314
- "authorize_shares": {
2315
- "from": null,
2316
- "to": "AUTHORIZED",
2317
- "description": "Record shares as authorized per charter/amendment",
2318
- "event": {
2319
- "name": "authorize_shares",
2320
- "payload": {
2321
- "securityId": {
2322
- "type": "string",
2323
- "required": true
2324
- },
2325
- "entityId": {
2326
- "type": "string",
2327
- "required": true
2328
- },
2329
- "shareClass": {
2330
- "type": "string",
2331
- "required": true
2332
- },
2333
- "shareClassName": {
2334
- "type": "string",
2335
- "required": true
2336
- },
2337
- "shareCount": {
2338
- "type": "integer",
2339
- "required": true
2340
- },
2341
- "parValue": {
2342
- "type": "number",
2343
- "required": true
2344
- },
2345
- "authorizedDate": {
2346
- "type": "string",
2347
- "format": "date",
2348
- "required": true
2349
- },
2350
- "charterProvision": {
2351
- "type": "string"
2352
- }
2353
- }
2354
- },
2355
- "effects": [
2356
- {
2357
- "type": "SET_CONTEXT",
2358
- "path": "securityId",
2359
- "value": "{{ event.securityId }}"
2360
- },
2361
- {
2362
- "type": "SET_CONTEXT",
2363
- "path": "entityId",
2364
- "value": "{{ event.entityId }}"
2365
- },
2366
- {
2367
- "type": "SET_CONTEXT",
2368
- "path": "shareClass",
2369
- "value": "{{ event.shareClass }}"
2370
- },
2371
- {
2372
- "type": "SET_CONTEXT",
2373
- "path": "shareClassName",
2374
- "value": "{{ event.shareClassName }}"
2375
- },
2376
- {
2377
- "type": "SET_CONTEXT",
2378
- "path": "shareCount",
2379
- "value": "{{ event.shareCount }}"
2380
- },
2381
- {
2382
- "type": "SET_CONTEXT",
2383
- "path": "parValue",
2384
- "value": "{{ event.parValue }}"
2385
- },
2386
- {
2387
- "type": "SET_CONTEXT",
2388
- "path": "authorization",
2389
- "value": {
2390
- "authorizedDate": "{{ event.authorizedDate }}",
2391
- "charterProvision": "{{ event.charterProvision }}",
2392
- "authorizedShares": "{{ event.shareCount }}"
2393
- }
2394
- },
2395
- {
2396
- "type": "SET_CONTEXT",
2397
- "path": "transferHistory",
2398
- "value": []
2399
- },
2400
- {
2401
- "type": "SET_CONTEXT",
2402
- "path": "corporateActions",
2403
- "value": []
2404
- }
2405
- ]
2406
- },
2407
- "issue_shares": {
2408
- "from": "AUTHORIZED",
2409
- "to": "ISSUED",
2410
- "description": "Issue shares to a holder",
2411
- "event": {
2412
- "name": "issue_shares",
2413
- "payload": {
2414
- "holderId": {
2415
- "type": "string",
2416
- "required": true
2417
- },
2418
- "holderType": {
2419
- "type": "string",
2420
- "required": true
2421
- },
2422
- "holderName": {
2423
- "type": "string",
2424
- "required": true
2425
- },
2426
- "address": {
2427
- "type": "object"
2428
- },
2429
- "issuanceDate": {
2430
- "type": "string",
2431
- "format": "date",
2432
- "required": true
2433
- },
2434
- "issuancePrice": {
2435
- "type": "number"
2436
- },
2437
- "form": {
2438
- "type": "string",
2439
- "enum": [
2440
- "CERTIFICATED",
2441
- "BOOK_ENTRY",
2442
- "DRS"
2443
- ],
2444
- "required": true
2445
- },
2446
- "certificateNumber": {
2447
- "type": "string"
2448
- },
2449
- "boardResolutionRef": {
2450
- "type": "string",
2451
- "required": true
2452
- },
2453
- "consideration": {
2454
- "type": "object",
2455
- "required": true
2456
- },
2457
- "isRestricted": {
2458
- "type": "boolean",
2459
- "default": false
2460
- },
2461
- "restrictionType": {
2462
- "type": "array"
2463
- },
2464
- "legends": {
2465
- "type": "array"
2466
- },
2467
- "exemptionUsed": {
2468
- "type": "string"
2469
- },
2470
- "accreditedInvestor": {
2471
- "type": "boolean"
2472
- }
2473
- }
2474
- },
2475
- "guards": [
2476
- {
2477
- "name": "hasIssuanceResolution",
2478
- "description": "Board must have approved stock issuance",
2479
- "crossMachine": {
2480
- "machine": "corporate-resolution",
2481
- "instanceRef": "{{ event.boardResolutionRef }}",
2482
- "requiredState": "EXECUTED"
2483
- }
2484
- },
2485
- {
2486
- "name": "entityIsActive",
2487
- "description": "Cannot issue stock if corporation is suspended or dissolved",
2488
- "crossMachine": {
2489
- "machine": "corporate-entity",
2490
- "instanceRef": "{{ context.entityId }}",
2491
- "requiredState": "ACTIVE"
2492
- }
2493
- }
2494
- ],
2495
- "effects": [
2496
- {
2497
- "type": "SET_CONTEXT",
2498
- "path": "form",
2499
- "value": "{{ event.form }}"
2500
- },
2501
- {
2502
- "type": "SET_CONTEXT",
2503
- "path": "certificateNumber",
2504
- "value": "{{ event.certificateNumber }}"
2505
- },
2506
- {
2507
- "type": "SET_CONTEXT",
2508
- "path": "issuanceDate",
2509
- "value": "{{ event.issuanceDate }}"
2510
- },
2511
- {
2512
- "type": "SET_CONTEXT",
2513
- "path": "issuancePrice",
2514
- "value": "{{ event.issuancePrice }}"
2515
- },
2516
- {
2517
- "type": "SET_CONTEXT",
2518
- "path": "holder",
2519
- "value": {
2520
- "holderId": "{{ event.holderId }}",
2521
- "holderType": "{{ event.holderType }}",
2522
- "name": "{{ event.holderName }}",
2523
- "address": "{{ event.address }}",
2524
- "acquisitionDate": "{{ event.issuanceDate }}",
2525
- "acquisitionMethod": "ORIGINAL_ISSUANCE",
2526
- "costBasis": "{{ event.issuancePrice * context.shareCount }}"
2527
- }
2528
- },
2529
- {
2530
- "type": "SET_CONTEXT",
2531
- "path": "restrictions",
2532
- "value": {
2533
- "isRestricted": "{{ event.isRestricted }}",
2534
- "restrictionType": "{{ event.restrictionType }}",
2535
- "legends": "{{ event.legends }}"
2536
- }
2537
- },
2538
- {
2539
- "type": "SET_CONTEXT",
2540
- "path": "issuanceDetails",
2541
- "value": {
2542
- "boardResolutionRef": "{{ event.boardResolutionRef }}",
2543
- "consideration": "{{ event.consideration }}",
2544
- "exemptionUsed": "{{ event.exemptionUsed }}",
2545
- "accreditedInvestor": "{{ event.accreditedInvestor }}"
2546
- }
2547
- },
2548
- {
2549
- "type": "EMIT_EVENT",
2550
- "eventType": "SHARES_ISSUED",
2551
- "payload": {
2552
- "securityId": "{{ context.securityId }}",
2553
- "entityId": "{{ context.entityId }}",
2554
- "shareClass": "{{ context.shareClassName }}",
2555
- "shares": "{{ context.shareCount }}",
2556
- "holderId": "{{ event.holderId }}",
2557
- "holderName": "{{ event.holderName }}"
2558
- }
2559
- }
2560
- ]
2561
- },
2562
- "initiate_transfer": {
2563
- "from": "ISSUED",
2564
- "to": "TRANSFERRED",
2565
- "description": "Begin transfer of shares to new holder",
2566
- "event": {
2567
- "name": "initiate_transfer",
2568
- "payload": {
2569
- "transferId": {
2570
- "type": "string",
2571
- "required": true
2572
- },
2573
- "toHolderId": {
2574
- "type": "string",
2575
- "required": true
2576
- },
2577
- "toHolderName": {
2578
- "type": "string",
2579
- "required": true
2580
- },
2581
- "toHolderType": {
2582
- "type": "string",
2583
- "required": true
2584
- },
2585
- "toAddress": {
2586
- "type": "object"
2587
- },
2588
- "transferType": {
2589
- "type": "string",
2590
- "required": true
2591
- },
2592
- "pricePerShare": {
2593
- "type": "number"
2594
- },
2595
- "transferDate": {
2596
- "type": "string",
2597
- "format": "date",
2598
- "required": true
2599
- }
2600
- }
2601
- },
2602
- "guards": [
2603
- {
2604
- "name": "restrictionsCleared",
2605
- "description": "Must clear any transfer restrictions",
2606
- "expression": "!context.restrictions.isRestricted || context.restrictions.restrictionEndDate == null || new Date() >= new Date(context.restrictions.restrictionEndDate)"
2607
- },
2608
- {
2609
- "name": "rofrSatisfied",
2610
- "description": "Right of first refusal must be waived or expired",
2611
- "expression": "context.restrictions.rofr == null"
2612
- }
2613
- ],
2614
- "effects": [
2615
- {
2616
- "type": "APPEND_ARRAY",
2617
- "path": "transferHistory",
2618
- "value": {
2619
- "transferId": "{{ event.transferId }}",
2620
- "transferDate": "{{ event.transferDate }}",
2621
- "fromHolderId": "{{ context.holder.holderId }}",
2622
- "toHolderId": "{{ event.toHolderId }}",
2623
- "shares": "{{ context.shareCount }}",
2624
- "transferType": "{{ event.transferType }}",
2625
- "pricePerShare": "{{ event.pricePerShare }}"
2626
- }
2627
- },
2628
- {
2629
- "type": "EMIT_EVENT",
2630
- "eventType": "TRANSFER_INITIATED",
2631
- "payload": {
2632
- "securityId": "{{ context.securityId }}",
2633
- "transferId": "{{ event.transferId }}",
2634
- "fromHolderId": "{{ context.holder.holderId }}",
2635
- "toHolderId": "{{ event.toHolderId }}"
2636
- }
2637
- }
2638
- ]
2639
- },
2640
- "complete_transfer": {
2641
- "from": "TRANSFERRED",
2642
- "to": "ISSUED",
2643
- "description": "Complete the transfer, update holder",
2644
- "event": {
2645
- "name": "complete_transfer",
2646
- "payload": {
2647
- "transferAgentConfirmation": {
2648
- "type": "string"
2649
- },
2650
- "newCertificateNumber": {
2651
- "type": "string"
2652
- },
2653
- "toHolderId": {
2654
- "type": "string",
2655
- "required": true
2656
- },
2657
- "toHolderName": {
2658
- "type": "string",
2659
- "required": true
2660
- },
2661
- "toHolderType": {
2662
- "type": "string",
2663
- "required": true
2664
- },
2665
- "toAddress": {
2666
- "type": "object"
2667
- },
2668
- "completedDate": {
2669
- "type": "string",
2670
- "format": "date",
2671
- "required": true
2672
- },
2673
- "costBasis": {
2674
- "type": "number"
2675
- }
2676
- }
2677
- },
2678
- "effects": [
2679
- {
2680
- "type": "SET_CONTEXT",
2681
- "path": "holder",
2682
- "value": {
2683
- "holderId": "{{ event.toHolderId }}",
2684
- "holderType": "{{ event.toHolderType }}",
2685
- "name": "{{ event.toHolderName }}",
2686
- "address": "{{ event.toAddress }}",
2687
- "acquisitionDate": "{{ event.completedDate }}",
2688
- "acquisitionMethod": "PURCHASE",
2689
- "costBasis": "{{ event.costBasis }}"
2690
- }
2691
- },
2692
- {
2693
- "type": "CONDITIONAL",
2694
- "condition": "event.newCertificateNumber != null",
2695
- "then": {
2696
- "type": "SET_CONTEXT",
2697
- "path": "certificateNumber",
2698
- "value": "{{ event.newCertificateNumber }}"
2699
- }
2700
- },
2701
- {
2702
- "type": "UPDATE_ARRAY_ITEM",
2703
- "path": "transferHistory",
2704
- "matchKey": "toHolderId",
2705
- "matchValue": "{{ event.toHolderId }}",
2706
- "updates": {
2707
- "transferAgentConfirmation": "{{ event.transferAgentConfirmation }}"
2708
- }
2709
- },
2710
- {
2711
- "type": "EMIT_EVENT",
2712
- "eventType": "TRANSFER_COMPLETED",
2713
- "payload": {
2714
- "securityId": "{{ context.securityId }}",
2715
- "newHolderId": "{{ event.toHolderId }}"
2716
- }
2717
- }
2718
- ]
2719
- },
2720
- "repurchase": {
2721
- "from": "ISSUED",
2722
- "to": "TREASURY",
2723
- "description": "Company repurchases shares from holder",
2724
- "event": {
2725
- "name": "repurchase",
2726
- "payload": {
2727
- "repurchaseDate": {
2728
- "type": "string",
2729
- "format": "date",
2730
- "required": true
2731
- },
2732
- "pricePerShare": {
2733
- "type": "number",
2734
- "required": true
2735
- },
2736
- "boardResolutionRef": {
2737
- "type": "string",
2738
- "required": true
2739
- },
2740
- "repurchaseAgreementRef": {
2741
- "type": "string"
2742
- }
2743
- }
2744
- },
2745
- "guards": [
2746
- {
2747
- "name": "hasRepurchaseResolution",
2748
- "crossMachine": {
2749
- "machine": "corporate-resolution",
2750
- "instanceRef": "{{ event.boardResolutionRef }}",
2751
- "requiredState": "EXECUTED"
2752
- }
2753
- }
2754
- ],
2755
- "effects": [
2756
- {
2757
- "type": "APPEND_ARRAY",
2758
- "path": "transferHistory",
2759
- "value": {
2760
- "transferId": "REPURCHASE-{{ event.repurchaseDate }}",
2761
- "transferDate": "{{ event.repurchaseDate }}",
2762
- "fromHolderId": "{{ context.holder.holderId }}",
2763
- "toHolderId": "TREASURY",
2764
- "shares": "{{ context.shareCount }}",
2765
- "transferType": "INTERNAL",
2766
- "pricePerShare": "{{ event.pricePerShare }}"
2767
- }
2768
- },
2769
- {
2770
- "type": "SET_CONTEXT",
2771
- "path": "holder",
2772
- "value": {
2773
- "holderId": "TREASURY",
2774
- "holderType": "TREASURY",
2775
- "name": "Treasury Stock",
2776
- "acquisitionDate": "{{ event.repurchaseDate }}",
2777
- "acquisitionMethod": "PURCHASE",
2778
- "costBasis": "{{ event.pricePerShare * context.shareCount }}"
2779
- }
2780
- },
2781
- {
2782
- "type": "EMIT_EVENT",
2783
- "eventType": "SHARES_REPURCHASED",
2784
- "payload": {
2785
- "securityId": "{{ context.securityId }}",
2786
- "shares": "{{ context.shareCount }}",
2787
- "pricePerShare": "{{ event.pricePerShare }}"
2788
- }
2789
- }
2790
- ]
2791
- },
2792
- "reissue_from_treasury": {
2793
- "from": "TREASURY",
2794
- "to": "ISSUED",
2795
- "description": "Reissue treasury shares to a new holder",
2796
- "event": {
2797
- "name": "reissue_from_treasury",
2798
- "payload": {
2799
- "holderId": {
2800
- "type": "string",
2801
- "required": true
2802
- },
2803
- "holderName": {
2804
- "type": "string",
2805
- "required": true
2806
- },
2807
- "holderType": {
2808
- "type": "string",
2809
- "required": true
2810
- },
2811
- "address": {
2812
- "type": "object"
2813
- },
2814
- "reissueDate": {
2815
- "type": "string",
2816
- "format": "date",
2817
- "required": true
2818
- },
2819
- "issuancePrice": {
2820
- "type": "number"
2821
- },
2822
- "boardResolutionRef": {
2823
- "type": "string",
2824
- "required": true
2825
- }
2826
- }
2827
- },
2828
- "guards": [
2829
- {
2830
- "name": "hasReissueResolution",
2831
- "crossMachine": {
2832
- "machine": "corporate-resolution",
2833
- "instanceRef": "{{ event.boardResolutionRef }}",
2834
- "requiredState": "EXECUTED"
2835
- }
2836
- }
2837
- ],
2838
- "effects": [
2839
- {
2840
- "type": "SET_CONTEXT",
2841
- "path": "holder",
2842
- "value": {
2843
- "holderId": "{{ event.holderId }}",
2844
- "holderType": "{{ event.holderType }}",
2845
- "name": "{{ event.holderName }}",
2846
- "address": "{{ event.address }}",
2847
- "acquisitionDate": "{{ event.reissueDate }}",
2848
- "acquisitionMethod": "PURCHASE",
2849
- "costBasis": "{{ event.issuancePrice * context.shareCount }}"
2850
- }
2851
- },
2852
- {
2853
- "type": "EMIT_EVENT",
2854
- "eventType": "TREASURY_SHARES_REISSUED",
2855
- "payload": {
2856
- "securityId": "{{ context.securityId }}",
2857
- "holderId": "{{ event.holderId }}"
2858
- }
2859
- }
2860
- ]
2861
- },
2862
- "retire": {
2863
- "from": [
2864
- "ISSUED",
2865
- "TREASURY"
2866
- ],
2867
- "to": "RETIRED",
2868
- "description": "Retire shares (cancel them)",
2869
- "event": {
2870
- "name": "retire",
2871
- "payload": {
2872
- "retiredDate": {
2873
- "type": "string",
2874
- "format": "date",
2875
- "required": true
2876
- },
2877
- "retirementMethod": {
2878
- "type": "string",
2879
- "required": true
2880
- },
2881
- "boardResolutionRef": {
2882
- "type": "string",
2883
- "required": true
2884
- },
2885
- "repurchasePrice": {
2886
- "type": "number"
2887
- }
2888
- }
2889
- },
2890
- "guards": [
2891
- {
2892
- "name": "hasRetirementResolution",
2893
- "crossMachine": {
2894
- "machine": "corporate-resolution",
2895
- "instanceRef": "{{ event.boardResolutionRef }}",
2896
- "requiredState": "EXECUTED"
2897
- }
2898
- }
2899
- ],
2900
- "effects": [
2901
- {
2902
- "type": "SET_CONTEXT",
2903
- "path": "retirementDetails",
2904
- "value": {
2905
- "retiredDate": "{{ event.retiredDate }}",
2906
- "retirementMethod": "{{ event.retirementMethod }}",
2907
- "repurchasePrice": "{{ event.repurchasePrice }}",
2908
- "boardResolutionRef": "{{ event.boardResolutionRef }}"
2909
- }
2910
- },
2911
- {
2912
- "type": "SET_CONTEXT",
2913
- "path": "holder",
2914
- "value": null
2915
- },
2916
- {
2917
- "type": "EMIT_EVENT",
2918
- "eventType": "SHARES_RETIRED",
2919
- "payload": {
2920
- "securityId": "{{ context.securityId }}",
2921
- "shareClass": "{{ context.shareClassName }}",
2922
- "shares": "{{ context.shareCount }}"
2923
- }
2924
- }
2925
- ]
2926
- },
2927
- "stock_split": {
2928
- "from": "ISSUED",
2929
- "to": "ISSUED",
2930
- "description": "Apply stock split to this lot",
2931
- "event": {
2932
- "name": "stock_split",
2933
- "payload": {
2934
- "actionId": {
2935
- "type": "string",
2936
- "required": true
2937
- },
2938
- "splitRatio": {
2939
- "type": "string",
2940
- "required": true,
2941
- "description": "e.g., '2:1' for 2-for-1 split"
2942
- },
2943
- "effectiveDate": {
2944
- "type": "string",
2945
- "format": "date",
2946
- "required": true
2947
- },
2948
- "resolutionRef": {
2949
- "type": "string",
2950
- "required": true
2951
- },
2952
- "newShareCount": {
2953
- "type": "integer",
2954
- "required": true
2955
- }
2956
- }
2957
- },
2958
- "effects": [
2959
- {
2960
- "type": "APPEND_ARRAY",
2961
- "path": "corporateActions",
2962
- "value": {
2963
- "actionId": "{{ event.actionId }}",
2964
- "actionType": "STOCK_SPLIT",
2965
- "actionDate": "{{ event.effectiveDate }}",
2966
- "ratio": "{{ event.splitRatio }}",
2967
- "sharesBeforeAction": "{{ context.shareCount }}",
2968
- "sharesAfterAction": "{{ event.newShareCount }}",
2969
- "resolutionRef": "{{ event.resolutionRef }}"
2970
- }
2971
- },
2972
- {
2973
- "type": "SET_CONTEXT",
2974
- "path": "shareCount",
2975
- "value": "{{ event.newShareCount }}"
2976
- },
2977
- {
2978
- "type": "EMIT_EVENT",
2979
- "eventType": "STOCK_SPLIT_APPLIED",
2980
- "payload": {
2981
- "securityId": "{{ context.securityId }}",
2982
- "ratio": "{{ event.splitRatio }}",
2983
- "newShareCount": "{{ event.newShareCount }}"
2984
- }
2985
- }
2986
- ]
2987
- },
2988
- "declare_dividend": {
2989
- "from": "ISSUED",
2990
- "to": "ISSUED",
2991
- "description": "Record dividend declaration affecting this lot (for stock dividends)",
2992
- "event": {
2993
- "name": "declare_dividend",
2994
- "payload": {
2995
- "actionId": {
2996
- "type": "string",
2997
- "required": true
2998
- },
2999
- "dividendType": {
3000
- "type": "string",
3001
- "enum": [
3002
- "CASH",
3003
- "STOCK"
3004
- ],
3005
- "required": true
3006
- },
3007
- "recordDate": {
3008
- "type": "string",
3009
- "format": "date",
3010
- "required": true
3011
- },
3012
- "paymentDate": {
3013
- "type": "string",
3014
- "format": "date",
3015
- "required": true
3016
- },
3017
- "cashAmount": {
3018
- "type": "number"
3019
- },
3020
- "stockShares": {
3021
- "type": "integer"
3022
- },
3023
- "resolutionRef": {
3024
- "type": "string",
3025
- "required": true
3026
- }
3027
- }
3028
- },
3029
- "guards": [
3030
- {
3031
- "name": "hasDividendResolution",
3032
- "crossMachine": {
3033
- "machine": "corporate-resolution",
3034
- "instanceRef": "{{ event.resolutionRef }}",
3035
- "requiredState": "EXECUTED"
3036
- }
3037
- }
3038
- ],
3039
- "effects": [
3040
- {
3041
- "type": "CONDITIONAL",
3042
- "condition": "event.dividendType === 'STOCK'",
3043
- "then": {
3044
- "type": "APPEND_ARRAY",
3045
- "path": "corporateActions",
3046
- "value": {
3047
- "actionId": "{{ event.actionId }}",
3048
- "actionType": "STOCK_DIVIDEND",
3049
- "actionDate": "{{ event.paymentDate }}",
3050
- "sharesBeforeAction": "{{ context.shareCount }}",
3051
- "sharesAfterAction": "{{ context.shareCount + event.stockShares }}",
3052
- "resolutionRef": "{{ event.resolutionRef }}"
3053
- }
3054
- }
3055
- },
3056
- {
3057
- "type": "CONDITIONAL",
3058
- "condition": "event.dividendType === 'STOCK'",
3059
- "then": {
3060
- "type": "INCREMENT",
3061
- "path": "shareCount",
3062
- "amount": "{{ event.stockShares }}"
3063
- }
3064
- }
3065
- ]
3066
- },
3067
- "remove_restriction": {
3068
- "from": "ISSUED",
3069
- "to": "ISSUED",
3070
- "description": "Remove or update restrictions on the shares",
3071
- "event": {
3072
- "name": "remove_restriction",
3073
- "payload": {
3074
- "restrictionType": {
3075
- "type": "string",
3076
- "required": true
3077
- },
3078
- "removedDate": {
3079
- "type": "string",
3080
- "format": "date",
3081
- "required": true
3082
- },
3083
- "reason": {
3084
- "type": "string"
3085
- },
3086
- "legalOpinionRef": {
3087
- "type": "string"
3088
- }
3089
- }
3090
- },
3091
- "effects": [
3092
- {
3093
- "type": "UPDATE_ARRAY",
3094
- "path": "restrictions.restrictionType",
3095
- "operation": "REMOVE",
3096
- "value": "{{ event.restrictionType }}"
3097
- },
3098
- {
3099
- "type": "COMPUTE",
3100
- "path": "restrictions.isRestricted",
3101
- "expression": "context.restrictions.restrictionType.length > 0"
3102
- },
3103
- {
3104
- "type": "EMIT_EVENT",
3105
- "eventType": "RESTRICTION_REMOVED",
3106
- "payload": {
3107
- "securityId": "{{ context.securityId }}",
3108
- "restrictionType": "{{ event.restrictionType }}"
3109
- }
3110
- }
3111
- ]
3112
- }
3113
- },
3114
- "crossMachineRefs": {
3115
- "entity": {
3116
- "machine": "corporate-entity",
3117
- "description": "Parent corporate entity with share class definitions",
3118
- "foreignKey": "entityId"
3119
- },
3120
- "resolutions": {
3121
- "machine": "corporate-resolution",
3122
- "description": "Board resolutions authorizing securities actions",
3123
- "foreignKey": "entityId"
3124
- },
3125
- "shareholders": {
3126
- "machine": "corporate-shareholders",
3127
- "description": "Shareholder meetings for determining voting rights",
3128
- "foreignKey": "entityId"
3129
- }
3130
- },
3131
- "metadata": {
3132
- "author": "OttoChain",
3133
- "license": "MIT",
3134
- "tags": [
3135
- "corporate",
3136
- "governance",
3137
- "securities",
3138
- "stock",
3139
- "equity",
3140
- "certificates"
3141
- ],
3142
- "documentation": "https://ottochain.dev/docs/corporate/securities"
3143
- }
3144
- };
3145
- export const corpShareholdersDef = {
3146
- "$schema": "https://ottochain.dev/schemas/state-machine-v1.json",
3147
- "name": "CorpShareholders",
3148
- "version": "1.0.0",
3149
- "category": "corporate-governance",
3150
- "description": "Shareholder meeting state machine managing annual/special meetings, record dates, proxy periods, voting, and certification of results. Supports multiple share classes and cumulative voting.",
3151
- "context": {
3152
- "meetingId": {
3153
- "type": "string",
3154
- "description": "Unique identifier for this shareholder meeting"
3155
- },
3156
- "entityId": {
3157
- "type": "string",
3158
- "description": "Reference to parent corporate-entity"
3159
- },
3160
- "meetingType": {
3161
- "type": "string",
3162
- "enum": [
3163
- "ANNUAL",
3164
- "SPECIAL"
3165
- ],
3166
- "description": "Annual meetings are required; special meetings called for specific purposes"
3167
- },
3168
- "fiscalYear": {
3169
- "type": "integer",
3170
- "description": "Fiscal year for annual meetings"
3171
- },
3172
- "scheduledDate": {
3173
- "type": "string",
3174
- "format": "date-time"
3175
- },
3176
- "location": {
3177
- "type": "object",
3178
- "properties": {
3179
- "physical": {
3180
- "type": "string",
3181
- "nullable": true
3182
- },
3183
- "virtualUrl": {
3184
- "type": "string",
3185
- "nullable": true
3186
- },
3187
- "isHybrid": {
3188
- "type": "boolean",
3189
- "default": false
3190
- }
3191
- }
3192
- },
3193
- "calledBy": {
3194
- "type": "object",
3195
- "properties": {
3196
- "type": {
3197
- "type": "string",
3198
- "enum": [
3199
- "BOARD",
3200
- "SHAREHOLDERS",
3201
- "COURT"
3202
- ]
3203
- },
3204
- "resolutionRef": {
3205
- "type": "string",
3206
- "nullable": true
3207
- },
3208
- "shareholderPetitionRef": {
3209
- "type": "string",
3210
- "nullable": true
3211
- },
3212
- "courtOrderRef": {
3213
- "type": "string",
3214
- "nullable": true
3215
- }
3216
- }
3217
- },
3218
- "noticeInfo": {
3219
- "type": "object",
3220
- "properties": {
3221
- "noticeSentDate": {
3222
- "type": "string",
3223
- "format": "date"
3224
- },
3225
- "noticeMethod": {
3226
- "type": "string",
3227
- "enum": [
3228
- "MAIL",
3229
- "EMAIL",
3230
- "ELECTRONIC_ACCESS"
3231
- ]
3232
- },
3233
- "minimumNoticeDays": {
3234
- "type": "integer",
3235
- "default": 10
3236
- },
3237
- "maximumNoticeDays": {
3238
- "type": "integer",
3239
- "default": 60
3240
- }
3241
- }
3242
- },
3243
- "recordDate": {
3244
- "type": "object",
3245
- "nullable": true,
3246
- "properties": {
3247
- "date": {
3248
- "type": "string",
3249
- "format": "date"
3250
- },
3251
- "setByBoardOn": {
3252
- "type": "string",
3253
- "format": "date"
3254
- },
3255
- "resolutionRef": {
3256
- "type": "string"
3257
- }
3258
- }
3259
- },
3260
- "eligibleVoters": {
3261
- "type": "array",
3262
- "description": "Shareholders as of record date with their share counts",
3263
- "items": {
3264
- "type": "object",
3265
- "properties": {
3266
- "shareholderId": {
3267
- "type": "string"
3268
- },
3269
- "name": {
3270
- "type": "string"
3271
- },
3272
- "shareholdings": {
3273
- "type": "array",
3274
- "items": {
3275
- "type": "object",
3276
- "properties": {
3277
- "shareClass": {
3278
- "type": "string"
3279
- },
3280
- "shares": {
3281
- "type": "integer"
3282
- },
3283
- "votes": {
3284
- "type": "integer",
3285
- "description": "Votes this holding represents"
3286
- }
3287
- }
3288
- }
3289
- },
3290
- "totalVotes": {
3291
- "type": "integer"
3292
- },
3293
- "proxyGrantedTo": {
3294
- "type": "string",
3295
- "nullable": true,
3296
- "description": "Proxy holder ID if proxied"
3297
- },
3298
- "hasVoted": {
3299
- "type": "boolean",
3300
- "default": false
3301
- }
3302
- }
3303
- }
3304
- },
3305
- "quorumRequirements": {
3306
- "type": "object",
3307
- "properties": {
3308
- "type": {
3309
- "type": "string",
3310
- "enum": [
3311
- "SHARES_REPRESENTED",
3312
- "SHARES_OUTSTANDING"
3313
- ]
3314
- },
3315
- "threshold": {
3316
- "type": "number",
3317
- "default": 0.5,
3318
- "description": "Fraction required for quorum"
3319
- },
3320
- "sharesRequired": {
3321
- "type": "integer"
3322
- },
3323
- "sharesRepresented": {
3324
- "type": "integer",
3325
- "default": 0
3326
- },
3327
- "quorumMet": {
3328
- "type": "boolean",
3329
- "default": false
3330
- }
3331
- }
3332
- },
3333
- "agenda": {
3334
- "type": "array",
3335
- "items": {
3336
- "type": "object",
3337
- "properties": {
3338
- "itemId": {
3339
- "type": "string"
3340
- },
3341
- "itemNumber": {
3342
- "type": "integer"
3343
- },
3344
- "title": {
3345
- "type": "string"
3346
- },
3347
- "description": {
3348
- "type": "string"
3349
- },
3350
- "type": {
3351
- "type": "string",
3352
- "enum": [
3353
- "DIRECTOR_ELECTION",
3354
- "AUDITOR_RATIFICATION",
3355
- "SAY_ON_PAY",
3356
- "CHARTER_AMENDMENT",
3357
- "MERGER",
3358
- "STOCK_PLAN",
3359
- "SHAREHOLDER_PROPOSAL",
3360
- "OTHER"
3361
- ]
3362
- },
3363
- "voteRequired": {
3364
- "type": "string",
3365
- "enum": [
3366
- "PLURALITY",
3367
- "MAJORITY_CAST",
3368
- "MAJORITY_OUTSTANDING",
3369
- "SUPERMAJORITY",
3370
- "UNANIMOUS"
3371
- ],
3372
- "description": "Vote threshold for approval"
3373
- },
3374
- "supermajorityThreshold": {
3375
- "type": "number",
3376
- "nullable": true
3377
- },
3378
- "eligibleClasses": {
3379
- "type": "array",
3380
- "items": {
3381
- "type": "string"
3382
- },
3383
- "description": "Share classes that can vote on this item"
3384
- },
3385
- "allowCumulativeVoting": {
3386
- "type": "boolean",
3387
- "default": false,
3388
- "description": "For director elections"
3389
- },
3390
- "status": {
3391
- "type": "string",
3392
- "enum": [
3393
- "PENDING",
3394
- "VOTING",
3395
- "CLOSED",
3396
- "APPROVED",
3397
- "REJECTED"
3398
- ]
3399
- }
3400
- }
3401
- }
3402
- },
3403
- "proxyPeriod": {
3404
- "type": "object",
3405
- "nullable": true,
3406
- "properties": {
3407
- "startDate": {
3408
- "type": "string",
3409
- "format": "date"
3410
- },
3411
- "endDate": {
3412
- "type": "string",
3413
- "format": "date-time",
3414
- "description": "Usually meeting start time"
3415
- },
3416
- "proxyMaterials": {
3417
- "type": "object",
3418
- "properties": {
3419
- "proxyStatementRef": {
3420
- "type": "string"
3421
- },
3422
- "formOfProxyRef": {
3423
- "type": "string"
3424
- },
3425
- "annualReportRef": {
3426
- "type": "string",
3427
- "nullable": true
3428
- }
3429
- }
3430
- }
3431
- }
3432
- },
3433
- "votes": {
3434
- "type": "array",
3435
- "items": {
3436
- "type": "object",
3437
- "properties": {
3438
- "voteId": {
3439
- "type": "string"
3440
- },
3441
- "agendaItemId": {
3442
- "type": "string"
3443
- },
3444
- "voterId": {
3445
- "type": "string",
3446
- "description": "Shareholder or proxy holder ID"
3447
- },
3448
- "shareholderId": {
3449
- "type": "string",
3450
- "description": "Beneficial owner"
3451
- },
3452
- "shareClass": {
3453
- "type": "string"
3454
- },
3455
- "votesFor": {
3456
- "type": "integer",
3457
- "default": 0
3458
- },
3459
- "votesAgainst": {
3460
- "type": "integer",
3461
- "default": 0
3462
- },
3463
- "votesAbstain": {
3464
- "type": "integer",
3465
- "default": 0
3466
- },
3467
- "votesWithhold": {
3468
- "type": "integer",
3469
- "default": 0,
3470
- "description": "For director elections"
3471
- },
3472
- "cumulativeVoteAllocation": {
3473
- "type": "object",
3474
- "additionalProperties": {
3475
- "type": "integer"
3476
- },
3477
- "nullable": true,
3478
- "description": "For cumulative voting: candidate ID -> votes allocated"
3479
- },
3480
- "viaProxy": {
3481
- "type": "boolean",
3482
- "default": false
3483
- },
3484
- "timestamp": {
3485
- "type": "string",
3486
- "format": "date-time"
3487
- }
3488
- }
3489
- }
3490
- },
3491
- "voteTallies": {
3492
- "type": "array",
3493
- "items": {
3494
- "type": "object",
3495
- "properties": {
3496
- "agendaItemId": {
3497
- "type": "string"
3498
- },
3499
- "forVotes": {
3500
- "type": "integer",
3501
- "default": 0
3502
- },
3503
- "againstVotes": {
3504
- "type": "integer",
3505
- "default": 0
3506
- },
3507
- "abstainVotes": {
3508
- "type": "integer",
3509
- "default": 0
3510
- },
3511
- "withholdVotes": {
3512
- "type": "integer",
3513
- "default": 0
3514
- },
3515
- "brokerNonVotes": {
3516
- "type": "integer",
3517
- "default": 0
3518
- },
3519
- "candidateVotes": {
3520
- "type": "object",
3521
- "additionalProperties": {
3522
- "type": "integer"
3523
- },
3524
- "nullable": true,
3525
- "description": "For director elections: candidate ID -> total votes"
3526
- },
3527
- "result": {
3528
- "type": "string",
3529
- "enum": [
3530
- "APPROVED",
3531
- "REJECTED",
3532
- "PENDING"
3533
- ]
3534
- },
3535
- "certified": {
3536
- "type": "boolean",
3537
- "default": false
3538
- }
3539
- }
3540
- }
3541
- },
3542
- "inspectorOfElections": {
3543
- "type": "object",
3544
- "nullable": true,
3545
- "properties": {
3546
- "name": {
3547
- "type": "string"
3548
- },
3549
- "company": {
3550
- "type": "string",
3551
- "nullable": true
3552
- },
3553
- "appointedBy": {
3554
- "type": "string"
3555
- },
3556
- "appointmentDate": {
3557
- "type": "string",
3558
- "format": "date"
3559
- }
3560
- }
3561
- },
3562
- "sessionInfo": {
3563
- "type": "object",
3564
- "nullable": true,
3565
- "properties": {
3566
- "openedAt": {
3567
- "type": "string",
3568
- "format": "date-time"
3569
- },
3570
- "chairPerson": {
3571
- "type": "string"
3572
- },
3573
- "secretaryPresent": {
3574
- "type": "string"
3575
- },
3576
- "pollsOpenedAt": {
3577
- "type": "string",
3578
- "format": "date-time",
3579
- "nullable": true
3580
- },
3581
- "pollsClosedAt": {
3582
- "type": "string",
3583
- "format": "date-time",
3584
- "nullable": true
3585
- },
3586
- "adjournedAt": {
3587
- "type": "string",
3588
- "format": "date-time",
3589
- "nullable": true
3590
- },
3591
- "minutesRef": {
3592
- "type": "string",
3593
- "nullable": true
3594
- }
3595
- }
3596
- },
3597
- "certification": {
3598
- "type": "object",
3599
- "nullable": true,
3600
- "properties": {
3601
- "certifiedAt": {
3602
- "type": "string",
3603
- "format": "date-time"
3604
- },
3605
- "certifiedBy": {
3606
- "type": "string"
3607
- },
3608
- "certificateRef": {
3609
- "type": "string"
3610
- }
3611
- }
3612
- },
3613
- "createdAt": {
3614
- "type": "string",
3615
- "format": "date-time"
3616
- },
3617
- "updatedAt": {
3618
- "type": "string",
3619
- "format": "date-time"
3620
- }
3621
- },
3622
- "states": {
3623
- "SCHEDULED": {
3624
- "description": "Meeting has been scheduled but record date not yet set",
3625
- "metadata": null
3626
- },
3627
- "RECORD_DATE_SET": {
3628
- "description": "Record date established; eligible shareholders determined",
3629
- "metadata": null
3630
- },
3631
- "PROXY_PERIOD": {
3632
- "description": "Proxy materials distributed; shareholders may submit proxies",
3633
- "metadata": null
3634
- },
3635
- "IN_SESSION": {
3636
- "description": "Meeting is convened and in progress",
3637
- "metadata": null
3638
- },
3639
- "VOTING": {
3640
- "description": "Polls are open for voting on agenda items",
3641
- "metadata": null
3642
- },
3643
- "CLOSED": {
3644
- "description": "Meeting concluded; results certified",
3645
- "metadata": null,
3646
- "terminal": true
3647
- }
3648
- },
3649
- "initialState": "SCHEDULED",
3650
- "transitions": {
3651
- "schedule_annual": {
3652
- "from": null,
3653
- "to": "SCHEDULED",
3654
- "description": "Schedule an annual shareholder meeting",
3655
- "event": {
3656
- "name": "schedule_annual",
3657
- "payload": {
3658
- "meetingId": {
3659
- "type": "string",
3660
- "required": true
3661
- },
3662
- "entityId": {
3663
- "type": "string",
3664
- "required": true
3665
- },
3666
- "fiscalYear": {
3667
- "type": "integer",
3668
- "required": true
3669
- },
3670
- "scheduledDate": {
3671
- "type": "string",
3672
- "format": "date-time",
3673
- "required": true
3674
- },
3675
- "location": {
3676
- "type": "object"
3677
- },
3678
- "boardResolutionRef": {
3679
- "type": "string",
3680
- "required": true
3681
- }
3682
- }
3683
- },
3684
- "guards": [
3685
- {
3686
- "name": "boardApproved",
3687
- "crossMachine": {
3688
- "machine": "corporate-resolution",
3689
- "instanceRef": "{{ event.boardResolutionRef }}",
3690
- "requiredState": "EXECUTED"
3691
- }
3692
- }
3693
- ],
3694
- "effects": [
3695
- {
3696
- "type": "SET_CONTEXT",
3697
- "path": "meetingId",
3698
- "value": "{{ event.meetingId }}"
3699
- },
3700
- {
3701
- "type": "SET_CONTEXT",
3702
- "path": "entityId",
3703
- "value": "{{ event.entityId }}"
3704
- },
3705
- {
3706
- "type": "SET_CONTEXT",
3707
- "path": "meetingType",
3708
- "value": "ANNUAL"
3709
- },
3710
- {
3711
- "type": "SET_CONTEXT",
3712
- "path": "fiscalYear",
3713
- "value": "{{ event.fiscalYear }}"
3714
- },
3715
- {
3716
- "type": "SET_CONTEXT",
3717
- "path": "scheduledDate",
3718
- "value": "{{ event.scheduledDate }}"
3719
- },
3720
- {
3721
- "type": "SET_CONTEXT",
3722
- "path": "location",
3723
- "value": "{{ event.location }}"
3724
- },
3725
- {
3726
- "type": "SET_CONTEXT",
3727
- "path": "calledBy",
3728
- "value": {
3729
- "type": "BOARD",
3730
- "resolutionRef": "{{ event.boardResolutionRef }}"
3731
- }
3732
- },
3733
- {
3734
- "type": "EMIT_EVENT",
3735
- "eventType": "SHAREHOLDER_MEETING_SCHEDULED",
3736
- "payload": {
3737
- "meetingId": "{{ event.meetingId }}",
3738
- "type": "ANNUAL",
3739
- "scheduledDate": "{{ event.scheduledDate }}"
3740
- }
3741
- }
3742
- ]
3743
- },
3744
- "schedule_special": {
3745
- "from": null,
3746
- "to": "SCHEDULED",
3747
- "description": "Schedule a special shareholder meeting",
3748
- "event": {
3749
- "name": "schedule_special",
3750
- "payload": {
3751
- "meetingId": {
3752
- "type": "string",
3753
- "required": true
3754
- },
3755
- "entityId": {
3756
- "type": "string",
3757
- "required": true
3758
- },
3759
- "scheduledDate": {
3760
- "type": "string",
3761
- "format": "date-time",
3762
- "required": true
3763
- },
3764
- "location": {
3765
- "type": "object"
3766
- },
3767
- "purpose": {
3768
- "type": "string",
3769
- "required": true,
3770
- "description": "Specific purpose for special meeting"
3771
- },
3772
- "calledByType": {
3773
- "type": "string",
3774
- "enum": [
3775
- "BOARD",
3776
- "SHAREHOLDERS",
3777
- "COURT"
3778
- ],
3779
- "required": true
3780
- },
3781
- "resolutionRef": {
3782
- "type": "string"
3783
- },
3784
- "petitionRef": {
3785
- "type": "string"
3786
- }
3787
- }
3788
- },
3789
- "effects": [
3790
- {
3791
- "type": "SET_CONTEXT",
3792
- "path": "meetingId",
3793
- "value": "{{ event.meetingId }}"
3794
- },
3795
- {
3796
- "type": "SET_CONTEXT",
3797
- "path": "entityId",
3798
- "value": "{{ event.entityId }}"
3799
- },
3800
- {
3801
- "type": "SET_CONTEXT",
3802
- "path": "meetingType",
3803
- "value": "SPECIAL"
3804
- },
3805
- {
3806
- "type": "SET_CONTEXT",
3807
- "path": "scheduledDate",
3808
- "value": "{{ event.scheduledDate }}"
3809
- },
3810
- {
3811
- "type": "SET_CONTEXT",
3812
- "path": "calledBy.type",
3813
- "value": "{{ event.calledByType }}"
3814
- },
3815
- {
3816
- "type": "EMIT_EVENT",
3817
- "eventType": "SPECIAL_MEETING_SCHEDULED",
3818
- "payload": {
3819
- "meetingId": "{{ event.meetingId }}",
3820
- "purpose": "{{ event.purpose }}"
3821
- }
3822
- }
3823
- ]
3824
- },
3825
- "set_record_date": {
3826
- "from": "SCHEDULED",
3827
- "to": "RECORD_DATE_SET",
3828
- "description": "Board sets the record date for determining eligible shareholders",
3829
- "event": {
3830
- "name": "set_record_date",
3831
- "payload": {
3832
- "recordDate": {
3833
- "type": "string",
3834
- "format": "date",
3835
- "required": true
3836
- },
3837
- "resolutionRef": {
3838
- "type": "string",
3839
- "required": true
3840
- }
3841
- }
3842
- },
3843
- "guards": [
3844
- {
3845
- "name": "validRecordDateTiming",
3846
- "description": "Record date must be 10-60 days before meeting (per most state laws)",
3847
- "expression": "true"
3848
- }
3849
- ],
3850
- "effects": [
3851
- {
3852
- "type": "SET_CONTEXT",
3853
- "path": "recordDate",
3854
- "value": {
3855
- "date": "{{ event.recordDate }}",
3856
- "setByBoardOn": "{{ today() }}",
3857
- "resolutionRef": "{{ event.resolutionRef }}"
3858
- }
3859
- },
3860
- {
3861
- "type": "EMIT_EVENT",
3862
- "eventType": "RECORD_DATE_SET",
3863
- "payload": {
3864
- "meetingId": "{{ context.meetingId }}",
3865
- "recordDate": "{{ event.recordDate }}"
3866
- }
3867
- }
3868
- ]
3869
- },
3870
- "register_eligible_shareholders": {
3871
- "from": "RECORD_DATE_SET",
3872
- "to": "RECORD_DATE_SET",
3873
- "description": "Register shareholders of record as of record date",
3874
- "event": {
3875
- "name": "register_eligible_shareholders",
3876
- "payload": {
3877
- "shareholders": {
3878
- "type": "array",
3879
- "required": true,
3880
- "items": {
3881
- "type": "object",
3882
- "properties": {
3883
- "shareholderId": {
3884
- "type": "string"
3885
- },
3886
- "name": {
3887
- "type": "string"
3888
- },
3889
- "shareholdings": {
3890
- "type": "array"
3891
- }
3892
- }
3893
- }
3894
- },
3895
- "totalSharesOutstanding": {
3896
- "type": "integer",
3897
- "required": true
3898
- }
3899
- }
3900
- },
3901
- "effects": [
3902
- {
3903
- "type": "SET_CONTEXT",
3904
- "path": "eligibleVoters",
3905
- "value": "{{ event.shareholders }}"
3906
- },
3907
- {
3908
- "type": "SET_CONTEXT",
3909
- "path": "quorumRequirements.sharesRequired",
3910
- "value": "{{ Math.ceil(event.totalSharesOutstanding * 0.5) }}"
3911
- }
3912
- ]
3913
- },
3914
- "open_proxy_period": {
3915
- "from": "RECORD_DATE_SET",
3916
- "to": "PROXY_PERIOD",
3917
- "description": "Distribute proxy materials and open proxy solicitation period",
3918
- "event": {
3919
- "name": "open_proxy_period",
3920
- "payload": {
3921
- "startDate": {
3922
- "type": "string",
3923
- "format": "date",
3924
- "required": true
3925
- },
3926
- "proxyStatementRef": {
3927
- "type": "string",
3928
- "required": true
3929
- },
3930
- "formOfProxyRef": {
3931
- "type": "string",
3932
- "required": true
3933
- },
3934
- "annualReportRef": {
3935
- "type": "string"
3936
- },
3937
- "agenda": {
3938
- "type": "array",
3939
- "required": true
3940
- }
3941
- }
3942
- },
3943
- "effects": [
3944
- {
3945
- "type": "SET_CONTEXT",
3946
- "path": "proxyPeriod",
3947
- "value": {
3948
- "startDate": "{{ event.startDate }}",
3949
- "endDate": "{{ context.scheduledDate }}",
3950
- "proxyMaterials": {
3951
- "proxyStatementRef": "{{ event.proxyStatementRef }}",
3952
- "formOfProxyRef": "{{ event.formOfProxyRef }}",
3953
- "annualReportRef": "{{ event.annualReportRef }}"
3954
- }
3955
- }
3956
- },
3957
- {
3958
- "type": "SET_CONTEXT",
3959
- "path": "agenda",
3960
- "value": "{{ event.agenda }}"
3961
- },
3962
- {
3963
- "type": "SET_CONTEXT",
3964
- "path": "noticeInfo.noticeSentDate",
3965
- "value": "{{ event.startDate }}"
3966
- },
3967
- {
3968
- "type": "EMIT_EVENT",
3969
- "eventType": "PROXY_PERIOD_OPENED",
3970
- "payload": {
3971
- "meetingId": "{{ context.meetingId }}",
3972
- "proxyStatementRef": "{{ event.proxyStatementRef }}"
3973
- }
3974
- }
3975
- ]
3976
- },
3977
- "add_agenda_item": {
3978
- "from": [
3979
- "SCHEDULED",
3980
- "RECORD_DATE_SET",
3981
- "PROXY_PERIOD"
3982
- ],
3983
- "to": null,
3984
- "description": "Add an item to the meeting agenda (e.g., shareholder proposal)",
3985
- "event": {
3986
- "name": "add_agenda_item",
3987
- "payload": {
3988
- "itemId": {
3989
- "type": "string",
3990
- "required": true
3991
- },
3992
- "title": {
3993
- "type": "string",
3994
- "required": true
3995
- },
3996
- "description": {
3997
- "type": "string"
3998
- },
3999
- "type": {
4000
- "type": "string",
4001
- "required": true
4002
- },
4003
- "voteRequired": {
4004
- "type": "string",
4005
- "required": true
4006
- },
4007
- "eligibleClasses": {
4008
- "type": "array",
4009
- "items": {
4010
- "type": "string"
4011
- }
4012
- },
4013
- "allowCumulativeVoting": {
4014
- "type": "boolean",
4015
- "default": false
4016
- }
4017
- }
4018
- },
4019
- "effects": [
4020
- {
4021
- "type": "APPEND_ARRAY",
4022
- "path": "agenda",
4023
- "value": {
4024
- "itemId": "{{ event.itemId }}",
4025
- "itemNumber": "{{ context.agenda.length + 1 }}",
4026
- "title": "{{ event.title }}",
4027
- "description": "{{ event.description }}",
4028
- "type": "{{ event.type }}",
4029
- "voteRequired": "{{ event.voteRequired }}",
4030
- "eligibleClasses": "{{ event.eligibleClasses }}",
4031
- "allowCumulativeVoting": "{{ event.allowCumulativeVoting }}",
4032
- "status": "PENDING"
4033
- }
4034
- }
4035
- ]
4036
- },
4037
- "open_meeting": {
4038
- "from": "PROXY_PERIOD",
4039
- "to": "IN_SESSION",
4040
- "description": "Convene the shareholder meeting",
4041
- "event": {
4042
- "name": "open_meeting",
4043
- "payload": {
4044
- "openedAt": {
4045
- "type": "string",
4046
- "format": "date-time",
4047
- "required": true
4048
- },
4049
- "chairPerson": {
4050
- "type": "string",
4051
- "required": true
4052
- },
4053
- "secretaryPresent": {
4054
- "type": "string",
4055
- "required": true
4056
- },
4057
- "inspectorOfElections": {
4058
- "type": "object"
4059
- },
4060
- "initialQuorumCount": {
4061
- "type": "integer",
4062
- "required": true
4063
- }
4064
- }
4065
- },
4066
- "guards": [
4067
- {
4068
- "name": "quorumPresentOrRepresented",
4069
- "description": "Must have quorum to proceed",
4070
- "expression": "event.initialQuorumCount >= context.quorumRequirements.sharesRequired"
4071
- }
4072
- ],
4073
- "effects": [
4074
- {
4075
- "type": "SET_CONTEXT",
4076
- "path": "sessionInfo",
4077
- "value": {
4078
- "openedAt": "{{ event.openedAt }}",
4079
- "chairPerson": "{{ event.chairPerson }}",
4080
- "secretaryPresent": "{{ event.secretaryPresent }}"
4081
- }
4082
- },
4083
- {
4084
- "type": "SET_CONTEXT",
4085
- "path": "inspectorOfElections",
4086
- "value": "{{ event.inspectorOfElections }}"
4087
- },
4088
- {
4089
- "type": "SET_CONTEXT",
4090
- "path": "quorumRequirements.sharesRepresented",
4091
- "value": "{{ event.initialQuorumCount }}"
4092
- },
4093
- {
4094
- "type": "SET_CONTEXT",
4095
- "path": "quorumRequirements.quorumMet",
4096
- "value": true
4097
- },
4098
- {
4099
- "type": "EMIT_EVENT",
4100
- "eventType": "SHAREHOLDER_MEETING_OPENED",
4101
- "payload": {
4102
- "meetingId": "{{ context.meetingId }}",
4103
- "sharesRepresented": "{{ event.initialQuorumCount }}"
4104
- }
4105
- }
4106
- ]
4107
- },
4108
- "open_polls": {
4109
- "from": "IN_SESSION",
4110
- "to": "VOTING",
4111
- "description": "Open polls for voting on agenda items",
4112
- "event": {
4113
- "name": "open_polls",
4114
- "payload": {
4115
- "pollsOpenedAt": {
4116
- "type": "string",
4117
- "format": "date-time",
4118
- "required": true
4119
- }
4120
- }
4121
- },
4122
- "effects": [
4123
- {
4124
- "type": "SET_CONTEXT",
4125
- "path": "sessionInfo.pollsOpenedAt",
4126
- "value": "{{ event.pollsOpenedAt }}"
4127
- },
4128
- {
4129
- "type": "UPDATE_ARRAY_ALL",
4130
- "path": "agenda",
4131
- "updates": {
4132
- "status": "VOTING"
4133
- }
4134
- }
4135
- ]
4136
- },
4137
- "cast_vote": {
4138
- "from": "VOTING",
4139
- "to": "VOTING",
4140
- "description": "Record a vote from a shareholder or proxy holder",
4141
- "event": {
4142
- "name": "cast_vote",
4143
- "payload": {
4144
- "voteId": {
4145
- "type": "string",
4146
- "required": true
4147
- },
4148
- "agendaItemId": {
4149
- "type": "string",
4150
- "required": true
4151
- },
4152
- "voterId": {
4153
- "type": "string",
4154
- "required": true
4155
- },
4156
- "shareholderId": {
4157
- "type": "string",
4158
- "required": true
4159
- },
4160
- "shareClass": {
4161
- "type": "string",
4162
- "required": true
4163
- },
4164
- "votesFor": {
4165
- "type": "integer",
4166
- "default": 0
4167
- },
4168
- "votesAgainst": {
4169
- "type": "integer",
4170
- "default": 0
4171
- },
4172
- "votesAbstain": {
4173
- "type": "integer",
4174
- "default": 0
4175
- },
4176
- "votesWithhold": {
4177
- "type": "integer",
4178
- "default": 0
4179
- },
4180
- "cumulativeVoteAllocation": {
4181
- "type": "object",
4182
- "nullable": true
4183
- },
4184
- "viaProxy": {
4185
- "type": "boolean",
4186
- "default": false
4187
- }
4188
- }
4189
- },
4190
- "guards": [
4191
- {
4192
- "name": "isEligibleVoter",
4193
- "expression": "context.eligibleVoters.some(v => v.shareholderId === event.shareholderId)"
4194
- },
4195
- {
4196
- "name": "hasNotAlreadyVoted",
4197
- "description": "Shareholder cannot vote twice on same item",
4198
- "expression": "!context.votes.some(v => v.shareholderId === event.shareholderId && v.agendaItemId === event.agendaItemId)"
4199
- },
4200
- {
4201
- "name": "validProxyIfApplicable",
4202
- "description": "If voting via proxy, proxy must be valid",
4203
- "expression": "!event.viaProxy || true",
4204
- "crossMachine": {
4205
- "machine": "corporate-proxy",
4206
- "condition": "event.viaProxy",
4207
- "query": "findByGrantor(event.shareholderId)",
4208
- "requiredState": "ACTIVE"
4209
- }
4210
- }
4211
- ],
4212
- "effects": [
4213
- {
4214
- "type": "APPEND_ARRAY",
4215
- "path": "votes",
4216
- "value": {
4217
- "voteId": "{{ event.voteId }}",
4218
- "agendaItemId": "{{ event.agendaItemId }}",
4219
- "voterId": "{{ event.voterId }}",
4220
- "shareholderId": "{{ event.shareholderId }}",
4221
- "shareClass": "{{ event.shareClass }}",
4222
- "votesFor": "{{ event.votesFor }}",
4223
- "votesAgainst": "{{ event.votesAgainst }}",
4224
- "votesAbstain": "{{ event.votesAbstain }}",
4225
- "votesWithhold": "{{ event.votesWithhold }}",
4226
- "cumulativeVoteAllocation": "{{ event.cumulativeVoteAllocation }}",
4227
- "viaProxy": "{{ event.viaProxy }}",
4228
- "timestamp": "{{ now() }}"
4229
- }
4230
- },
4231
- {
4232
- "type": "UPDATE_ARRAY_ITEM",
4233
- "path": "eligibleVoters",
4234
- "matchKey": "shareholderId",
4235
- "matchValue": "{{ event.shareholderId }}",
4236
- "updates": {
4237
- "hasVoted": true
4238
- }
4239
- }
4240
- ]
4241
- },
4242
- "close_polls": {
4243
- "from": "VOTING",
4244
- "to": "IN_SESSION",
4245
- "description": "Close polls and begin vote tabulation",
4246
- "event": {
4247
- "name": "close_polls",
4248
- "payload": {
4249
- "pollsClosedAt": {
4250
- "type": "string",
4251
- "format": "date-time",
4252
- "required": true
4253
- }
4254
- }
4255
- },
4256
- "effects": [
4257
- {
4258
- "type": "SET_CONTEXT",
4259
- "path": "sessionInfo.pollsClosedAt",
4260
- "value": "{{ event.pollsClosedAt }}"
4261
- },
4262
- {
4263
- "type": "UPDATE_ARRAY_ALL",
4264
- "path": "agenda",
4265
- "updates": {
4266
- "status": "CLOSED"
4267
- }
4268
- },
4269
- {
4270
- "type": "COMPUTE_TALLIES",
4271
- "description": "Aggregate votes by agenda item",
4272
- "targetPath": "voteTallies"
4273
- }
4274
- ]
4275
- },
4276
- "certify_results": {
4277
- "from": "IN_SESSION",
4278
- "to": "CLOSED",
4279
- "description": "Inspector of elections certifies vote results",
4280
- "event": {
4281
- "name": "certify_results",
4282
- "payload": {
4283
- "certifiedAt": {
4284
- "type": "string",
4285
- "format": "date-time",
4286
- "required": true
4287
- },
4288
- "certifiedBy": {
4289
- "type": "string",
4290
- "required": true
4291
- },
4292
- "certificateRef": {
4293
- "type": "string",
4294
- "required": true
4295
- },
4296
- "results": {
4297
- "type": "array",
4298
- "items": {
4299
- "type": "object",
4300
- "properties": {
4301
- "agendaItemId": {
4302
- "type": "string"
4303
- },
4304
- "result": {
4305
- "type": "string",
4306
- "enum": [
4307
- "APPROVED",
4308
- "REJECTED"
4309
- ]
4310
- }
4311
- }
4312
- }
4313
- },
4314
- "minutesRef": {
4315
- "type": "string"
4316
- }
4317
- }
4318
- },
4319
- "effects": [
4320
- {
4321
- "type": "SET_CONTEXT",
4322
- "path": "certification",
4323
- "value": {
4324
- "certifiedAt": "{{ event.certifiedAt }}",
4325
- "certifiedBy": "{{ event.certifiedBy }}",
4326
- "certificateRef": "{{ event.certificateRef }}"
4327
- }
4328
- },
4329
- {
4330
- "type": "SET_CONTEXT",
4331
- "path": "sessionInfo.adjournedAt",
4332
- "value": "{{ event.certifiedAt }}"
4333
- },
4334
- {
4335
- "type": "SET_CONTEXT",
4336
- "path": "sessionInfo.minutesRef",
4337
- "value": "{{ event.minutesRef }}"
4338
- },
4339
- {
4340
- "type": "FOR_EACH",
4341
- "array": "{{ event.results }}",
4342
- "do": {
4343
- "type": "UPDATE_ARRAY_ITEM",
4344
- "path": "voteTallies",
4345
- "matchKey": "agendaItemId",
4346
- "matchValue": "{{ item.agendaItemId }}",
4347
- "updates": {
4348
- "result": "{{ item.result }}",
4349
- "certified": true
4350
- }
4351
- }
4352
- },
4353
- {
4354
- "type": "EMIT_EVENT",
4355
- "eventType": "MEETING_RESULTS_CERTIFIED",
4356
- "payload": {
4357
- "meetingId": "{{ context.meetingId }}",
4358
- "results": "{{ event.results }}"
4359
- }
4360
- }
4361
- ]
4362
- },
4363
- "adjourn_without_action": {
4364
- "from": [
4365
- "IN_SESSION",
4366
- "VOTING"
4367
- ],
4368
- "to": "CLOSED",
4369
- "description": "Adjourn meeting without completing agenda (e.g., quorum lost)",
4370
- "event": {
4371
- "name": "adjourn_without_action",
4372
- "payload": {
4373
- "adjournedAt": {
4374
- "type": "string",
4375
- "format": "date-time",
4376
- "required": true
4377
- },
4378
- "reason": {
4379
- "type": "string",
4380
- "required": true
4381
- },
4382
- "adjournedTo": {
4383
- "type": "string",
4384
- "format": "date-time",
4385
- "nullable": true
4386
- }
4387
- }
4388
- },
4389
- "effects": [
4390
- {
4391
- "type": "SET_CONTEXT",
4392
- "path": "sessionInfo.adjournedAt",
4393
- "value": "{{ event.adjournedAt }}"
4394
- },
4395
- {
4396
- "type": "EMIT_EVENT",
4397
- "eventType": "MEETING_ADJOURNED",
4398
- "payload": {
4399
- "meetingId": "{{ context.meetingId }}",
4400
- "reason": "{{ event.reason }}",
4401
- "adjournedTo": "{{ event.adjournedTo }}"
4402
- }
4403
- }
4404
- ]
4405
- }
4406
- },
4407
- "crossMachineRefs": {
4408
- "entity": {
4409
- "machine": "corporate-entity",
4410
- "description": "Parent corporate entity",
4411
- "foreignKey": "entityId"
4412
- },
4413
- "proxies": {
4414
- "machine": "corporate-proxy",
4415
- "description": "Proxy grants for this meeting",
4416
- "foreignKey": "meetingId"
4417
- },
4418
- "resolutions": {
4419
- "machine": "corporate-resolution",
4420
- "description": "Resolutions resulting from meeting votes",
4421
- "foreignKey": "meetingId"
4422
- },
4423
- "securities": {
4424
- "machine": "corporate-securities",
4425
- "description": "Share records for determining voting rights",
4426
- "foreignKey": "entityId"
4427
- }
4428
- },
4429
- "metadata": {
4430
- "author": "OttoChain",
4431
- "license": "MIT",
4432
- "tags": [
4433
- "corporate",
4434
- "governance",
4435
- "shareholders",
4436
- "voting",
4437
- "meetings",
4438
- "proxy"
4439
- ],
4440
- "documentation": "https://ottochain.dev/docs/corporate/shareholders"
4441
- }
7
+ // Core corporate state machines
8
+ export { corpEntityDef, } from "./corp-entity.js";
9
+ export { corpBoardDef, } from "./corp-board.js";
10
+ export { corpShareholdersDef, } from "./corp-shareholders.js";
11
+ export { corpSecuritiesDef, } from "./corp-securities.js";
12
+ // Re-export all definitions as a collection
13
+ export const corporateStateMachines = {
14
+ corpEntity: () => import("./corp-entity.js").then((m) => m.corpEntityDef),
15
+ corpBoard: () => import("./corp-board.js").then((m) => m.corpBoardDef),
16
+ corpShareholders: () => import("./corp-shareholders.js").then((m) => m.corpShareholdersDef),
17
+ corpSecurities: () => import("./corp-securities.js").then((m) => m.corpSecuritiesDef),
4442
18
  };