@ottochain/sdk 1.4.2 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/cjs/apps/contracts/index.js +6 -10
  2. package/dist/cjs/apps/{governance/state-machines/governance-legislature.json → contracts/state-machines/index.js} +381 -330
  3. package/dist/cjs/apps/corporate/index.js +12 -24
  4. package/dist/cjs/apps/corporate/state-machines/index.js +10246 -0
  5. package/dist/cjs/apps/governance/index.js +11 -22
  6. package/dist/cjs/apps/governance/state-machines/index.js +4755 -0
  7. package/dist/cjs/apps/identity/index.js +3 -6
  8. package/dist/{esm/apps/identity/state-machines/agent-identity.json → cjs/apps/identity/state-machines/index.js} +9 -2
  9. package/dist/cjs/apps/markets/index.js +2 -5
  10. package/dist/{esm/apps/markets/state-machines/market-universal.json → cjs/apps/markets/state-machines/index.js} +9 -2
  11. package/dist/cjs/apps/oracles/index.js +2 -5
  12. package/dist/{esm/apps/oracles/state-machines/oracle.json → cjs/apps/oracles/state-machines/index.js} +9 -2
  13. package/dist/cjs/ottochain/index.js +4 -1
  14. package/dist/cjs/ottochain/normalize.js +40 -15
  15. package/dist/cjs/ottochain/types.js +12 -0
  16. package/dist/esm/apps/contracts/index.js +2 -3
  17. package/dist/esm/apps/{governance/state-machines/governance-legislature.json → contracts/state-machines/index.js} +378 -330
  18. package/dist/esm/apps/corporate/index.js +2 -11
  19. package/dist/esm/apps/corporate/state-machines/index.js +10243 -0
  20. package/dist/esm/apps/governance/index.js +2 -10
  21. package/dist/esm/apps/governance/state-machines/index.js +4752 -0
  22. package/dist/esm/apps/identity/index.js +2 -2
  23. package/dist/{cjs/apps/identity/state-machines/agent-identity.json → esm/apps/identity/state-machines/index.js} +6 -2
  24. package/dist/esm/apps/markets/index.js +1 -1
  25. package/dist/{cjs/apps/markets/state-machines/market-universal.json → esm/apps/markets/state-machines/index.js} +6 -2
  26. package/dist/esm/apps/oracles/index.js +1 -1
  27. package/dist/{cjs/apps/oracles/state-machines/oracle.json → esm/apps/oracles/state-machines/index.js} +6 -2
  28. package/dist/esm/ottochain/index.js +2 -0
  29. package/dist/esm/ottochain/normalize.js +40 -15
  30. package/dist/esm/ottochain/types.js +11 -1
  31. package/dist/types/apps/contracts/state-machines/index.d.ts +549 -0
  32. package/dist/types/apps/corporate/state-machines/index.d.ts +9121 -0
  33. package/dist/types/apps/governance/state-machines/index.d.ts +3551 -0
  34. package/dist/types/apps/identity/state-machines/index.d.ts +206 -0
  35. package/dist/types/apps/markets/state-machines/index.d.ts +448 -0
  36. package/dist/types/apps/oracles/state-machines/index.d.ts +312 -0
  37. package/dist/types/ottochain/index.d.ts +2 -1
  38. package/dist/types/ottochain/normalize.d.ts +21 -8
  39. package/dist/types/ottochain/types.d.ts +12 -1
  40. package/package.json +10 -9
  41. package/dist/cjs/apps/contracts/state-machines/contract.json +0 -352
  42. package/dist/cjs/apps/contracts/state-machines/escrow.json +0 -354
  43. package/dist/cjs/apps/corporate/state-machines/corporate-board.json +0 -1064
  44. package/dist/cjs/apps/corporate/state-machines/corporate-bylaws.json +0 -751
  45. package/dist/cjs/apps/corporate/state-machines/corporate-committee.json +0 -957
  46. package/dist/cjs/apps/corporate/state-machines/corporate-compliance.json +0 -1293
  47. package/dist/cjs/apps/corporate/state-machines/corporate-entity.json +0 -861
  48. package/dist/cjs/apps/corporate/state-machines/corporate-officers.json +0 -843
  49. package/dist/cjs/apps/corporate/state-machines/corporate-proxy.json +0 -783
  50. package/dist/cjs/apps/corporate/state-machines/corporate-resolution.json +0 -1174
  51. package/dist/cjs/apps/corporate/state-machines/corporate-securities.json +0 -1215
  52. package/dist/cjs/apps/corporate/state-machines/corporate-shareholders.json +0 -1298
  53. package/dist/cjs/apps/governance/state-machines/dao-multisig.json +0 -667
  54. package/dist/cjs/apps/governance/state-machines/dao-single.json +0 -230
  55. package/dist/cjs/apps/governance/state-machines/dao-threshold.json +0 -624
  56. package/dist/cjs/apps/governance/state-machines/dao-token.json +0 -638
  57. package/dist/cjs/apps/governance/state-machines/governance-constitution.json +0 -357
  58. package/dist/cjs/apps/governance/state-machines/governance-executive.json +0 -387
  59. package/dist/cjs/apps/governance/state-machines/governance-judiciary.json +0 -558
  60. package/dist/cjs/apps/governance/state-machines/governance-simple.json +0 -625
  61. package/dist/esm/apps/contracts/state-machines/contract.json +0 -352
  62. package/dist/esm/apps/contracts/state-machines/escrow.json +0 -354
  63. package/dist/esm/apps/corporate/state-machines/corporate-board.json +0 -1064
  64. package/dist/esm/apps/corporate/state-machines/corporate-bylaws.json +0 -751
  65. package/dist/esm/apps/corporate/state-machines/corporate-committee.json +0 -957
  66. package/dist/esm/apps/corporate/state-machines/corporate-compliance.json +0 -1293
  67. package/dist/esm/apps/corporate/state-machines/corporate-entity.json +0 -861
  68. package/dist/esm/apps/corporate/state-machines/corporate-officers.json +0 -843
  69. package/dist/esm/apps/corporate/state-machines/corporate-proxy.json +0 -783
  70. package/dist/esm/apps/corporate/state-machines/corporate-resolution.json +0 -1174
  71. package/dist/esm/apps/corporate/state-machines/corporate-securities.json +0 -1215
  72. package/dist/esm/apps/corporate/state-machines/corporate-shareholders.json +0 -1298
  73. package/dist/esm/apps/governance/state-machines/dao-multisig.json +0 -667
  74. package/dist/esm/apps/governance/state-machines/dao-single.json +0 -230
  75. package/dist/esm/apps/governance/state-machines/dao-threshold.json +0 -624
  76. package/dist/esm/apps/governance/state-machines/dao-token.json +0 -638
  77. package/dist/esm/apps/governance/state-machines/governance-constitution.json +0 -357
  78. package/dist/esm/apps/governance/state-machines/governance-executive.json +0 -387
  79. package/dist/esm/apps/governance/state-machines/governance-judiciary.json +0 -558
  80. package/dist/esm/apps/governance/state-machines/governance-simple.json +0 -625
