@ottochain/sdk 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/cjs/apps/contracts/index.js +6 -10
  2. package/dist/cjs/apps/{governance/state-machines/governance-legislature.json → contracts/state-machines/index.js} +381 -330
  3. package/dist/cjs/apps/corporate/index.js +12 -24
  4. package/dist/cjs/apps/corporate/state-machines/index.js +10246 -0
  5. package/dist/cjs/apps/governance/index.js +11 -22
  6. package/dist/cjs/apps/governance/state-machines/index.js +4755 -0
  7. package/dist/cjs/apps/identity/index.js +3 -6
  8. package/dist/{esm/apps/identity/state-machines/agent-identity.json → cjs/apps/identity/state-machines/index.js} +9 -2
  9. package/dist/cjs/apps/markets/index.js +2 -5
  10. package/dist/{esm/apps/markets/state-machines/market-universal.json → cjs/apps/markets/state-machines/index.js} +9 -2
  11. package/dist/cjs/apps/oracles/index.js +2 -5
  12. package/dist/{esm/apps/oracles/state-machines/oracle.json → cjs/apps/oracles/state-machines/index.js} +9 -2
  13. package/dist/cjs/ottochain/index.js +4 -1
  14. package/dist/cjs/ottochain/normalize.js +17 -3
  15. package/dist/cjs/ottochain/types.js +12 -0
  16. package/dist/esm/apps/contracts/index.js +2 -3
  17. package/dist/esm/apps/{governance/state-machines/governance-legislature.json → contracts/state-machines/index.js} +378 -330
  18. package/dist/esm/apps/corporate/index.js +2 -11
  19. package/dist/esm/apps/corporate/state-machines/index.js +10243 -0
  20. package/dist/esm/apps/governance/index.js +2 -10
  21. package/dist/esm/apps/governance/state-machines/index.js +4752 -0
  22. package/dist/esm/apps/identity/index.js +2 -2
  23. package/dist/{cjs/apps/identity/state-machines/agent-identity.json → esm/apps/identity/state-machines/index.js} +6 -2
  24. package/dist/esm/apps/markets/index.js +1 -1
  25. package/dist/{cjs/apps/markets/state-machines/market-universal.json → esm/apps/markets/state-machines/index.js} +6 -2
  26. package/dist/esm/apps/oracles/index.js +1 -1
  27. package/dist/{cjs/apps/oracles/state-machines/oracle.json → esm/apps/oracles/state-machines/index.js} +6 -2
  28. package/dist/esm/ottochain/index.js +2 -0
  29. package/dist/esm/ottochain/normalize.js +17 -3
  30. package/dist/esm/ottochain/types.js +11 -1
  31. package/dist/types/apps/contracts/state-machines/index.d.ts +549 -0
  32. package/dist/types/apps/corporate/state-machines/index.d.ts +9121 -0
  33. package/dist/types/apps/governance/state-machines/index.d.ts +3551 -0
  34. package/dist/types/apps/identity/state-machines/index.d.ts +206 -0
  35. package/dist/types/apps/markets/state-machines/index.d.ts +448 -0
  36. package/dist/types/apps/oracles/state-machines/index.d.ts +312 -0
  37. package/dist/types/ottochain/index.d.ts +2 -1
  38. package/dist/types/ottochain/normalize.d.ts +14 -0
  39. package/dist/types/ottochain/types.d.ts +9 -0
  40. package/package.json +4 -3
  41. package/dist/cjs/apps/contracts/state-machines/contract.json +0 -352
  42. package/dist/cjs/apps/contracts/state-machines/escrow.json +0 -354
  43. package/dist/cjs/apps/corporate/state-machines/corporate-board.json +0 -1064
  44. package/dist/cjs/apps/corporate/state-machines/corporate-bylaws.json +0 -751
  45. package/dist/cjs/apps/corporate/state-machines/corporate-committee.json +0 -957
  46. package/dist/cjs/apps/corporate/state-machines/corporate-compliance.json +0 -1293
  47. package/dist/cjs/apps/corporate/state-machines/corporate-entity.json +0 -861
  48. package/dist/cjs/apps/corporate/state-machines/corporate-officers.json +0 -843
  49. package/dist/cjs/apps/corporate/state-machines/corporate-proxy.json +0 -783
  50. package/dist/cjs/apps/corporate/state-machines/corporate-resolution.json +0 -1174
  51. package/dist/cjs/apps/corporate/state-machines/corporate-securities.json +0 -1215
  52. package/dist/cjs/apps/corporate/state-machines/corporate-shareholders.json +0 -1298
  53. package/dist/cjs/apps/governance/state-machines/dao-multisig.json +0 -667
  54. package/dist/cjs/apps/governance/state-machines/dao-single.json +0 -230
  55. package/dist/cjs/apps/governance/state-machines/dao-threshold.json +0 -624
  56. package/dist/cjs/apps/governance/state-machines/dao-token.json +0 -638
  57. package/dist/cjs/apps/governance/state-machines/governance-constitution.json +0 -357
  58. package/dist/cjs/apps/governance/state-machines/governance-executive.json +0 -387
  59. package/dist/cjs/apps/governance/state-machines/governance-judiciary.json +0 -558
  60. package/dist/cjs/apps/governance/state-machines/governance-simple.json +0 -625
  61. package/dist/esm/apps/contracts/state-machines/contract.json +0 -352
  62. package/dist/esm/apps/contracts/state-machines/escrow.json +0 -354
  63. package/dist/esm/apps/corporate/state-machines/corporate-board.json +0 -1064
  64. package/dist/esm/apps/corporate/state-machines/corporate-bylaws.json +0 -751
  65. package/dist/esm/apps/corporate/state-machines/corporate-committee.json +0 -957
  66. package/dist/esm/apps/corporate/state-machines/corporate-compliance.json +0 -1293
  67. package/dist/esm/apps/corporate/state-machines/corporate-entity.json +0 -861
  68. package/dist/esm/apps/corporate/state-machines/corporate-officers.json +0 -843
  69. package/dist/esm/apps/corporate/state-machines/corporate-proxy.json +0 -783
  70. package/dist/esm/apps/corporate/state-machines/corporate-resolution.json +0 -1174
  71. package/dist/esm/apps/corporate/state-machines/corporate-securities.json +0 -1215
  72. package/dist/esm/apps/corporate/state-machines/corporate-shareholders.json +0 -1298
  73. package/dist/esm/apps/governance/state-machines/dao-multisig.json +0 -667
  74. package/dist/esm/apps/governance/state-machines/dao-single.json +0 -230
  75. package/dist/esm/apps/governance/state-machines/dao-threshold.json +0 -624
  76. package/dist/esm/apps/governance/state-machines/dao-token.json +0 -638
  77. package/dist/esm/apps/governance/state-machines/governance-constitution.json +0 -357
  78. package/dist/esm/apps/governance/state-machines/governance-executive.json +0 -387
  79. package/dist/esm/apps/governance/state-machines/governance-judiciary.json +0 -558
  80. package/dist/esm/apps/governance/state-machines/governance-simple.json +0 -625
@@ -1,1215 +0,0 @@
1
- {
2
- "$schema": "https://ottochain.dev/schemas/state-machine-v1.json",
3
- "name": "corporate-securities",
4
- "version": "1.0.0",
5
- "category": "corporate-governance",
6
- "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.",
7
- "context": {
8
- "securityId": {
9
- "type": "string",
10
- "description": "Unique identifier for this security lot/certificate"
11
- },
12
- "entityId": {
13
- "type": "string",
14
- "description": "Reference to parent corporate-entity"
15
- },
16
- "shareClass": {
17
- "type": "string",
18
- "description": "Share class ID from corporate-entity"
19
- },
20
- "shareClassName": {
21
- "type": "string",
22
- "description": "Human-readable class name"
23
- },
24
- "certificateNumber": {
25
- "type": "string",
26
- "nullable": true,
27
- "description": "For certificated shares"
28
- },
29
- "cusip": {
30
- "type": "string",
31
- "nullable": true,
32
- "description": "CUSIP number if assigned"
33
- },
34
- "shareCount": {
35
- "type": "integer",
36
- "description": "Number of shares in this lot"
37
- },
38
- "parValue": {
39
- "type": "number",
40
- "description": "Par value per share"
41
- },
42
- "issuancePrice": {
43
- "type": "number",
44
- "nullable": true,
45
- "description": "Price per share at issuance"
46
- },
47
- "issuanceDate": {
48
- "type": "string",
49
- "format": "date",
50
- "nullable": true
51
- },
52
- "form": {
53
- "type": "string",
54
- "enum": [
55
- "CERTIFICATED",
56
- "BOOK_ENTRY",
57
- "DRS"
58
- ],
59
- "description": "Physical certificate, book entry, or Direct Registration System"
60
- },
61
- "holder": {
62
- "type": "object",
63
- "nullable": true,
64
- "properties": {
65
- "holderId": {
66
- "type": "string"
67
- },
68
- "holderType": {
69
- "type": "string",
70
- "enum": [
71
- "INDIVIDUAL",
72
- "ENTITY",
73
- "TRUST",
74
- "TREASURY"
75
- ]
76
- },
77
- "name": {
78
- "type": "string"
79
- },
80
- "taxId": {
81
- "type": "string",
82
- "nullable": true
83
- },
84
- "address": {
85
- "type": "object",
86
- "nullable": true
87
- },
88
- "acquisitionDate": {
89
- "type": "string",
90
- "format": "date"
91
- },
92
- "acquisitionMethod": {
93
- "type": "string",
94
- "enum": [
95
- "ORIGINAL_ISSUANCE",
96
- "PURCHASE",
97
- "GIFT",
98
- "INHERITANCE",
99
- "STOCK_SPLIT",
100
- "CONVERSION",
101
- "EXERCISE"
102
- ]
103
- },
104
- "costBasis": {
105
- "type": "number",
106
- "nullable": true
107
- }
108
- }
109
- },
110
- "restrictions": {
111
- "type": "object",
112
- "properties": {
113
- "isRestricted": {
114
- "type": "boolean",
115
- "default": false
116
- },
117
- "restrictionType": {
118
- "type": "array",
119
- "items": {
120
- "type": "string",
121
- "enum": [
122
- "RULE_144",
123
- "SECTION_4(a)(2)",
124
- "REG_D",
125
- "REG_S",
126
- "LOCK_UP",
127
- "VESTING",
128
- "RIGHT_OF_FIRST_REFUSAL"
129
- ]
130
- }
131
- },
132
- "restrictionEndDate": {
133
- "type": "string",
134
- "format": "date",
135
- "nullable": true
136
- },
137
- "legends": {
138
- "type": "array",
139
- "items": {
140
- "type": "string"
141
- },
142
- "description": "Legend text on certificates"
143
- },
144
- "vestingSchedule": {
145
- "type": "object",
146
- "nullable": true,
147
- "properties": {
148
- "vestingStartDate": {
149
- "type": "string",
150
- "format": "date"
151
- },
152
- "totalShares": {
153
- "type": "integer"
154
- },
155
- "vestedShares": {
156
- "type": "integer"
157
- },
158
- "vestingScheduleRef": {
159
- "type": "string"
160
- }
161
- }
162
- },
163
- "lockUpExpiration": {
164
- "type": "string",
165
- "format": "date",
166
- "nullable": true
167
- },
168
- "rofr": {
169
- "type": "object",
170
- "nullable": true,
171
- "description": "Right of First Refusal",
172
- "properties": {
173
- "holderIds": {
174
- "type": "array",
175
- "items": {
176
- "type": "string"
177
- }
178
- },
179
- "noticePeriodDays": {
180
- "type": "integer"
181
- }
182
- }
183
- }
184
- }
185
- },
186
- "authorization": {
187
- "type": "object",
188
- "nullable": true,
189
- "description": "For shares in AUTHORIZED state",
190
- "properties": {
191
- "authorizedDate": {
192
- "type": "string",
193
- "format": "date"
194
- },
195
- "charterProvision": {
196
- "type": "string"
197
- },
198
- "authorizedShares": {
199
- "type": "integer"
200
- }
201
- }
202
- },
203
- "issuanceDetails": {
204
- "type": "object",
205
- "nullable": true,
206
- "properties": {
207
- "boardResolutionRef": {
208
- "type": "string"
209
- },
210
- "issuanceAgreementRef": {
211
- "type": "string"
212
- },
213
- "consideration": {
214
- "type": "object",
215
- "properties": {
216
- "type": {
217
- "type": "string",
218
- "enum": [
219
- "CASH",
220
- "PROPERTY",
221
- "SERVICES",
222
- "DEBT_CONVERSION",
223
- "STOCK_CONVERSION"
224
- ]
225
- },
226
- "value": {
227
- "type": "number"
228
- },
229
- "description": {
230
- "type": "string"
231
- }
232
- }
233
- },
234
- "exemptionUsed": {
235
- "type": "string",
236
- "nullable": true
237
- },
238
- "accreditedInvestor": {
239
- "type": "boolean",
240
- "nullable": true
241
- }
242
- }
243
- },
244
- "transferHistory": {
245
- "type": "array",
246
- "items": {
247
- "type": "object",
248
- "properties": {
249
- "transferId": {
250
- "type": "string"
251
- },
252
- "transferDate": {
253
- "type": "string",
254
- "format": "date"
255
- },
256
- "fromHolderId": {
257
- "type": "string"
258
- },
259
- "toHolderId": {
260
- "type": "string"
261
- },
262
- "shares": {
263
- "type": "integer"
264
- },
265
- "transferType": {
266
- "type": "string",
267
- "enum": [
268
- "SALE",
269
- "GIFT",
270
- "INHERITANCE",
271
- "INTERNAL"
272
- ]
273
- },
274
- "pricePerShare": {
275
- "type": "number",
276
- "nullable": true
277
- },
278
- "transferAgentConfirmation": {
279
- "type": "string",
280
- "nullable": true
281
- }
282
- }
283
- }
284
- },
285
- "corporateActions": {
286
- "type": "array",
287
- "description": "Stock splits, dividends, etc. affecting this lot",
288
- "items": {
289
- "type": "object",
290
- "properties": {
291
- "actionId": {
292
- "type": "string"
293
- },
294
- "actionType": {
295
- "type": "string",
296
- "enum": [
297
- "STOCK_SPLIT",
298
- "REVERSE_SPLIT",
299
- "STOCK_DIVIDEND",
300
- "CONVERSION",
301
- "RECLASSIFICATION"
302
- ]
303
- },
304
- "actionDate": {
305
- "type": "string",
306
- "format": "date"
307
- },
308
- "ratio": {
309
- "type": "string",
310
- "nullable": true,
311
- "description": "e.g., 2:1 for split"
312
- },
313
- "sharesBeforeAction": {
314
- "type": "integer"
315
- },
316
- "sharesAfterAction": {
317
- "type": "integer"
318
- },
319
- "resolutionRef": {
320
- "type": "string"
321
- }
322
- }
323
- }
324
- },
325
- "retirementDetails": {
326
- "type": "object",
327
- "nullable": true,
328
- "properties": {
329
- "retiredDate": {
330
- "type": "string",
331
- "format": "date"
332
- },
333
- "retirementMethod": {
334
- "type": "string",
335
- "enum": [
336
- "REPURCHASE",
337
- "REDEMPTION",
338
- "CANCELLATION",
339
- "CONVERSION"
340
- ]
341
- },
342
- "repurchasePrice": {
343
- "type": "number",
344
- "nullable": true
345
- },
346
- "boardResolutionRef": {
347
- "type": "string"
348
- }
349
- }
350
- },
351
- "createdAt": {
352
- "type": "string",
353
- "format": "date-time"
354
- },
355
- "updatedAt": {
356
- "type": "string",
357
- "format": "date-time"
358
- }
359
- },
360
- "states": {
361
- "AUTHORIZED": {
362
- "description": "Shares authorized by charter but not yet issued",
363
- "metadata": null
364
- },
365
- "ISSUED": {
366
- "description": "Shares issued and held by a shareholder",
367
- "metadata": null
368
- },
369
- "TREASURY": {
370
- "description": "Shares repurchased and held by the company",
371
- "metadata": null
372
- },
373
- "TRANSFERRED": {
374
- "description": "Transitional state during transfer between holders",
375
- "metadata": null
376
- },
377
- "RETIRED": {
378
- "description": "Shares cancelled and returned to authorized but unissued",
379
- "metadata": null,
380
- "terminal": true
381
- }
382
- },
383
- "initialState": "AUTHORIZED",
384
- "transitions": {
385
- "authorize_shares": {
386
- "from": null,
387
- "to": "AUTHORIZED",
388
- "description": "Record shares as authorized per charter/amendment",
389
- "event": {
390
- "name": "authorize_shares",
391
- "payload": {
392
- "securityId": {
393
- "type": "string",
394
- "required": true
395
- },
396
- "entityId": {
397
- "type": "string",
398
- "required": true
399
- },
400
- "shareClass": {
401
- "type": "string",
402
- "required": true
403
- },
404
- "shareClassName": {
405
- "type": "string",
406
- "required": true
407
- },
408
- "shareCount": {
409
- "type": "integer",
410
- "required": true
411
- },
412
- "parValue": {
413
- "type": "number",
414
- "required": true
415
- },
416
- "authorizedDate": {
417
- "type": "string",
418
- "format": "date",
419
- "required": true
420
- },
421
- "charterProvision": {
422
- "type": "string"
423
- }
424
- }
425
- },
426
- "effects": [
427
- {
428
- "type": "SET_CONTEXT",
429
- "path": "securityId",
430
- "value": "{{ event.securityId }}"
431
- },
432
- {
433
- "type": "SET_CONTEXT",
434
- "path": "entityId",
435
- "value": "{{ event.entityId }}"
436
- },
437
- {
438
- "type": "SET_CONTEXT",
439
- "path": "shareClass",
440
- "value": "{{ event.shareClass }}"
441
- },
442
- {
443
- "type": "SET_CONTEXT",
444
- "path": "shareClassName",
445
- "value": "{{ event.shareClassName }}"
446
- },
447
- {
448
- "type": "SET_CONTEXT",
449
- "path": "shareCount",
450
- "value": "{{ event.shareCount }}"
451
- },
452
- {
453
- "type": "SET_CONTEXT",
454
- "path": "parValue",
455
- "value": "{{ event.parValue }}"
456
- },
457
- {
458
- "type": "SET_CONTEXT",
459
- "path": "authorization",
460
- "value": {
461
- "authorizedDate": "{{ event.authorizedDate }}",
462
- "charterProvision": "{{ event.charterProvision }}",
463
- "authorizedShares": "{{ event.shareCount }}"
464
- }
465
- },
466
- {
467
- "type": "SET_CONTEXT",
468
- "path": "transferHistory",
469
- "value": []
470
- },
471
- {
472
- "type": "SET_CONTEXT",
473
- "path": "corporateActions",
474
- "value": []
475
- }
476
- ]
477
- },
478
- "issue_shares": {
479
- "from": "AUTHORIZED",
480
- "to": "ISSUED",
481
- "description": "Issue shares to a holder",
482
- "event": {
483
- "name": "issue_shares",
484
- "payload": {
485
- "holderId": {
486
- "type": "string",
487
- "required": true
488
- },
489
- "holderType": {
490
- "type": "string",
491
- "required": true
492
- },
493
- "holderName": {
494
- "type": "string",
495
- "required": true
496
- },
497
- "address": {
498
- "type": "object"
499
- },
500
- "issuanceDate": {
501
- "type": "string",
502
- "format": "date",
503
- "required": true
504
- },
505
- "issuancePrice": {
506
- "type": "number"
507
- },
508
- "form": {
509
- "type": "string",
510
- "enum": [
511
- "CERTIFICATED",
512
- "BOOK_ENTRY",
513
- "DRS"
514
- ],
515
- "required": true
516
- },
517
- "certificateNumber": {
518
- "type": "string"
519
- },
520
- "boardResolutionRef": {
521
- "type": "string",
522
- "required": true
523
- },
524
- "consideration": {
525
- "type": "object",
526
- "required": true
527
- },
528
- "isRestricted": {
529
- "type": "boolean",
530
- "default": false
531
- },
532
- "restrictionType": {
533
- "type": "array"
534
- },
535
- "legends": {
536
- "type": "array"
537
- },
538
- "exemptionUsed": {
539
- "type": "string"
540
- },
541
- "accreditedInvestor": {
542
- "type": "boolean"
543
- }
544
- }
545
- },
546
- "guards": [
547
- {
548
- "name": "hasIssuanceResolution",
549
- "description": "Board must have approved stock issuance",
550
- "crossMachine": {
551
- "machine": "corporate-resolution",
552
- "instanceRef": "{{ event.boardResolutionRef }}",
553
- "requiredState": "EXECUTED"
554
- }
555
- },
556
- {
557
- "name": "entityIsActive",
558
- "description": "Cannot issue stock if corporation is suspended or dissolved",
559
- "crossMachine": {
560
- "machine": "corporate-entity",
561
- "instanceRef": "{{ context.entityId }}",
562
- "requiredState": "ACTIVE"
563
- }
564
- }
565
- ],
566
- "effects": [
567
- {
568
- "type": "SET_CONTEXT",
569
- "path": "form",
570
- "value": "{{ event.form }}"
571
- },
572
- {
573
- "type": "SET_CONTEXT",
574
- "path": "certificateNumber",
575
- "value": "{{ event.certificateNumber }}"
576
- },
577
- {
578
- "type": "SET_CONTEXT",
579
- "path": "issuanceDate",
580
- "value": "{{ event.issuanceDate }}"
581
- },
582
- {
583
- "type": "SET_CONTEXT",
584
- "path": "issuancePrice",
585
- "value": "{{ event.issuancePrice }}"
586
- },
587
- {
588
- "type": "SET_CONTEXT",
589
- "path": "holder",
590
- "value": {
591
- "holderId": "{{ event.holderId }}",
592
- "holderType": "{{ event.holderType }}",
593
- "name": "{{ event.holderName }}",
594
- "address": "{{ event.address }}",
595
- "acquisitionDate": "{{ event.issuanceDate }}",
596
- "acquisitionMethod": "ORIGINAL_ISSUANCE",
597
- "costBasis": "{{ event.issuancePrice * context.shareCount }}"
598
- }
599
- },
600
- {
601
- "type": "SET_CONTEXT",
602
- "path": "restrictions",
603
- "value": {
604
- "isRestricted": "{{ event.isRestricted }}",
605
- "restrictionType": "{{ event.restrictionType }}",
606
- "legends": "{{ event.legends }}"
607
- }
608
- },
609
- {
610
- "type": "SET_CONTEXT",
611
- "path": "issuanceDetails",
612
- "value": {
613
- "boardResolutionRef": "{{ event.boardResolutionRef }}",
614
- "consideration": "{{ event.consideration }}",
615
- "exemptionUsed": "{{ event.exemptionUsed }}",
616
- "accreditedInvestor": "{{ event.accreditedInvestor }}"
617
- }
618
- },
619
- {
620
- "type": "EMIT_EVENT",
621
- "eventType": "SHARES_ISSUED",
622
- "payload": {
623
- "securityId": "{{ context.securityId }}",
624
- "entityId": "{{ context.entityId }}",
625
- "shareClass": "{{ context.shareClassName }}",
626
- "shares": "{{ context.shareCount }}",
627
- "holderId": "{{ event.holderId }}",
628
- "holderName": "{{ event.holderName }}"
629
- }
630
- }
631
- ]
632
- },
633
- "initiate_transfer": {
634
- "from": "ISSUED",
635
- "to": "TRANSFERRED",
636
- "description": "Begin transfer of shares to new holder",
637
- "event": {
638
- "name": "initiate_transfer",
639
- "payload": {
640
- "transferId": {
641
- "type": "string",
642
- "required": true
643
- },
644
- "toHolderId": {
645
- "type": "string",
646
- "required": true
647
- },
648
- "toHolderName": {
649
- "type": "string",
650
- "required": true
651
- },
652
- "toHolderType": {
653
- "type": "string",
654
- "required": true
655
- },
656
- "toAddress": {
657
- "type": "object"
658
- },
659
- "transferType": {
660
- "type": "string",
661
- "required": true
662
- },
663
- "pricePerShare": {
664
- "type": "number"
665
- },
666
- "transferDate": {
667
- "type": "string",
668
- "format": "date",
669
- "required": true
670
- }
671
- }
672
- },
673
- "guards": [
674
- {
675
- "name": "restrictionsCleared",
676
- "description": "Must clear any transfer restrictions",
677
- "expression": "!context.restrictions.isRestricted || context.restrictions.restrictionEndDate == null || new Date() >= new Date(context.restrictions.restrictionEndDate)"
678
- },
679
- {
680
- "name": "rofrSatisfied",
681
- "description": "Right of first refusal must be waived or expired",
682
- "expression": "context.restrictions.rofr == null"
683
- }
684
- ],
685
- "effects": [
686
- {
687
- "type": "APPEND_ARRAY",
688
- "path": "transferHistory",
689
- "value": {
690
- "transferId": "{{ event.transferId }}",
691
- "transferDate": "{{ event.transferDate }}",
692
- "fromHolderId": "{{ context.holder.holderId }}",
693
- "toHolderId": "{{ event.toHolderId }}",
694
- "shares": "{{ context.shareCount }}",
695
- "transferType": "{{ event.transferType }}",
696
- "pricePerShare": "{{ event.pricePerShare }}"
697
- }
698
- },
699
- {
700
- "type": "EMIT_EVENT",
701
- "eventType": "TRANSFER_INITIATED",
702
- "payload": {
703
- "securityId": "{{ context.securityId }}",
704
- "transferId": "{{ event.transferId }}",
705
- "fromHolderId": "{{ context.holder.holderId }}",
706
- "toHolderId": "{{ event.toHolderId }}"
707
- }
708
- }
709
- ]
710
- },
711
- "complete_transfer": {
712
- "from": "TRANSFERRED",
713
- "to": "ISSUED",
714
- "description": "Complete the transfer, update holder",
715
- "event": {
716
- "name": "complete_transfer",
717
- "payload": {
718
- "transferAgentConfirmation": {
719
- "type": "string"
720
- },
721
- "newCertificateNumber": {
722
- "type": "string"
723
- },
724
- "toHolderId": {
725
- "type": "string",
726
- "required": true
727
- },
728
- "toHolderName": {
729
- "type": "string",
730
- "required": true
731
- },
732
- "toHolderType": {
733
- "type": "string",
734
- "required": true
735
- },
736
- "toAddress": {
737
- "type": "object"
738
- },
739
- "completedDate": {
740
- "type": "string",
741
- "format": "date",
742
- "required": true
743
- },
744
- "costBasis": {
745
- "type": "number"
746
- }
747
- }
748
- },
749
- "effects": [
750
- {
751
- "type": "SET_CONTEXT",
752
- "path": "holder",
753
- "value": {
754
- "holderId": "{{ event.toHolderId }}",
755
- "holderType": "{{ event.toHolderType }}",
756
- "name": "{{ event.toHolderName }}",
757
- "address": "{{ event.toAddress }}",
758
- "acquisitionDate": "{{ event.completedDate }}",
759
- "acquisitionMethod": "PURCHASE",
760
- "costBasis": "{{ event.costBasis }}"
761
- }
762
- },
763
- {
764
- "type": "CONDITIONAL",
765
- "condition": "event.newCertificateNumber != null",
766
- "then": {
767
- "type": "SET_CONTEXT",
768
- "path": "certificateNumber",
769
- "value": "{{ event.newCertificateNumber }}"
770
- }
771
- },
772
- {
773
- "type": "UPDATE_ARRAY_ITEM",
774
- "path": "transferHistory",
775
- "matchKey": "toHolderId",
776
- "matchValue": "{{ event.toHolderId }}",
777
- "updates": {
778
- "transferAgentConfirmation": "{{ event.transferAgentConfirmation }}"
779
- }
780
- },
781
- {
782
- "type": "EMIT_EVENT",
783
- "eventType": "TRANSFER_COMPLETED",
784
- "payload": {
785
- "securityId": "{{ context.securityId }}",
786
- "newHolderId": "{{ event.toHolderId }}"
787
- }
788
- }
789
- ]
790
- },
791
- "repurchase": {
792
- "from": "ISSUED",
793
- "to": "TREASURY",
794
- "description": "Company repurchases shares from holder",
795
- "event": {
796
- "name": "repurchase",
797
- "payload": {
798
- "repurchaseDate": {
799
- "type": "string",
800
- "format": "date",
801
- "required": true
802
- },
803
- "pricePerShare": {
804
- "type": "number",
805
- "required": true
806
- },
807
- "boardResolutionRef": {
808
- "type": "string",
809
- "required": true
810
- },
811
- "repurchaseAgreementRef": {
812
- "type": "string"
813
- }
814
- }
815
- },
816
- "guards": [
817
- {
818
- "name": "hasRepurchaseResolution",
819
- "crossMachine": {
820
- "machine": "corporate-resolution",
821
- "instanceRef": "{{ event.boardResolutionRef }}",
822
- "requiredState": "EXECUTED"
823
- }
824
- }
825
- ],
826
- "effects": [
827
- {
828
- "type": "APPEND_ARRAY",
829
- "path": "transferHistory",
830
- "value": {
831
- "transferId": "REPURCHASE-{{ event.repurchaseDate }}",
832
- "transferDate": "{{ event.repurchaseDate }}",
833
- "fromHolderId": "{{ context.holder.holderId }}",
834
- "toHolderId": "TREASURY",
835
- "shares": "{{ context.shareCount }}",
836
- "transferType": "INTERNAL",
837
- "pricePerShare": "{{ event.pricePerShare }}"
838
- }
839
- },
840
- {
841
- "type": "SET_CONTEXT",
842
- "path": "holder",
843
- "value": {
844
- "holderId": "TREASURY",
845
- "holderType": "TREASURY",
846
- "name": "Treasury Stock",
847
- "acquisitionDate": "{{ event.repurchaseDate }}",
848
- "acquisitionMethod": "PURCHASE",
849
- "costBasis": "{{ event.pricePerShare * context.shareCount }}"
850
- }
851
- },
852
- {
853
- "type": "EMIT_EVENT",
854
- "eventType": "SHARES_REPURCHASED",
855
- "payload": {
856
- "securityId": "{{ context.securityId }}",
857
- "shares": "{{ context.shareCount }}",
858
- "pricePerShare": "{{ event.pricePerShare }}"
859
- }
860
- }
861
- ]
862
- },
863
- "reissue_from_treasury": {
864
- "from": "TREASURY",
865
- "to": "ISSUED",
866
- "description": "Reissue treasury shares to a new holder",
867
- "event": {
868
- "name": "reissue_from_treasury",
869
- "payload": {
870
- "holderId": {
871
- "type": "string",
872
- "required": true
873
- },
874
- "holderName": {
875
- "type": "string",
876
- "required": true
877
- },
878
- "holderType": {
879
- "type": "string",
880
- "required": true
881
- },
882
- "address": {
883
- "type": "object"
884
- },
885
- "reissueDate": {
886
- "type": "string",
887
- "format": "date",
888
- "required": true
889
- },
890
- "issuancePrice": {
891
- "type": "number"
892
- },
893
- "boardResolutionRef": {
894
- "type": "string",
895
- "required": true
896
- }
897
- }
898
- },
899
- "guards": [
900
- {
901
- "name": "hasReissueResolution",
902
- "crossMachine": {
903
- "machine": "corporate-resolution",
904
- "instanceRef": "{{ event.boardResolutionRef }}",
905
- "requiredState": "EXECUTED"
906
- }
907
- }
908
- ],
909
- "effects": [
910
- {
911
- "type": "SET_CONTEXT",
912
- "path": "holder",
913
- "value": {
914
- "holderId": "{{ event.holderId }}",
915
- "holderType": "{{ event.holderType }}",
916
- "name": "{{ event.holderName }}",
917
- "address": "{{ event.address }}",
918
- "acquisitionDate": "{{ event.reissueDate }}",
919
- "acquisitionMethod": "PURCHASE",
920
- "costBasis": "{{ event.issuancePrice * context.shareCount }}"
921
- }
922
- },
923
- {
924
- "type": "EMIT_EVENT",
925
- "eventType": "TREASURY_SHARES_REISSUED",
926
- "payload": {
927
- "securityId": "{{ context.securityId }}",
928
- "holderId": "{{ event.holderId }}"
929
- }
930
- }
931
- ]
932
- },
933
- "retire": {
934
- "from": [
935
- "ISSUED",
936
- "TREASURY"
937
- ],
938
- "to": "RETIRED",
939
- "description": "Retire shares (cancel them)",
940
- "event": {
941
- "name": "retire",
942
- "payload": {
943
- "retiredDate": {
944
- "type": "string",
945
- "format": "date",
946
- "required": true
947
- },
948
- "retirementMethod": {
949
- "type": "string",
950
- "required": true
951
- },
952
- "boardResolutionRef": {
953
- "type": "string",
954
- "required": true
955
- },
956
- "repurchasePrice": {
957
- "type": "number"
958
- }
959
- }
960
- },
961
- "guards": [
962
- {
963
- "name": "hasRetirementResolution",
964
- "crossMachine": {
965
- "machine": "corporate-resolution",
966
- "instanceRef": "{{ event.boardResolutionRef }}",
967
- "requiredState": "EXECUTED"
968
- }
969
- }
970
- ],
971
- "effects": [
972
- {
973
- "type": "SET_CONTEXT",
974
- "path": "retirementDetails",
975
- "value": {
976
- "retiredDate": "{{ event.retiredDate }}",
977
- "retirementMethod": "{{ event.retirementMethod }}",
978
- "repurchasePrice": "{{ event.repurchasePrice }}",
979
- "boardResolutionRef": "{{ event.boardResolutionRef }}"
980
- }
981
- },
982
- {
983
- "type": "SET_CONTEXT",
984
- "path": "holder",
985
- "value": null
986
- },
987
- {
988
- "type": "EMIT_EVENT",
989
- "eventType": "SHARES_RETIRED",
990
- "payload": {
991
- "securityId": "{{ context.securityId }}",
992
- "shareClass": "{{ context.shareClassName }}",
993
- "shares": "{{ context.shareCount }}"
994
- }
995
- }
996
- ]
997
- },
998
- "stock_split": {
999
- "from": "ISSUED",
1000
- "to": "ISSUED",
1001
- "description": "Apply stock split to this lot",
1002
- "event": {
1003
- "name": "stock_split",
1004
- "payload": {
1005
- "actionId": {
1006
- "type": "string",
1007
- "required": true
1008
- },
1009
- "splitRatio": {
1010
- "type": "string",
1011
- "required": true,
1012
- "description": "e.g., '2:1' for 2-for-1 split"
1013
- },
1014
- "effectiveDate": {
1015
- "type": "string",
1016
- "format": "date",
1017
- "required": true
1018
- },
1019
- "resolutionRef": {
1020
- "type": "string",
1021
- "required": true
1022
- },
1023
- "newShareCount": {
1024
- "type": "integer",
1025
- "required": true
1026
- }
1027
- }
1028
- },
1029
- "effects": [
1030
- {
1031
- "type": "APPEND_ARRAY",
1032
- "path": "corporateActions",
1033
- "value": {
1034
- "actionId": "{{ event.actionId }}",
1035
- "actionType": "STOCK_SPLIT",
1036
- "actionDate": "{{ event.effectiveDate }}",
1037
- "ratio": "{{ event.splitRatio }}",
1038
- "sharesBeforeAction": "{{ context.shareCount }}",
1039
- "sharesAfterAction": "{{ event.newShareCount }}",
1040
- "resolutionRef": "{{ event.resolutionRef }}"
1041
- }
1042
- },
1043
- {
1044
- "type": "SET_CONTEXT",
1045
- "path": "shareCount",
1046
- "value": "{{ event.newShareCount }}"
1047
- },
1048
- {
1049
- "type": "EMIT_EVENT",
1050
- "eventType": "STOCK_SPLIT_APPLIED",
1051
- "payload": {
1052
- "securityId": "{{ context.securityId }}",
1053
- "ratio": "{{ event.splitRatio }}",
1054
- "newShareCount": "{{ event.newShareCount }}"
1055
- }
1056
- }
1057
- ]
1058
- },
1059
- "declare_dividend": {
1060
- "from": "ISSUED",
1061
- "to": "ISSUED",
1062
- "description": "Record dividend declaration affecting this lot (for stock dividends)",
1063
- "event": {
1064
- "name": "declare_dividend",
1065
- "payload": {
1066
- "actionId": {
1067
- "type": "string",
1068
- "required": true
1069
- },
1070
- "dividendType": {
1071
- "type": "string",
1072
- "enum": [
1073
- "CASH",
1074
- "STOCK"
1075
- ],
1076
- "required": true
1077
- },
1078
- "recordDate": {
1079
- "type": "string",
1080
- "format": "date",
1081
- "required": true
1082
- },
1083
- "paymentDate": {
1084
- "type": "string",
1085
- "format": "date",
1086
- "required": true
1087
- },
1088
- "cashAmount": {
1089
- "type": "number"
1090
- },
1091
- "stockShares": {
1092
- "type": "integer"
1093
- },
1094
- "resolutionRef": {
1095
- "type": "string",
1096
- "required": true
1097
- }
1098
- }
1099
- },
1100
- "guards": [
1101
- {
1102
- "name": "hasDividendResolution",
1103
- "crossMachine": {
1104
- "machine": "corporate-resolution",
1105
- "instanceRef": "{{ event.resolutionRef }}",
1106
- "requiredState": "EXECUTED"
1107
- }
1108
- }
1109
- ],
1110
- "effects": [
1111
- {
1112
- "type": "CONDITIONAL",
1113
- "condition": "event.dividendType === 'STOCK'",
1114
- "then": {
1115
- "type": "APPEND_ARRAY",
1116
- "path": "corporateActions",
1117
- "value": {
1118
- "actionId": "{{ event.actionId }}",
1119
- "actionType": "STOCK_DIVIDEND",
1120
- "actionDate": "{{ event.paymentDate }}",
1121
- "sharesBeforeAction": "{{ context.shareCount }}",
1122
- "sharesAfterAction": "{{ context.shareCount + event.stockShares }}",
1123
- "resolutionRef": "{{ event.resolutionRef }}"
1124
- }
1125
- }
1126
- },
1127
- {
1128
- "type": "CONDITIONAL",
1129
- "condition": "event.dividendType === 'STOCK'",
1130
- "then": {
1131
- "type": "INCREMENT",
1132
- "path": "shareCount",
1133
- "amount": "{{ event.stockShares }}"
1134
- }
1135
- }
1136
- ]
1137
- },
1138
- "remove_restriction": {
1139
- "from": "ISSUED",
1140
- "to": "ISSUED",
1141
- "description": "Remove or update restrictions on the shares",
1142
- "event": {
1143
- "name": "remove_restriction",
1144
- "payload": {
1145
- "restrictionType": {
1146
- "type": "string",
1147
- "required": true
1148
- },
1149
- "removedDate": {
1150
- "type": "string",
1151
- "format": "date",
1152
- "required": true
1153
- },
1154
- "reason": {
1155
- "type": "string"
1156
- },
1157
- "legalOpinionRef": {
1158
- "type": "string"
1159
- }
1160
- }
1161
- },
1162
- "effects": [
1163
- {
1164
- "type": "UPDATE_ARRAY",
1165
- "path": "restrictions.restrictionType",
1166
- "operation": "REMOVE",
1167
- "value": "{{ event.restrictionType }}"
1168
- },
1169
- {
1170
- "type": "COMPUTE",
1171
- "path": "restrictions.isRestricted",
1172
- "expression": "context.restrictions.restrictionType.length > 0"
1173
- },
1174
- {
1175
- "type": "EMIT_EVENT",
1176
- "eventType": "RESTRICTION_REMOVED",
1177
- "payload": {
1178
- "securityId": "{{ context.securityId }}",
1179
- "restrictionType": "{{ event.restrictionType }}"
1180
- }
1181
- }
1182
- ]
1183
- }
1184
- },
1185
- "crossMachineRefs": {
1186
- "entity": {
1187
- "machine": "corporate-entity",
1188
- "description": "Parent corporate entity with share class definitions",
1189
- "foreignKey": "entityId"
1190
- },
1191
- "resolutions": {
1192
- "machine": "corporate-resolution",
1193
- "description": "Board resolutions authorizing securities actions",
1194
- "foreignKey": "entityId"
1195
- },
1196
- "shareholders": {
1197
- "machine": "corporate-shareholders",
1198
- "description": "Shareholder meetings for determining voting rights",
1199
- "foreignKey": "entityId"
1200
- }
1201
- },
1202
- "metadata": {
1203
- "author": "OttoChain",
1204
- "license": "MIT",
1205
- "tags": [
1206
- "corporate",
1207
- "governance",
1208
- "securities",
1209
- "stock",
1210
- "equity",
1211
- "certificates"
1212
- ],
1213
- "documentation": "https://ottochain.dev/docs/corporate/securities"
1214
- }
1215
- }