@@ -1,783 +0,0 @@
1
- {
2
- "$schema": "https://ottochain.dev/schemas/state-machine-v1.json",
3
- "name": "corporate-proxy",
4
- "version": "1.0.0",
5
- "category": "corporate-governance",
6
- "description": "Proxy state machine managing the grant, use, and revocation of shareholder voting proxies. Supports meeting-specific and general proxies with revocability controls.",
7
- "context": {
8
- "proxyId": {
9
- "type": "string",
10
- "description": "Unique identifier for this proxy"
11
- },
12
- "entityId": {
13
- "type": "string",
14
- "description": "Reference to parent corporate-entity"
15
- },
16
- "grantorId": {
17
- "type": "string",
18
- "description": "Shareholder granting the proxy"
19
- },
20
- "grantorName": {
21
- "type": "string"
22
- },
23
- "grantorShares": {
24
- "type": "array",
25
- "description": "Shares covered by this proxy",
26
- "items": {
27
- "type": "object",
28
- "properties": {
29
- "shareClass": {
30
- "type": "string"
31
- },
32
- "shares": {
33
- "type": "integer"
34
- },
35
- "votes": {
36
- "type": "integer"
37
- },
38
- "certificateNumbers": {
39
- "type": "array",
40
- "items": {
41
- "type": "string"
42
- },
43
- "nullable": true
44
- }
45
- }
46
- }
47
- },
48
- "totalVotes": {
49
- "type": "integer",
50
- "description": "Total votes represented by this proxy"
51
- },
52
- "holderId": {
53
- "type": "string",
54
- "description": "Person/entity receiving proxy authority"
55
- },
56
- "holderName": {
57
- "type": "string"
58
- },
59
- "holderType": {
60
- "type": "string",
61
- "enum": [
62
- "INDIVIDUAL",
63
- "MANAGEMENT",
64
- "INSTITUTIONAL",
65
- "PROXY_SOLICITOR"
66
- ],
67
- "description": "Type of proxy holder"
68
- },
69
- "proxyType": {
70
- "type": "string",
71
- "enum": [
72
- "SPECIFIC_MEETING",
73
- "GENERAL",
74
- "LIMITED"
75
- ],
76
- "description": "Scope of proxy authority"
77
- },
78
- "scope": {
79
- "type": "object",
80
- "properties": {
81
- "meetingId": {
82
- "type": "string",
83
- "nullable": true,
84
- "description": "For meeting-specific proxies"
85
- },
86
- "meetingDate": {
87
- "type": "string",
88
- "format": "date",
89
- "nullable": true
90
- },
91
- "agendaItems": {
92
- "type": "array",
93
- "items": {
94
- "type": "string"
95
- },
96
- "nullable": true,
97
- "description": "Specific agenda items proxy covers (null = all)"
98
- },
99
- "votingInstructions": {
100
- "type": "array",
101
- "items": {
102
- "type": "object",
103
- "properties": {
104
- "agendaItemId": {
105
- "type": "string"
106
- },
107
- "instruction": {
108
- "type": "string",
109
- "enum": [
110
- "FOR",
111
- "AGAINST",
112
- "ABSTAIN",
113
- "DISCRETIONARY"
114
- ]
115
- },
116
- "cumulativeAllocation": {
117
- "type": "object",
118
- "additionalProperties": {
119
- "type": "integer"
120
- },
121
- "nullable": true,
122
- "description": "For director elections with cumulative voting"
123
- }
124
- }
125
- }
126
- },
127
- "discretionaryAuthority": {
128
- "type": "boolean",
129
- "default": false,
130
- "description": "Can vote on matters not specified"
131
- }
132
- }
133
- },
134
- "grantDate": {
135
- "type": "string",
136
- "format": "date"
137
- },
138
- "effectiveDate": {
139
- "type": "string",
140
- "format": "date"
141
- },
142
- "expirationDate": {
143
- "type": "string",
144
- "format": "date",
145
- "description": "Proxies typically expire after 11 months if not earlier"
146
- },
147
- "revocability": {
148
- "type": "object",
149
- "properties": {
150
- "isRevocable": {
151
- "type": "boolean",
152
- "default": true
153
- },
154
- "irrevocableReason": {
155
- "type": "string",
156
- "enum": [
157
- "COUPLED_WITH_INTEREST",
158
- "VOTING_AGREEMENT",
159
- "PLEDGE"
160
- ],
161
- "nullable": true,
162
- "description": "Reason for irrevocability if applicable"
163
- },
164
- "irrevocableUntil": {
165
- "type": "string",
166
- "format": "date",
167
- "nullable": true
168
- }
169
- }
170
- },
171
- "proxyCard": {
172
- "type": "object",
173
- "description": "Physical or electronic proxy card details",
174
- "properties": {
175
- "cardId": {
176
- "type": "string"
177
- },
178
- "format": {
179
- "type": "string",
180
- "enum": [
181
- "PAPER",
182
- "ELECTRONIC",
183
- "TELEPHONE"
184
- ]
185
- },
186
- "signedDate": {
187
- "type": "string",
188
- "format": "date"
189
- },
190
- "signatureVerified": {
191
- "type": "boolean",
192
- "default": false
193
- },
194
- "documentRef": {
195
- "type": "string"
196
- },
197
- "controlNumber": {
198
- "type": "string",
199
- "description": "Unique control number for voting"
200
- }
201
- }
202
- },
203
- "votesExercised": {
204
- "type": "array",
205
- "description": "Record of votes cast using this proxy",
206
- "items": {
207
- "type": "object",
208
- "properties": {
209
- "meetingId": {
210
- "type": "string"
211
- },
212
- "agendaItemId": {
213
- "type": "string"
214
- },
215
- "voteCast": {
216
- "type": "string",
217
- "enum": [
218
- "FOR",
219
- "AGAINST",
220
- "ABSTAIN",
221
- "WITHHOLD"
222
- ]
223
- },
224
- "voteCount": {
225
- "type": "integer"
226
- },
227
- "votedAt": {
228
- "type": "string",
229
- "format": "date-time"
230
- },
231
- "votedBy": {
232
- "type": "string"
233
- }
234
- }
235
- }
236
- },
237
- "revocationDetails": {
238
- "type": "object",
239
- "nullable": true,
240
- "properties": {
241
- "revokedAt": {
242
- "type": "string",
243
- "format": "date-time"
244
- },
245
- "revokedBy": {
246
- "type": "string"
247
- },
248
- "revocationMethod": {
249
- "type": "string",
250
- "enum": [
251
- "WRITTEN_REVOCATION",
252
- "LATER_PROXY",
253
- "ATTENDANCE_IN_PERSON",
254
- "DEATH_INCAPACITY"
255
- ],
256
- "description": "How the proxy was revoked"
257
- },
258
- "supersedingProxyId": {
259
- "type": "string",
260
- "nullable": true
261
- }
262
- }
263
- },
264
- "createdAt": {
265
- "type": "string",
266
- "format": "date-time"
267
- },
268
- "updatedAt": {
269
- "type": "string",
270
- "format": "date-time"
271
- }
272
- },
273
- "states": {
274
- "GRANTED": {
275
- "description": "Proxy has been granted but not yet active (before effective date or meeting)",
276
- "metadata": null
277
- },
278
- "ACTIVE": {
279
- "description": "Proxy is active and can be used to vote",
280
- "metadata": null
281
- },
282
- "VOTED": {
283
- "description": "Proxy has been used to cast all applicable votes",
284
- "metadata": null,
285
- "terminal": true
286
- },
287
- "REVOKED": {
288
- "description": "Proxy has been revoked by the grantor or superseded",
289
- "metadata": null,
290
- "terminal": true
291
- },
292
- "EXPIRED": {
293
- "description": "Proxy has expired without being fully used",
294
- "metadata": null,
295
- "terminal": true
296
- }
297
- },
298
- "initialState": "GRANTED",
299
- "transitions": {
300
- "grant_proxy": {
301
- "from": null,
302
- "to": "GRANTED",
303
- "description": "Shareholder grants a proxy",
304
- "event": {
305
- "name": "grant_proxy",
306
- "payload": {
307
- "proxyId": {
308
- "type": "string",
309
- "required": true
310
- },
311
- "entityId": {
312
- "type": "string",
313
- "required": true
314
- },
315
- "grantorId": {
316
- "type": "string",
317
- "required": true
318
- },
319
- "grantorName": {
320
- "type": "string",
321
- "required": true
322
- },
323
- "grantorShares": {
324
- "type": "array",
325
- "required": true
326
- },
327
- "holderId": {
328
- "type": "string",
329
- "required": true
330
- },
331
- "holderName": {
332
- "type": "string",
333
- "required": true
334
- },
335
- "holderType": {
336
- "type": "string",
337
- "default": "INDIVIDUAL"
338
- },
339
- "proxyType": {
340
- "type": "string",
341
- "required": true
342
- },
343
- "scope": {
344
- "type": "object",
345
- "required": true
346
- },
347
- "effectiveDate": {
348
- "type": "string",
349
- "format": "date",
350
- "required": true
351
- },
352
- "expirationDate": {
353
- "type": "string",
354
- "format": "date",
355
- "required": true
356
- },
357
- "revocability": {
358
- "type": "object"
359
- },
360
- "proxyCard": {
361
- "type": "object"
362
- }
363
- }
364
- },
365
- "guards": [
366
- {
367
- "name": "grantorIsShareholderOfRecord",
368
- "description": "Grantor must be shareholder of record",
369
- "expression": "event.grantorShares.length > 0"
370
- },
371
- {
372
- "name": "validExpirationDate",
373
- "description": "Expiration cannot exceed 11 months for most proxies",
374
- "expression": "(new Date(event.expirationDate) - new Date(event.effectiveDate)) <= 11 * 30 * 24 * 60 * 60 * 1000"
375
- }
376
- ],
377
- "effects": [
378
- {
379
- "type": "SET_CONTEXT",
380
- "path": "proxyId",
381
- "value": "{{ event.proxyId }}"
382
- },
383
- {
384
- "type": "SET_CONTEXT",
385
- "path": "entityId",
386
- "value": "{{ event.entityId }}"
387
- },
388
- {
389
- "type": "SET_CONTEXT",
390
- "path": "grantorId",
391
- "value": "{{ event.grantorId }}"
392
- },
393
- {
394
- "type": "SET_CONTEXT",
395
- "path": "grantorName",
396
- "value": "{{ event.grantorName }}"
397
- },
398
- {
399
- "type": "SET_CONTEXT",
400
- "path": "grantorShares",
401
- "value": "{{ event.grantorShares }}"
402
- },
403
- {
404
- "type": "COMPUTE",
405
- "path": "totalVotes",
406
- "expression": "event.grantorShares.reduce((sum, s) => sum + s.votes, 0)"
407
- },
408
- {
409
- "type": "SET_CONTEXT",
410
- "path": "holderId",
411
- "value": "{{ event.holderId }}"
412
- },
413
- {
414
- "type": "SET_CONTEXT",
415
- "path": "holderName",
416
- "value": "{{ event.holderName }}"
417
- },
418
- {
419
- "type": "SET_CONTEXT",
420
- "path": "holderType",
421
- "value": "{{ event.holderType }}"
422
- },
423
- {
424
- "type": "SET_CONTEXT",
425
- "path": "proxyType",
426
- "value": "{{ event.proxyType }}"
427
- },
428
- {
429
- "type": "SET_CONTEXT",
430
- "path": "scope",
431
- "value": "{{ event.scope }}"
432
- },
433
- {
434
- "type": "SET_CONTEXT",
435
- "path": "grantDate",
436
- "value": "{{ today() }}"
437
- },
438
- {
439
- "type": "SET_CONTEXT",
440
- "path": "effectiveDate",
441
- "value": "{{ event.effectiveDate }}"
442
- },
443
- {
444
- "type": "SET_CONTEXT",
445
- "path": "expirationDate",
446
- "value": "{{ event.expirationDate }}"
447
- },
448
- {
449
- "type": "SET_CONTEXT",
450
- "path": "revocability",
451
- "value": "{{ event.revocability || { isRevocable: true } }}"
452
- },
453
- {
454
- "type": "SET_CONTEXT",
455
- "path": "proxyCard",
456
- "value": "{{ event.proxyCard }}"
457
- },
458
- {
459
- "type": "SET_CONTEXT",
460
- "path": "votesExercised",
461
- "value": []
462
- },
463
- {
464
- "type": "EMIT_EVENT",
465
- "eventType": "PROXY_GRANTED",
466
- "payload": {
467
- "proxyId": "{{ event.proxyId }}",
468
- "grantorId": "{{ event.grantorId }}",
469
- "holderId": "{{ event.holderId }}",
470
- "totalVotes": "{{ event.grantorShares.reduce((sum, s) => sum + s.votes, 0) }}"
471
- }
472
- }
473
- ]
474
- },
475
- "activate": {
476
- "from": "GRANTED",
477
- "to": "ACTIVE",
478
- "description": "Proxy becomes active (effective date reached or meeting commenced)",
479
- "event": {
480
- "name": "activate",
481
- "payload": {
482
- "activatedAt": {
483
- "type": "string",
484
- "format": "date-time",
485
- "required": true
486
- }
487
- }
488
- },
489
- "guards": [
490
- {
491
- "name": "effectiveDateReached",
492
- "expression": "new Date() >= new Date(context.effectiveDate)"
493
- },
494
- {
495
- "name": "notExpired",
496
- "expression": "new Date() < new Date(context.expirationDate)"
497
- }
498
- ],
499
- "effects": [
500
- {
501
- "type": "EMIT_EVENT",
502
- "eventType": "PROXY_ACTIVATED",
503
- "payload": {
504
- "proxyId": "{{ context.proxyId }}",
505
- "grantorId": "{{ context.grantorId }}"
506
- }
507
- }
508
- ]
509
- },
510
- "vote_proxy": {
511
- "from": "ACTIVE",
512
- "to": "ACTIVE",
513
- "description": "Exercise proxy to cast vote on an agenda item",
514
- "event": {
515
- "name": "vote_proxy",
516
- "payload": {
517
- "meetingId": {
518
- "type": "string",
519
- "required": true
520
- },
521
- "agendaItemId": {
522
- "type": "string",
523
- "required": true
524
- },
525
- "voteCast": {
526
- "type": "string",
527
- "enum": [
528
- "FOR",
529
- "AGAINST",
530
- "ABSTAIN",
531
- "WITHHOLD"
532
- ],
533
- "required": true
534
- },
535
- "votedBy": {
536
- "type": "string",
537
- "required": true,
538
- "description": "Proxy holder exercising vote"
539
- }
540
- }
541
- },
542
- "guards": [
543
- {
544
- "name": "meetingMatches",
545
- "description": "For meeting-specific proxies, meeting must match",
546
- "expression": "context.proxyType !== 'SPECIFIC_MEETING' || context.scope.meetingId === event.meetingId"
547
- },
548
- {
549
- "name": "agendaItemCovered",
550
- "description": "Agenda item must be within proxy scope",
551
- "expression": "context.scope.agendaItems == null || context.scope.agendaItems.includes(event.agendaItemId)"
552
- },
553
- {
554
- "name": "notAlreadyVotedOnItem",
555
- "expression": "!context.votesExercised.some(v => v.meetingId === event.meetingId && v.agendaItemId === event.agendaItemId)"
556
- },
557
- {
558
- "name": "isProxyHolder",
559
- "expression": "event.votedBy === context.holderId"
560
- }
561
- ],
562
- "effects": [
563
- {
564
- "type": "APPEND_ARRAY",
565
- "path": "votesExercised",
566
- "value": {
567
- "meetingId": "{{ event.meetingId }}",
568
- "agendaItemId": "{{ event.agendaItemId }}",
569
- "voteCast": "{{ event.voteCast }}",
570
- "voteCount": "{{ context.totalVotes }}",
571
- "votedAt": "{{ now() }}",
572
- "votedBy": "{{ event.votedBy }}"
573
- }
574
- },
575
- {
576
- "type": "EMIT_EVENT",
577
- "eventType": "PROXY_VOTE_CAST",
578
- "payload": {
579
- "proxyId": "{{ context.proxyId }}",
580
- "grantorId": "{{ context.grantorId }}",
581
- "meetingId": "{{ event.meetingId }}",
582
- "agendaItemId": "{{ event.agendaItemId }}",
583
- "voteCast": "{{ event.voteCast }}",
584
- "voteCount": "{{ context.totalVotes }}"
585
- }
586
- }
587
- ]
588
- },
589
- "complete_voting": {
590
- "from": "ACTIVE",
591
- "to": "VOTED",
592
- "description": "All applicable votes have been cast using this proxy",
593
- "event": {
594
- "name": "complete_voting",
595
- "payload": {
596
- "completedAt": {
597
- "type": "string",
598
- "format": "date-time",
599
- "required": true
600
- },
601
- "meetingId": {
602
- "type": "string",
603
- "required": true
604
- }
605
- }
606
- },
607
- "effects": [
608
- {
609
- "type": "EMIT_EVENT",
610
- "eventType": "PROXY_VOTING_COMPLETED",
611
- "payload": {
612
- "proxyId": "{{ context.proxyId }}",
613
- "grantorId": "{{ context.grantorId }}",
614
- "meetingId": "{{ event.meetingId }}",
615
- "totalVotesExercised": "{{ context.votesExercised.length }}"
616
- }
617
- }
618
- ]
619
- },
620
- "revoke_proxy": {
621
- "from": [
622
- "GRANTED",
623
- "ACTIVE"
624
- ],
625
- "to": "REVOKED",
626
- "description": "Revoke the proxy",
627
- "event": {
628
- "name": "revoke_proxy",
629
- "payload": {
630
- "revokedBy": {
631
- "type": "string",
632
- "required": true
633
- },
634
- "revocationMethod": {
635
- "type": "string",
636
- "required": true
637
- },
638
- "supersedingProxyId": {
639
- "type": "string"
640
- }
641
- }
642
- },
643
- "guards": [
644
- {
645
- "name": "isRevocable",
646
- "description": "Proxy must be revocable (or irrevocability period expired)",
647
- "expression": "context.revocability.isRevocable || (context.revocability.irrevocableUntil && new Date() >= new Date(context.revocability.irrevocableUntil))"
648
- },
649
- {
650
- "name": "revokedByGrantor",
651
- "description": "Only grantor can revoke (or death/incapacity)",
652
- "expression": "event.revokedBy === context.grantorId || event.revocationMethod === 'DEATH_INCAPACITY'"
653
- }
654
- ],
655
- "effects": [
656
- {
657
- "type": "SET_CONTEXT",
658
- "path": "revocationDetails",
659
- "value": {
660
- "revokedAt": "{{ now() }}",
661
- "revokedBy": "{{ event.revokedBy }}",
662
- "revocationMethod": "{{ event.revocationMethod }}",
663
- "supersedingProxyId": "{{ event.supersedingProxyId }}"
664
- }
665
- },
666
- {
667
- "type": "EMIT_EVENT",
668
- "eventType": "PROXY_REVOKED",
669
- "payload": {
670
- "proxyId": "{{ context.proxyId }}",
671
- "grantorId": "{{ context.grantorId }}",
672
- "revocationMethod": "{{ event.revocationMethod }}"
673
- }
674
- }
675
- ]
676
- },
677
- "expire": {
678
- "from": [
679
- "GRANTED",
680
- "ACTIVE"
681
- ],
682
- "to": "EXPIRED",
683
- "description": "Proxy expires",
684
- "event": {
685
- "name": "expire",
686
- "payload": {
687
- "expiredAt": {
688
- "type": "string",
689
- "format": "date-time",
690
- "required": true
691
- }
692
- }
693
- },
694
- "guards": [
695
- {
696
- "name": "isPastExpiration",
697
- "expression": "new Date(event.expiredAt) >= new Date(context.expirationDate)"
698
- }
699
- ],
700
- "effects": [
701
- {
702
- "type": "EMIT_EVENT",
703
- "eventType": "PROXY_EXPIRED",
704
- "payload": {
705
- "proxyId": "{{ context.proxyId }}",
706
- "grantorId": "{{ context.grantorId }}"
707
- }
708
- }
709
- ]
710
- },
711
- "supersede": {
712
- "from": [
713
- "GRANTED",
714
- "ACTIVE"
715
- ],
716
- "to": "REVOKED",
717
- "description": "Proxy superseded by a later proxy from the same grantor",
718
- "event": {
719
- "name": "supersede",
720
- "payload": {
721
- "supersedingProxyId": {
722
- "type": "string",
723
- "required": true
724
- },
725
- "supersededAt": {
726
- "type": "string",
727
- "format": "date-time",
728
- "required": true
729
- }
730
- }
731
- },
732
- "effects": [
733
- {
734
- "type": "SET_CONTEXT",
735
- "path": "revocationDetails",
736
- "value": {
737
- "revokedAt": "{{ event.supersededAt }}",
738
- "revokedBy": "{{ context.grantorId }}",
739
- "revocationMethod": "LATER_PROXY",
740
- "supersedingProxyId": "{{ event.supersedingProxyId }}"
741
- }
742
- },
743
- {
744
- "type": "EMIT_EVENT",
745
- "eventType": "PROXY_SUPERSEDED",
746
- "payload": {
747
- "proxyId": "{{ context.proxyId }}",
748
- "supersedingProxyId": "{{ event.supersedingProxyId }}"
749
- }
750
- }
751
- ]
752
- }
753
- },
754
- "crossMachineRefs": {
755
- "entity": {
756
- "machine": "corporate-entity",
757
- "description": "Parent corporate entity",
758
- "foreignKey": "entityId"
759
- },
760
- "shareholders": {
761
- "machine": "corporate-shareholders",
762
- "description": "Shareholder meeting where proxy may be used",
763
- "foreignKey": "scope.meetingId"
764
- },
765
- "securities": {
766
- "machine": "corporate-securities",
767
- "description": "Shares represented by this proxy",
768
- "foreignKey": "grantorId"
769
- }
770
- },
771
- "metadata": {
772
- "author": "OttoChain",
773
- "license": "MIT",
774
- "tags": [
775
- "corporate",
776
- "governance",
777
- "proxy",
778
- "voting",
779
- "shareholders"
780
- ],
781
- "documentation": "https://ottochain.dev/docs/corporate/proxy"
782
- }
783
- }