@ottochain/sdk 2.4.0 → 2.5.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 (225) hide show
  1. package/dist/cjs/apps/compute/index.js +33 -0
  2. package/dist/cjs/apps/compute/state-machines/compute-rule110.js +164 -0
  3. package/dist/cjs/apps/compute/state-machines/index.js +9 -0
  4. package/dist/cjs/apps/contracts/index.js +1 -1
  5. package/dist/cjs/apps/contracts/state-machines/contract-agreement.js +126 -148
  6. package/dist/cjs/apps/contracts/state-machines/contract-escrow.js +153 -174
  7. package/dist/cjs/apps/contracts/state-machines/contract-universal.js +46 -58
  8. package/dist/cjs/apps/corporate/state-machines/corp-board.js +415 -481
  9. package/dist/cjs/apps/corporate/state-machines/corp-entity.js +368 -440
  10. package/dist/cjs/apps/corporate/state-machines/corp-securities.js +532 -647
  11. package/dist/cjs/apps/corporate/state-machines/corp-shareholders.js +499 -603
  12. package/dist/cjs/apps/governance/index.js +7 -7
  13. package/dist/cjs/apps/governance/state-machines/dao-multisig.js +170 -209
  14. package/dist/cjs/apps/governance/state-machines/dao-reputation.js +161 -214
  15. package/dist/cjs/apps/governance/state-machines/dao-single.js +92 -92
  16. package/dist/cjs/apps/governance/state-machines/dao-token.js +169 -223
  17. package/dist/cjs/apps/governance/state-machines/governance-simple.js +185 -217
  18. package/dist/cjs/apps/governance/state-machines/governance-universal.js +64 -64
  19. package/dist/cjs/apps/identity/constants.js +16 -24
  20. package/dist/cjs/apps/identity/index.js +1 -1
  21. package/dist/cjs/apps/identity/state-machines/identity-agent.js +124 -158
  22. package/dist/cjs/apps/identity/state-machines/identity-oracle.js +151 -169
  23. package/dist/cjs/apps/identity/state-machines/identity-registry.js +89 -115
  24. package/dist/cjs/apps/identity/state-machines/identity-universal.js +51 -57
  25. package/dist/cjs/apps/index.js +4 -1
  26. package/dist/cjs/apps/lending/assets.js +41 -17
  27. package/dist/cjs/apps/lending/credit-scoring.js +4 -4
  28. package/dist/cjs/apps/lending/eligibility.js +9 -25
  29. package/dist/cjs/apps/lending/index.js +1 -1
  30. package/dist/cjs/apps/lending/state-machines/lending-zk-loan.js +177 -156
  31. package/dist/cjs/apps/markets/index.js +1 -1
  32. package/dist/cjs/apps/markets/state-machines/market-auction.js +115 -134
  33. package/dist/cjs/apps/markets/state-machines/market-crowdfund.js +122 -137
  34. package/dist/cjs/apps/markets/state-machines/market-group-buy.js +158 -177
  35. package/dist/cjs/apps/markets/state-machines/market-prediction.js +193 -227
  36. package/dist/cjs/apps/markets/state-machines/market-universal.js +65 -80
  37. package/dist/cjs/apps/oracles/index.js +1 -1
  38. package/dist/cjs/apps/privacy/index.js +67 -0
  39. package/dist/cjs/apps/privacy/state-machines/index.js +17 -0
  40. package/dist/cjs/apps/privacy/state-machines/mixer-ddhRing.js +286 -0
  41. package/dist/cjs/apps/privacy/state-machines/note-pool.js +476 -0
  42. package/dist/cjs/apps/staked-pool/assets.js +103 -0
  43. package/dist/cjs/apps/staked-pool/base.js +498 -0
  44. package/dist/cjs/apps/staked-pool/consumer.js +55 -0
  45. package/dist/cjs/apps/staked-pool/index.js +83 -0
  46. package/dist/cjs/apps/staked-pool/state-machines/index.js +12 -0
  47. package/dist/cjs/apps/staked-pool/state-machines/staked-pool-base.js +49 -0
  48. package/dist/cjs/apps/staked-pool/state-machines/staked-pool-oracle.js +131 -0
  49. package/dist/cjs/generated/google/protobuf/struct.js +1 -1
  50. package/dist/cjs/generated/google/protobuf/timestamp.js +1 -1
  51. package/dist/cjs/generated/ottochain/apps/contracts/v1/contract.js +1 -1
  52. package/dist/cjs/generated/ottochain/apps/corporate/v1/corporate.js +1 -1
  53. package/dist/cjs/generated/ottochain/apps/governance/v1/governance.js +1 -1
  54. package/dist/cjs/generated/ottochain/apps/identity/v1/attestation.js +1 -1
  55. package/dist/cjs/generated/ottochain/apps/identity/v1/identity.js +1 -1
  56. package/dist/cjs/generated/ottochain/apps/markets/v1/market.js +1 -1
  57. package/dist/cjs/generated/ottochain/v1/common.js +1 -1
  58. package/dist/cjs/generated/ottochain/v1/fiber.js +40 -2
  59. package/dist/cjs/generated/ottochain/v1/messages.js +1 -1
  60. package/dist/cjs/generated/ottochain/v1/records.js +1 -1
  61. package/dist/cjs/index.js +20 -3
  62. package/dist/cjs/ottochain/genesis-manifest.js +6 -0
  63. package/dist/cjs/ottochain/metagraph-client.js +16 -8
  64. package/dist/cjs/ottochain/snapshot.js +2 -4
  65. package/dist/cjs/ottochain/transaction.js +10 -0
  66. package/dist/cjs/privacy/sealed-bid.js +85 -82
  67. package/dist/cjs/privacy/shield-app.js +32 -32
  68. package/dist/cjs/schema/effects.js +117 -1
  69. package/dist/cjs/schema/fiber-app.js +132 -3
  70. package/dist/cjs/schema/guard-lint.js +3 -12
  71. package/dist/cjs/schema/guards.js +38 -38
  72. package/dist/cjs/templates/asset-policy.js +190 -0
  73. package/dist/cjs/templates/index.js +86 -0
  74. package/dist/cjs/templates/machine.js +130 -0
  75. package/dist/cjs/templates/migration.js +39 -0
  76. package/dist/cjs/templates/state-shape.js +38 -0
  77. package/dist/cjs/validation.js +1 -3
  78. package/dist/esm/apps/compute/index.js +29 -0
  79. package/dist/esm/apps/compute/state-machines/compute-rule110.js +161 -0
  80. package/dist/esm/apps/compute/state-machines/index.js +5 -0
  81. package/dist/esm/apps/contracts/index.js +4 -4
  82. package/dist/esm/apps/contracts/state-machines/contract-agreement.js +128 -150
  83. package/dist/esm/apps/contracts/state-machines/contract-escrow.js +155 -176
  84. package/dist/esm/apps/contracts/state-machines/contract-universal.js +47 -59
  85. package/dist/esm/apps/corporate/index.js +2 -2
  86. package/dist/esm/apps/corporate/state-machines/corp-board.js +418 -484
  87. package/dist/esm/apps/corporate/state-machines/corp-entity.js +371 -443
  88. package/dist/esm/apps/corporate/state-machines/corp-securities.js +535 -650
  89. package/dist/esm/apps/corporate/state-machines/corp-shareholders.js +502 -606
  90. package/dist/esm/apps/governance/index.js +10 -10
  91. package/dist/esm/apps/governance/state-machines/dao-multisig.js +172 -211
  92. package/dist/esm/apps/governance/state-machines/dao-reputation.js +163 -216
  93. package/dist/esm/apps/governance/state-machines/dao-single.js +94 -94
  94. package/dist/esm/apps/governance/state-machines/dao-token.js +171 -225
  95. package/dist/esm/apps/governance/state-machines/governance-simple.js +187 -219
  96. package/dist/esm/apps/governance/state-machines/governance-universal.js +65 -65
  97. package/dist/esm/apps/identity/constants.js +18 -26
  98. package/dist/esm/apps/identity/index.js +8 -8
  99. package/dist/esm/apps/identity/state-machines/identity-agent.js +125 -159
  100. package/dist/esm/apps/identity/state-machines/identity-oracle.js +153 -171
  101. package/dist/esm/apps/identity/state-machines/identity-registry.js +91 -117
  102. package/dist/esm/apps/identity/state-machines/identity-universal.js +52 -58
  103. package/dist/esm/apps/index.js +9 -6
  104. package/dist/esm/apps/lending/assets.js +41 -17
  105. package/dist/esm/apps/lending/credit-scoring.js +6 -6
  106. package/dist/esm/apps/lending/eligibility.js +10 -26
  107. package/dist/esm/apps/lending/index.js +5 -5
  108. package/dist/esm/apps/lending/state-machines/lending-zk-loan.js +178 -157
  109. package/dist/esm/apps/markets/index.js +5 -5
  110. package/dist/esm/apps/markets/state-machines/market-auction.js +117 -136
  111. package/dist/esm/apps/markets/state-machines/market-crowdfund.js +124 -139
  112. package/dist/esm/apps/markets/state-machines/market-group-buy.js +160 -179
  113. package/dist/esm/apps/markets/state-machines/market-prediction.js +195 -229
  114. package/dist/esm/apps/markets/state-machines/market-universal.js +66 -81
  115. package/dist/esm/apps/oracles/index.js +3 -3
  116. package/dist/esm/apps/privacy/index.js +56 -0
  117. package/dist/esm/apps/privacy/state-machines/index.js +6 -0
  118. package/dist/esm/apps/privacy/state-machines/mixer-ddhRing.js +282 -0
  119. package/dist/esm/apps/privacy/state-machines/note-pool.js +470 -0
  120. package/dist/esm/apps/staked-pool/assets.js +91 -0
  121. package/dist/esm/apps/staked-pool/base.js +493 -0
  122. package/dist/esm/apps/staked-pool/consumer.js +49 -0
  123. package/dist/esm/apps/staked-pool/index.js +60 -0
  124. package/dist/esm/apps/staked-pool/state-machines/index.js +6 -0
  125. package/dist/esm/apps/staked-pool/state-machines/staked-pool-base.js +46 -0
  126. package/dist/esm/apps/staked-pool/state-machines/staked-pool-oracle.js +127 -0
  127. package/dist/esm/generated/google/protobuf/struct.js +1 -1
  128. package/dist/esm/generated/google/protobuf/timestamp.js +1 -1
  129. package/dist/esm/generated/ottochain/apps/contracts/v1/contract.js +1 -1
  130. package/dist/esm/generated/ottochain/apps/corporate/v1/corporate.js +1 -1
  131. package/dist/esm/generated/ottochain/apps/governance/v1/governance.js +1 -1
  132. package/dist/esm/generated/ottochain/apps/identity/v1/attestation.js +1 -1
  133. package/dist/esm/generated/ottochain/apps/identity/v1/identity.js +1 -1
  134. package/dist/esm/generated/ottochain/apps/markets/v1/market.js +1 -1
  135. package/dist/esm/generated/ottochain/v1/common.js +1 -1
  136. package/dist/esm/generated/ottochain/v1/fiber.js +40 -2
  137. package/dist/esm/generated/ottochain/v1/messages.js +1 -1
  138. package/dist/esm/generated/ottochain/v1/records.js +1 -1
  139. package/dist/esm/index.js +10 -4
  140. package/dist/esm/ottochain/genesis-manifest.js +6 -0
  141. package/dist/esm/ottochain/metagraph-client.js +16 -8
  142. package/dist/esm/ottochain/snapshot.js +2 -4
  143. package/dist/esm/ottochain/transaction.js +8 -0
  144. package/dist/esm/privacy/index.js +2 -2
  145. package/dist/esm/privacy/sealed-bid.js +87 -84
  146. package/dist/esm/privacy/shield-app.js +33 -33
  147. package/dist/esm/schema/effects.js +110 -0
  148. package/dist/esm/schema/fiber-app.js +127 -3
  149. package/dist/esm/schema/guard-lint.js +3 -12
  150. package/dist/esm/schema/guards.js +36 -37
  151. package/dist/esm/templates/asset-policy.js +182 -0
  152. package/dist/esm/templates/index.js +41 -0
  153. package/dist/esm/templates/machine.js +125 -0
  154. package/dist/esm/templates/migration.js +34 -0
  155. package/dist/esm/templates/state-shape.js +34 -0
  156. package/dist/esm/validation.js +1 -3
  157. package/dist/esm/zk/index.js +4 -4
  158. package/dist/types/apps/compute/index.d.ts +176 -0
  159. package/dist/types/apps/compute/state-machines/compute-rule110.d.ts +157 -0
  160. package/dist/types/apps/compute/state-machines/index.d.ts +5 -0
  161. package/dist/types/apps/contracts/index.d.ts +14 -14
  162. package/dist/types/apps/contracts/state-machines/contract-agreement.d.ts +3 -3
  163. package/dist/types/apps/contracts/state-machines/contract-escrow.d.ts +3 -3
  164. package/dist/types/apps/contracts/state-machines/contract-universal.d.ts +4 -4
  165. package/dist/types/apps/corporate/index.d.ts +162 -162
  166. package/dist/types/apps/corporate/state-machines/corp-board.d.ts +88 -88
  167. package/dist/types/apps/corporate/state-machines/corp-entity.d.ts +14 -14
  168. package/dist/types/apps/corporate/state-machines/corp-securities.d.ts +18 -18
  169. package/dist/types/apps/corporate/state-machines/corp-shareholders.d.ts +43 -43
  170. package/dist/types/apps/governance/index.d.ts +81 -81
  171. package/dist/types/apps/governance/state-machines/dao-multisig.d.ts +16 -16
  172. package/dist/types/apps/governance/state-machines/dao-reputation.d.ts +22 -22
  173. package/dist/types/apps/governance/state-machines/dao-token.d.ts +21 -21
  174. package/dist/types/apps/governance/state-machines/governance-simple.d.ts +11 -11
  175. package/dist/types/apps/governance/state-machines/governance-universal.d.ts +4 -4
  176. package/dist/types/apps/identity/constants.d.ts +2 -2
  177. package/dist/types/apps/identity/index.d.ts +70 -70
  178. package/dist/types/apps/identity/state-machines/identity-agent.d.ts +23 -23
  179. package/dist/types/apps/identity/state-machines/identity-oracle.d.ts +11 -11
  180. package/dist/types/apps/identity/state-machines/identity-registry.d.ts +27 -27
  181. package/dist/types/apps/identity/state-machines/identity-universal.d.ts +4 -4
  182. package/dist/types/apps/index.d.ts +9 -6
  183. package/dist/types/apps/lending/assets.d.ts +2 -2
  184. package/dist/types/apps/lending/credit-scoring.d.ts +5 -5
  185. package/dist/types/apps/lending/eligibility.d.ts +2 -2
  186. package/dist/types/apps/lending/index.d.ts +20 -12
  187. package/dist/types/apps/lending/state-machines/lending-zk-loan.d.ts +15 -7
  188. package/dist/types/apps/markets/index.d.ts +76 -76
  189. package/dist/types/apps/markets/state-machines/market-auction.d.ts +12 -12
  190. package/dist/types/apps/markets/state-machines/market-crowdfund.d.ts +19 -19
  191. package/dist/types/apps/markets/state-machines/market-group-buy.d.ts +18 -18
  192. package/dist/types/apps/markets/state-machines/market-prediction.d.ts +15 -15
  193. package/dist/types/apps/markets/state-machines/market-universal.d.ts +7 -7
  194. package/dist/types/apps/oracles/index.d.ts +1 -1
  195. package/dist/types/apps/privacy/index.d.ts +328 -0
  196. package/dist/types/apps/privacy/state-machines/index.d.ts +6 -0
  197. package/dist/types/apps/privacy/state-machines/mixer-ddhRing.d.ts +337 -0
  198. package/dist/types/apps/privacy/state-machines/note-pool.d.ts +196 -0
  199. package/dist/types/apps/staked-pool/assets.d.ts +53 -0
  200. package/dist/types/apps/staked-pool/base.d.ts +80 -0
  201. package/dist/types/apps/staked-pool/consumer.d.ts +29 -0
  202. package/dist/types/apps/staked-pool/index.d.ts +51 -0
  203. package/dist/types/apps/staked-pool/state-machines/index.d.ts +6 -0
  204. package/dist/types/apps/staked-pool/state-machines/staked-pool-base.d.ts +8 -0
  205. package/dist/types/apps/staked-pool/state-machines/staked-pool-oracle.d.ts +34 -0
  206. package/dist/types/generated/openapi.d.ts +13 -0
  207. package/dist/types/generated/ottochain/v1/fiber.d.ts +7 -0
  208. package/dist/types/index.d.ts +3 -3
  209. package/dist/types/openapi.d.ts +4 -2
  210. package/dist/types/ottochain/genesis-manifest.d.ts +6 -0
  211. package/dist/types/ottochain/transaction.d.ts +9 -1
  212. package/dist/types/ottochain/types.d.ts +1 -1
  213. package/dist/types/privacy/index.d.ts +2 -2
  214. package/dist/types/privacy/sealed-bid.d.ts +9 -9
  215. package/dist/types/privacy/shield-app.d.ts +1 -1
  216. package/dist/types/schema/effects.d.ts +107 -0
  217. package/dist/types/schema/fiber-app.d.ts +281 -0
  218. package/dist/types/schema/guards.d.ts +12 -0
  219. package/dist/types/templates/asset-policy.d.ts +119 -0
  220. package/dist/types/templates/index.d.ts +26 -0
  221. package/dist/types/templates/machine.d.ts +139 -0
  222. package/dist/types/templates/migration.d.ts +34 -0
  223. package/dist/types/templates/state-shape.d.ts +30 -0
  224. package/dist/types/zk/index.d.ts +4 -4
  225. package/package.json +31 -13
@@ -10,533 +10,488 @@ const effects_js_1 = require("../../../schema/effects.js");
10
10
  */
11
11
  exports.corpEntityDef = (0, fiber_app_js_1.defineFiberApp)({
12
12
  metadata: {
13
- name: "CorpEntity",
14
- app: "corporate",
15
- type: "entity",
16
- version: "1.0.0",
17
- description: "Master corporate record tracking the lifecycle of a business entity from incorporation through dissolution. Manages legal identity, share structure, and corporate status.",
13
+ name: 'CorpEntity',
14
+ app: 'corporate',
15
+ type: 'entity',
16
+ version: '1.0.0',
17
+ description: 'Master corporate record tracking the lifecycle of a business entity from incorporation through dissolution. Manages legal identity, share structure, and corporate status.',
18
18
  crossReferences: {
19
19
  board: {
20
- machine: "corporate-board",
21
- description: "Board of directors for this entity",
22
- foreignKey: "entityId",
20
+ machine: 'corporate-board',
21
+ description: 'Board of directors for this entity',
22
+ foreignKey: 'entityId',
23
23
  },
24
24
  officers: {
25
- machine: "corporate-officers",
26
- description: "Executive officers for this entity",
27
- foreignKey: "entityId",
25
+ machine: 'corporate-officers',
26
+ description: 'Executive officers for this entity',
27
+ foreignKey: 'entityId',
28
28
  },
29
29
  bylaws: {
30
- machine: "corporate-bylaws",
31
- description: "Governing bylaws for this entity",
32
- foreignKey: "entityId",
30
+ machine: 'corporate-bylaws',
31
+ description: 'Governing bylaws for this entity',
32
+ foreignKey: 'entityId',
33
33
  },
34
34
  shareholders: {
35
- machine: "corporate-shareholders",
36
- description: "Shareholder meeting instances",
37
- foreignKey: "entityId",
35
+ machine: 'corporate-shareholders',
36
+ description: 'Shareholder meeting instances',
37
+ foreignKey: 'entityId',
38
38
  },
39
39
  securities: {
40
- machine: "corporate-securities",
41
- description: "Stock issuance records",
42
- foreignKey: "entityId",
40
+ machine: 'corporate-securities',
41
+ description: 'Stock issuance records',
42
+ foreignKey: 'entityId',
43
43
  },
44
44
  compliance: {
45
- machine: "corporate-compliance",
46
- description: "Regulatory compliance tracking",
47
- foreignKey: "entityId",
45
+ machine: 'corporate-compliance',
46
+ description: 'Regulatory compliance tracking',
47
+ foreignKey: 'entityId',
48
48
  },
49
49
  },
50
50
  },
51
51
  createSchema: {
52
52
  required: [
53
- "entityId",
54
- "legalName",
55
- "entityType",
56
- "jurisdiction",
57
- "charterAuthority",
58
- "boardAuthority",
59
- "shareholderAuthority",
60
- "stateAuthority",
53
+ 'entityId',
54
+ 'legalName',
55
+ 'entityType',
56
+ 'jurisdiction',
57
+ 'charterAuthority',
58
+ 'boardAuthority',
59
+ 'shareholderAuthority',
60
+ 'stateAuthority',
61
61
  ],
62
62
  properties: {
63
63
  entityId: {
64
- type: "string",
65
- description: "Unique identifier for this corporate entity",
64
+ type: 'string',
65
+ description: 'Unique identifier for this corporate entity',
66
66
  immutable: true,
67
67
  },
68
68
  charterAuthority: {
69
- type: "address",
70
- description: "State-pinned DAG address authorized to amend the charter (legal identity). Verified against proofs[].address.",
69
+ type: 'address',
70
+ description: 'State-pinned DAG address authorized to amend the charter (legal identity). Verified against proofs[].address.',
71
71
  immutable: true,
72
72
  },
73
73
  boardAuthority: {
74
- type: "address",
75
- description: "State-pinned DAG address of the board authority (governs registered-agent changes, suspension/reinstatement, and the board half of voluntary dissolution). Verified against proofs[].address.",
74
+ type: 'address',
75
+ description: 'State-pinned DAG address of the board authority (governs registered-agent changes, suspension/reinstatement, and the board half of voluntary dissolution). Verified against proofs[].address.',
76
76
  immutable: true,
77
77
  },
78
78
  shareholderAuthority: {
79
- type: "address",
80
- description: "State-pinned DAG address of the shareholder authority (the shareholder half of voluntary dissolution). Verified against proofs[].address.",
79
+ type: 'address',
80
+ description: 'State-pinned DAG address of the shareholder authority (the shareholder half of voluntary dissolution). Verified against proofs[].address.',
81
81
  immutable: true,
82
82
  },
83
83
  stateAuthority: {
84
- type: "address",
85
- description: "State-pinned DAG address of the chartering jurisdiction/registrar that may administratively dissolve a suspended entity. Verified against proofs[].address.",
84
+ type: 'address',
85
+ description: 'State-pinned DAG address of the chartering jurisdiction/registrar that may administratively dissolve a suspended entity. Verified against proofs[].address.',
86
86
  immutable: true,
87
87
  },
88
88
  legalName: {
89
- type: "string",
90
- description: "Full legal name of the corporation",
89
+ type: 'string',
90
+ description: 'Full legal name of the corporation',
91
91
  },
92
92
  tradeName: {
93
- type: "string",
93
+ type: 'string',
94
94
  nullable: true,
95
- description: "DBA or trade name if different",
95
+ description: 'DBA or trade name if different',
96
96
  },
97
97
  entityType: {
98
- type: "string",
99
- enum: ["C_CORP", "S_CORP", "B_CORP", "LLC", "LP", "LLP"],
100
- description: "Legal entity type",
98
+ type: 'string',
99
+ enum: ['C_CORP', 'S_CORP', 'B_CORP', 'LLC', 'LP', 'LLP'],
100
+ description: 'Legal entity type',
101
101
  },
102
102
  jurisdiction: {
103
- type: "object",
103
+ type: 'object',
104
104
  properties: {
105
105
  state: {
106
- type: "string",
107
- description: "State of incorporation (e.g., DE, NV, WY)",
106
+ type: 'string',
107
+ description: 'State of incorporation (e.g., DE, NV, WY)',
108
108
  },
109
- country: { type: "string", default: "USA" },
109
+ country: { type: 'string', default: 'USA' },
110
110
  foreignQualifications: {
111
- type: "array",
112
- items: { type: "string" },
113
- description: "States where foreign qualified to do business",
111
+ type: 'array',
112
+ items: { type: 'string' },
113
+ description: 'States where foreign qualified to do business',
114
114
  },
115
115
  },
116
116
  },
117
117
  fiscalYearEnd: {
118
- type: "string",
119
- description: "Fiscal year end (MM-DD format)",
118
+ type: 'string',
119
+ description: 'Fiscal year end (MM-DD format)',
120
120
  },
121
121
  registeredAgent: {
122
- type: "object",
122
+ type: 'object',
123
123
  properties: {
124
- name: { type: "string" },
125
- address: { type: "object" },
126
- phone: { type: "string" },
127
- email: { type: "string" },
128
- effectiveDate: { type: "string", format: "date" },
124
+ name: { type: 'string' },
125
+ address: { type: 'object' },
126
+ phone: { type: 'string' },
127
+ email: { type: 'string' },
128
+ effectiveDate: { type: 'string', format: 'date' },
129
129
  },
130
130
  },
131
131
  principalOffice: {
132
- type: "object",
132
+ type: 'object',
133
133
  properties: {
134
- street: { type: "string" },
135
- city: { type: "string" },
136
- state: { type: "string" },
137
- zip: { type: "string" },
138
- country: { type: "string", default: "USA" },
134
+ street: { type: 'string' },
135
+ city: { type: 'string' },
136
+ state: { type: 'string' },
137
+ zip: { type: 'string' },
138
+ country: { type: 'string', default: 'USA' },
139
139
  },
140
140
  },
141
141
  shareStructure: {
142
- type: "object",
142
+ type: 'object',
143
143
  properties: {
144
144
  classes: {
145
- type: "array",
146
- items: { $ref: "#/definitions/ShareClass" },
145
+ type: 'array',
146
+ items: { $ref: '#/definitions/ShareClass' },
147
147
  },
148
148
  totalAuthorized: {
149
- type: "integer",
150
- description: "Sum of all authorized shares",
149
+ type: 'integer',
150
+ description: 'Sum of all authorized shares',
151
151
  },
152
- totalIssued: { type: "integer" },
153
- totalOutstanding: { type: "integer" },
152
+ totalIssued: { type: 'integer' },
153
+ totalOutstanding: { type: 'integer' },
154
154
  },
155
155
  },
156
156
  incorporators: {
157
- type: "array",
158
- items: { $ref: "#/definitions/Incorporator" },
157
+ type: 'array',
158
+ items: { $ref: '#/definitions/Incorporator' },
159
159
  },
160
160
  ein: {
161
- type: "string",
161
+ type: 'string',
162
162
  nullable: true,
163
- description: "Federal EIN",
163
+ description: 'Federal EIN',
164
164
  },
165
165
  stateIds: {
166
- type: "object",
167
- additionalProperties: { type: "string" },
168
- description: "State-specific entity IDs keyed by state code",
166
+ type: 'object',
167
+ additionalProperties: { type: 'string' },
168
+ description: 'State-specific entity IDs keyed by state code',
169
169
  },
170
170
  },
171
171
  },
172
172
  stateSchema: {
173
173
  properties: {
174
- entityId: { type: "string", immutable: true },
175
- charterAuthority: { type: "address", immutable: true },
176
- boardAuthority: { type: "address", immutable: true },
177
- shareholderAuthority: { type: "address", immutable: true },
178
- stateAuthority: { type: "address", immutable: true },
179
- legalName: { type: "string" },
180
- tradeName: { type: "string", nullable: true },
181
- entityType: { type: "string" },
182
- jurisdiction: { type: "object" },
183
- formationDate: { type: "string", format: "date", computed: true },
184
- fiscalYearEnd: { type: "string" },
185
- registeredAgent: { type: "object" },
186
- principalOffice: { type: "object" },
187
- shareStructure: { type: "object" },
188
- incorporators: { type: "array" },
189
- ein: { type: "string", nullable: true },
190
- stateIds: { type: "object" },
174
+ entityId: { type: 'string', immutable: true },
175
+ charterAuthority: { type: 'address', immutable: true },
176
+ boardAuthority: { type: 'address', immutable: true },
177
+ shareholderAuthority: { type: 'address', immutable: true },
178
+ stateAuthority: { type: 'address', immutable: true },
179
+ legalName: { type: 'string' },
180
+ tradeName: { type: 'string', nullable: true },
181
+ entityType: { type: 'string' },
182
+ jurisdiction: { type: 'object' },
183
+ formationDate: { type: 'string', format: 'date', computed: true },
184
+ fiscalYearEnd: { type: 'string' },
185
+ registeredAgent: { type: 'object' },
186
+ principalOffice: { type: 'object' },
187
+ shareStructure: { type: 'object' },
188
+ incorporators: { type: 'array' },
189
+ ein: { type: 'string', nullable: true },
190
+ stateIds: { type: 'object' },
191
191
  status: {
192
- type: "string",
193
- enum: ["INCORPORATING", "ACTIVE", "SUSPENDED", "DISSOLVED"],
192
+ type: 'string',
193
+ enum: ['INCORPORATING', 'ACTIVE', 'SUSPENDED', 'DISSOLVED'],
194
194
  computed: true,
195
195
  },
196
- suspensionReason: { type: "string", nullable: true, computed: true },
196
+ suspensionReason: { type: 'string', nullable: true, computed: true },
197
197
  suspensionDate: {
198
- type: "string",
199
- format: "date",
198
+ type: 'string',
199
+ format: 'date',
200
200
  nullable: true,
201
201
  computed: true,
202
202
  },
203
203
  dissolutionDate: {
204
- type: "string",
205
- format: "date",
204
+ type: 'string',
205
+ format: 'date',
206
206
  nullable: true,
207
207
  computed: true,
208
208
  },
209
- dissolutionReason: { type: "string", nullable: true, computed: true },
209
+ dissolutionReason: { type: 'string', nullable: true, computed: true },
210
210
  charterAmendments: {
211
- type: "array",
212
- items: { $ref: "#/definitions/CharterAmendment" },
211
+ type: 'array',
212
+ items: { $ref: '#/definitions/CharterAmendment' },
213
213
  computed: true,
214
214
  },
215
- createdAt: { type: "timestamp", computed: true },
216
- updatedAt: { type: "timestamp", computed: true },
215
+ createdAt: { type: 'timestamp', computed: true },
216
+ updatedAt: { type: 'timestamp', computed: true },
217
217
  // Two-phase amendment (#24): propose_amend_charter binds the resolution fiber + records the
218
218
  // pending amendment here; amend_charter asserts the bound resolution is EXECUTED, then clears this.
219
- pendingAmendCharter: { type: "object", nullable: true, computed: true },
219
+ pendingAmendCharter: { type: 'object', nullable: true, computed: true },
220
220
  // Two-phase voluntary dissolution (#24): propose_dissolve_voluntary binds the board + shareholder
221
221
  // resolution fibers + records the pending dissolution here; dissolve_voluntary asserts both bound
222
222
  // resolutions are EXECUTED, then clears this.
223
- pendingDissolveVoluntary: { type: "object", nullable: true, computed: true },
223
+ pendingDissolveVoluntary: { type: 'object', nullable: true, computed: true },
224
224
  },
225
225
  },
226
226
  eventSchemas: {
227
227
  incorporate: {
228
- description: "State approves articles of incorporation, corporation comes into existence",
229
- required: ["approvalDate", "stateFileNumber"],
228
+ description: 'State approves articles of incorporation, corporation comes into existence',
229
+ required: ['approvalDate', 'stateFileNumber'],
230
230
  properties: {
231
- approvalDate: { type: "string", format: "date" },
232
- stateFileNumber: { type: "string" },
231
+ approvalDate: { type: 'string', format: 'date' },
232
+ stateFileNumber: { type: 'string' },
233
233
  certificateOfIncorporation: {
234
- type: "string",
235
- description: "Document reference",
234
+ type: 'string',
235
+ description: 'Document reference',
236
236
  },
237
237
  },
238
238
  },
239
239
  propose_amend_charter: {
240
- description: "Phase 1 of a charter amendment: bind the approving resolution fiber (#24 _addDependency) and record the pending amendment",
241
- required: [
242
- "amendmentId",
243
- "description",
244
- "amendmentType",
245
- "resolutionRef",
246
- "effectiveDate",
247
- "filedDate",
248
- ],
240
+ description: 'Phase 1 of a charter amendment: bind the approving resolution fiber (#24 _addDependency) and record the pending amendment',
241
+ required: ['amendmentId', 'description', 'amendmentType', 'resolutionRef', 'effectiveDate', 'filedDate'],
249
242
  properties: {
250
- amendmentId: { type: "string" },
251
- description: { type: "string" },
243
+ amendmentId: { type: 'string' },
244
+ description: { type: 'string' },
252
245
  amendmentType: {
253
- type: "string",
254
- enum: [
255
- "NAME_CHANGE",
256
- "SHARE_AUTHORIZATION",
257
- "PURPOSE_CHANGE",
258
- "OTHER",
259
- ],
246
+ type: 'string',
247
+ enum: ['NAME_CHANGE', 'SHARE_AUTHORIZATION', 'PURPOSE_CHANGE', 'OTHER'],
260
248
  },
261
249
  resolutionRef: {
262
- type: "string",
263
- description: "Reference to board/shareholder resolution",
250
+ type: 'string',
251
+ description: 'Reference to board/shareholder resolution',
264
252
  },
265
- effectiveDate: { type: "string", format: "date" },
266
- filedDate: { type: "string", format: "date" },
253
+ effectiveDate: { type: 'string', format: 'date' },
254
+ filedDate: { type: 'string', format: 'date' },
267
255
  newShareAuthorization: {
268
- type: "object",
256
+ type: 'object',
269
257
  nullable: true,
270
- description: "If increasing/changing authorized shares",
258
+ description: 'If increasing/changing authorized shares',
271
259
  },
272
- newLegalName: { type: "string", nullable: true },
260
+ newLegalName: { type: 'string', nullable: true },
273
261
  },
274
262
  },
275
263
  amend_charter: {
276
- description: "Phase 2 of a charter amendment: apply once the bound approving resolution is EXECUTED",
277
- required: [
278
- "amendmentId",
279
- "description",
280
- "amendmentType",
281
- "effectiveDate",
282
- "filedDate",
283
- ],
264
+ description: 'Phase 2 of a charter amendment: apply once the bound approving resolution is EXECUTED',
265
+ required: ['amendmentId', 'description', 'amendmentType', 'effectiveDate', 'filedDate'],
284
266
  properties: {
285
- amendmentId: { type: "string" },
286
- description: { type: "string" },
267
+ amendmentId: { type: 'string' },
268
+ description: { type: 'string' },
287
269
  amendmentType: {
288
- type: "string",
289
- enum: [
290
- "NAME_CHANGE",
291
- "SHARE_AUTHORIZATION",
292
- "PURPOSE_CHANGE",
293
- "OTHER",
294
- ],
270
+ type: 'string',
271
+ enum: ['NAME_CHANGE', 'SHARE_AUTHORIZATION', 'PURPOSE_CHANGE', 'OTHER'],
295
272
  },
296
- effectiveDate: { type: "string", format: "date" },
297
- filedDate: { type: "string", format: "date" },
273
+ effectiveDate: { type: 'string', format: 'date' },
274
+ filedDate: { type: 'string', format: 'date' },
298
275
  newShareAuthorization: {
299
- type: "object",
276
+ type: 'object',
300
277
  nullable: true,
301
- description: "If increasing/changing authorized shares",
278
+ description: 'If increasing/changing authorized shares',
302
279
  },
303
- newLegalName: { type: "string", nullable: true },
280
+ newLegalName: { type: 'string', nullable: true },
304
281
  },
305
282
  },
306
283
  update_share_class: {
307
- description: "Update authorized shares for an existing class or add new class (requires charter amendment)",
308
- required: [
309
- "classId",
310
- "className",
311
- "authorized",
312
- "parValue",
313
- "votingRights",
314
- "charterAmendmentRef",
315
- ],
284
+ description: 'Update authorized shares for an existing class or add new class (requires charter amendment)',
285
+ required: ['classId', 'className', 'authorized', 'parValue', 'votingRights', 'charterAmendmentRef'],
316
286
  properties: {
317
- classId: { type: "string" },
318
- className: { type: "string" },
319
- authorized: { type: "integer" },
320
- parValue: { type: "number" },
321
- votingRights: { type: "boolean" },
322
- votesPerShare: { type: "number", default: 1 },
323
- liquidationPreference: { type: "number", nullable: true },
324
- dividendRate: { type: "number", nullable: true },
325
- convertible: { type: "boolean", default: false },
326
- charterAmendmentRef: { type: "string" },
287
+ classId: { type: 'string' },
288
+ className: { type: 'string' },
289
+ authorized: { type: 'integer' },
290
+ parValue: { type: 'number' },
291
+ votingRights: { type: 'boolean' },
292
+ votesPerShare: { type: 'number', default: 1 },
293
+ liquidationPreference: { type: 'number', nullable: true },
294
+ dividendRate: { type: 'number', nullable: true },
295
+ convertible: { type: 'boolean', default: false },
296
+ charterAmendmentRef: { type: 'string' },
327
297
  },
328
298
  },
329
299
  update_registered_agent: {
330
- description: "Change the registered agent on file with the state",
331
- required: ["name", "address", "effectiveDate"],
300
+ description: 'Change the registered agent on file with the state',
301
+ required: ['name', 'address', 'effectiveDate'],
332
302
  properties: {
333
- name: { type: "string" },
334
- address: { type: "object" },
335
- phone: { type: "string" },
336
- email: { type: "string" },
337
- effectiveDate: { type: "string", format: "date" },
303
+ name: { type: 'string' },
304
+ address: { type: 'object' },
305
+ phone: { type: 'string' },
306
+ email: { type: 'string' },
307
+ effectiveDate: { type: 'string', format: 'date' },
338
308
  filingConfirmation: {
339
- type: "string",
340
- description: "State filing confirmation number",
309
+ type: 'string',
310
+ description: 'State filing confirmation number',
341
311
  },
342
312
  },
343
313
  },
344
314
  suspend: {
345
- description: "State suspends corporate powers (typically for tax/filing noncompliance)",
346
- required: ["reason", "suspensionDate"],
315
+ description: 'State suspends corporate powers (typically for tax/filing noncompliance)',
316
+ required: ['reason', 'suspensionDate'],
347
317
  properties: {
348
318
  reason: {
349
- type: "string",
319
+ type: 'string',
350
320
  enum: [
351
- "FRANCHISE_TAX_DELINQUENT",
352
- "ANNUAL_REPORT_MISSING",
353
- "REGISTERED_AGENT_LAPSE",
354
- "ADMINISTRATIVE",
355
- "OTHER",
321
+ 'FRANCHISE_TAX_DELINQUENT',
322
+ 'ANNUAL_REPORT_MISSING',
323
+ 'REGISTERED_AGENT_LAPSE',
324
+ 'ADMINISTRATIVE',
325
+ 'OTHER',
356
326
  ],
357
327
  },
358
- suspensionDate: { type: "string", format: "date" },
328
+ suspensionDate: { type: 'string', format: 'date' },
359
329
  stateNotice: {
360
- type: "string",
361
- description: "Reference to state notice",
330
+ type: 'string',
331
+ description: 'Reference to state notice',
362
332
  },
363
- cureDeadline: { type: "string", format: "date", nullable: true },
333
+ cureDeadline: { type: 'string', format: 'date', nullable: true },
364
334
  },
365
335
  },
366
336
  reinstate: {
367
- description: "Cure deficiencies and reinstate corporate powers",
368
- required: [
369
- "reinstatementDate",
370
- "curativeActions",
371
- "stateConfirmation",
372
- ],
337
+ description: 'Cure deficiencies and reinstate corporate powers',
338
+ required: ['reinstatementDate', 'curativeActions', 'stateConfirmation'],
373
339
  properties: {
374
- reinstatementDate: { type: "string", format: "date" },
340
+ reinstatementDate: { type: 'string', format: 'date' },
375
341
  curativeActions: {
376
- type: "array",
377
- items: { type: "string" },
378
- description: "List of actions taken to cure",
342
+ type: 'array',
343
+ items: { type: 'string' },
344
+ description: 'List of actions taken to cure',
379
345
  },
380
- stateConfirmation: { type: "string" },
381
- penaltiesPaid: { type: "number", nullable: true },
346
+ stateConfirmation: { type: 'string' },
347
+ penaltiesPaid: { type: 'number', nullable: true },
382
348
  },
383
349
  },
384
350
  propose_dissolve_voluntary: {
385
- description: "Phase 1 of voluntary dissolution: bind the executing board + shareholder resolution fibers (#24 _addDependency) and record the pending dissolution",
386
- required: [
387
- "dissolutionDate",
388
- "boardResolutionRef",
389
- "shareholderResolutionRef",
390
- ],
351
+ description: 'Phase 1 of voluntary dissolution: bind the executing board + shareholder resolution fibers (#24 _addDependency) and record the pending dissolution',
352
+ required: ['dissolutionDate', 'boardResolutionRef', 'shareholderResolutionRef'],
391
353
  properties: {
392
- dissolutionDate: { type: "string", format: "date" },
393
- boardResolutionRef: { type: "string" },
394
- shareholderResolutionRef: { type: "string" },
354
+ dissolutionDate: { type: 'string', format: 'date' },
355
+ boardResolutionRef: { type: 'string' },
356
+ shareholderResolutionRef: { type: 'string' },
395
357
  windingUpPlan: {
396
- type: "string",
397
- description: "Reference to winding up plan",
358
+ type: 'string',
359
+ description: 'Reference to winding up plan',
398
360
  },
399
- certificateOfDissolution: { type: "string" },
361
+ certificateOfDissolution: { type: 'string' },
400
362
  },
401
363
  },
402
364
  dissolve_voluntary: {
403
- description: "Phase 2 of voluntary dissolution: execute once both bound resolutions are EXECUTED",
404
- required: ["dissolutionDate"],
365
+ description: 'Phase 2 of voluntary dissolution: execute once both bound resolutions are EXECUTED',
366
+ required: ['dissolutionDate'],
405
367
  properties: {
406
- dissolutionDate: { type: "string", format: "date" },
368
+ dissolutionDate: { type: 'string', format: 'date' },
407
369
  windingUpPlan: {
408
- type: "string",
409
- description: "Reference to winding up plan",
370
+ type: 'string',
371
+ description: 'Reference to winding up plan',
410
372
  },
411
- certificateOfDissolution: { type: "string" },
373
+ certificateOfDissolution: { type: 'string' },
412
374
  },
413
375
  },
414
376
  dissolve_administrative: {
415
- description: "Administrative dissolution by state after prolonged suspension",
416
- required: ["dissolutionDate", "stateOrder", "reason"],
377
+ description: 'Administrative dissolution by state after prolonged suspension',
378
+ required: ['dissolutionDate', 'stateOrder', 'reason'],
417
379
  properties: {
418
- dissolutionDate: { type: "string", format: "date" },
419
- stateOrder: { type: "string" },
420
- reason: { type: "string" },
380
+ dissolutionDate: { type: 'string', format: 'date' },
381
+ stateOrder: { type: 'string' },
382
+ reason: { type: 'string' },
421
383
  },
422
384
  },
423
385
  },
424
386
  definitions: {
425
387
  ShareClass: {
426
- type: "object",
388
+ type: 'object',
427
389
  properties: {
428
390
  className: {
429
- type: "string",
430
- description: "e.g., Common, Series A Preferred",
391
+ type: 'string',
392
+ description: 'e.g., Common, Series A Preferred',
431
393
  },
432
- classId: { type: "string" },
433
- authorized: { type: "integer", description: "Total shares authorized" },
434
- issued: { type: "integer", description: "Shares currently issued" },
435
- outstanding: { type: "integer", description: "Issued minus treasury" },
436
- treasury: { type: "integer", description: "Shares held by company" },
437
- parValue: { type: "number", description: "Par value per share" },
394
+ classId: { type: 'string' },
395
+ authorized: { type: 'integer', description: 'Total shares authorized' },
396
+ issued: { type: 'integer', description: 'Shares currently issued' },
397
+ outstanding: { type: 'integer', description: 'Issued minus treasury' },
398
+ treasury: { type: 'integer', description: 'Shares held by company' },
399
+ parValue: { type: 'number', description: 'Par value per share' },
438
400
  votingRights: {
439
- type: "boolean",
440
- description: "Whether class has voting rights",
401
+ type: 'boolean',
402
+ description: 'Whether class has voting rights',
441
403
  },
442
- votesPerShare: { type: "number", default: 1 },
404
+ votesPerShare: { type: 'number', default: 1 },
443
405
  liquidationPreference: {
444
- type: "number",
406
+ type: 'number',
445
407
  nullable: true,
446
- description: "Liquidation preference multiple",
408
+ description: 'Liquidation preference multiple',
447
409
  },
448
410
  dividendRate: {
449
- type: "number",
411
+ type: 'number',
450
412
  nullable: true,
451
- description: "Annual dividend rate %",
413
+ description: 'Annual dividend rate %',
452
414
  },
453
- convertible: { type: "boolean", default: false },
454
- conversionRatio: { type: "number", nullable: true },
415
+ convertible: { type: 'boolean', default: false },
416
+ conversionRatio: { type: 'number', nullable: true },
455
417
  antidilution: {
456
- type: "string",
457
- enum: [
458
- "NONE",
459
- "BROAD_BASED",
460
- "NARROW_BASED",
461
- "FULL_RATCHET",
462
- ],
418
+ type: 'string',
419
+ enum: ['NONE', 'BROAD_BASED', 'NARROW_BASED', 'FULL_RATCHET'],
463
420
  nullable: true,
464
421
  },
465
422
  },
466
423
  },
467
424
  Incorporator: {
468
- type: "object",
425
+ type: 'object',
469
426
  properties: {
470
- name: { type: "string" },
471
- address: { type: "object" },
472
- signatureDate: { type: "string", format: "date" },
427
+ name: { type: 'string' },
428
+ address: { type: 'object' },
429
+ signatureDate: { type: 'string', format: 'date' },
473
430
  },
474
431
  },
475
432
  CharterAmendment: {
476
- type: "object",
433
+ type: 'object',
477
434
  properties: {
478
- amendmentId: { type: "string" },
479
- description: { type: "string" },
480
- effectiveDate: { type: "string", format: "date" },
435
+ amendmentId: { type: 'string' },
436
+ description: { type: 'string' },
437
+ effectiveDate: { type: 'string', format: 'date' },
481
438
  resolutionRef: {
482
- type: "string",
483
- description: "Reference to approving resolution",
439
+ type: 'string',
440
+ description: 'Reference to approving resolution',
484
441
  },
485
- filedDate: { type: "string", format: "date" },
442
+ filedDate: { type: 'string', format: 'date' },
486
443
  },
487
444
  },
488
445
  },
489
446
  states: {
490
447
  INCORPORATING: {
491
- id: "INCORPORATING",
448
+ id: 'INCORPORATING',
492
449
  isFinal: false,
493
- description: "Initial state during formation process. Articles filed but not yet approved by state.",
450
+ description: 'Initial state during formation process. Articles filed but not yet approved by state.',
494
451
  },
495
452
  ACTIVE: {
496
- id: "ACTIVE",
453
+ id: 'ACTIVE',
497
454
  isFinal: false,
498
- description: "Corporation is in good standing and authorized to conduct business.",
455
+ description: 'Corporation is in good standing and authorized to conduct business.',
499
456
  },
500
457
  SUSPENDED: {
501
- id: "SUSPENDED",
458
+ id: 'SUSPENDED',
502
459
  isFinal: false,
503
- description: "Corporate powers suspended due to compliance failure (tax, filings, etc). Can be reinstated.",
460
+ description: 'Corporate powers suspended due to compliance failure (tax, filings, etc). Can be reinstated.',
504
461
  },
505
462
  DISSOLVED: {
506
- id: "DISSOLVED",
463
+ id: 'DISSOLVED',
507
464
  isFinal: true,
508
- description: "Corporation has been legally dissolved. Terminal state.",
465
+ description: 'Corporation has been legally dissolved. Terminal state.',
509
466
  },
510
467
  },
511
- initialState: "INCORPORATING",
468
+ initialState: 'INCORPORATING',
512
469
  transitions: [
513
470
  // INCORPORATING -> ACTIVE
514
471
  {
515
- from: "INCORPORATING",
516
- to: "ACTIVE",
517
- eventName: "incorporate",
472
+ from: 'INCORPORATING',
473
+ to: 'ACTIVE',
474
+ eventName: 'incorporate',
518
475
  guard: {
519
476
  and: [
520
- { "!=": [{ var: "state.legalName" }, null] },
521
- { "!=": [{ var: "state.jurisdiction.state" }, null] },
522
- { "!=": [{ var: "state.registeredAgent" }, null] },
523
- { ">": [{ length: [{ var: "state.incorporators" }] }, 0] },
524
- { ">": [{ length: [{ var: "state.shareStructure.classes" }] }, 0] },
525
- { ">": [{ var: "state.shareStructure.totalAuthorized" }, 0] },
477
+ { '!=': [{ var: 'state.legalName' }, null] },
478
+ { '!=': [{ var: 'state.jurisdiction.state' }, null] },
479
+ { '!=': [{ var: 'state.registeredAgent' }, null] },
480
+ { '>': [{ length: [{ var: 'state.incorporators' }] }, 0] },
481
+ { '>': [{ length: [{ var: 'state.shareStructure.classes' }] }, 0] },
482
+ { '>': [{ var: 'state.shareStructure.totalAuthorized' }, 0] },
526
483
  ],
527
484
  },
528
485
  effect: {
529
486
  merge: [
530
- { var: "state" },
487
+ { var: 'state' },
531
488
  {
532
- status: "ACTIVE",
533
- formationDate: { var: "event.approvalDate" },
534
- updatedAt: { var: "$ordinal" },
489
+ status: 'ACTIVE',
490
+ formationDate: { var: 'event.approvalDate' },
491
+ updatedAt: { var: '$ordinal' },
535
492
  },
536
493
  {
537
- _emit: [
538
- { name: "CORPORATION_FORMED", data: { var: "event" }, destination: "external" },
539
- ],
494
+ _emit: [{ name: 'CORPORATION_FORMED', data: { var: 'event' }, destination: 'external' }],
540
495
  },
541
496
  ],
542
497
  },
@@ -544,27 +499,27 @@ exports.corpEntityDef = (0, fiber_app_js_1.defineFiberApp)({
544
499
  // ACTIVE -> ACTIVE (propose_amend_charter) — phase 1 (#24): bind the approving resolution fiber and
545
500
  // record the pending amendment, so amend_charter can read the resolution's state next transition.
546
501
  {
547
- from: "ACTIVE",
548
- to: "ACTIVE",
549
- eventName: "propose_amend_charter",
502
+ from: 'ACTIVE',
503
+ to: 'ACTIVE',
504
+ eventName: 'propose_amend_charter',
550
505
  // authority gate — an identity role attestation (ISSUER/BOARD_MEMBER/...) layers on additively when the identity registry lands (docs/design/app-hardening-identity-integration.md §4.2)
551
- guard: (0, guards_js_1.signerIsParty)("state.charterAuthority"),
506
+ guard: (0, guards_js_1.signerIsParty)('state.charterAuthority'),
552
507
  effect: {
553
508
  merge: [
554
- { var: "state" },
509
+ { var: 'state' },
555
510
  {
556
511
  pendingAmendCharter: {
557
- amendmentId: { var: "event.amendmentId" },
558
- description: { var: "event.description" },
559
- effectiveDate: { var: "event.effectiveDate" },
560
- filedDate: { var: "event.filedDate" },
561
- newLegalName: { var: "event.newLegalName" },
562
- ref: { var: "event.resolutionRef" },
563
- proposedAt: { var: "$ordinal" },
512
+ amendmentId: { var: 'event.amendmentId' },
513
+ description: { var: 'event.description' },
514
+ effectiveDate: { var: 'event.effectiveDate' },
515
+ filedDate: { var: 'event.filedDate' },
516
+ newLegalName: { var: 'event.newLegalName' },
517
+ ref: { var: 'event.resolutionRef' },
518
+ proposedAt: { var: '$ordinal' },
564
519
  },
565
520
  },
566
521
  // bind the resolution fiber so amend_charter can assert its state next transition
567
- (0, effects_js_1.addDependency)({ var: "event.resolutionRef" }),
522
+ (0, effects_js_1.addDependency)({ var: 'event.resolutionRef' }),
568
523
  ],
569
524
  },
570
525
  dependencies: [],
@@ -572,56 +527,51 @@ exports.corpEntityDef = (0, fiber_app_js_1.defineFiberApp)({
572
527
  // ACTIVE -> ACTIVE (amend_charter) — phase 2 (#24): apply once the bound approving resolution is
573
528
  // EXECUTED. depInState replaces the dropped object-form dependency (which silently never gated).
574
529
  {
575
- from: "ACTIVE",
576
- to: "ACTIVE",
577
- eventName: "amend_charter",
530
+ from: 'ACTIVE',
531
+ to: 'ACTIVE',
532
+ eventName: 'amend_charter',
578
533
  // authority gate — an identity role attestation (ISSUER/BOARD_MEMBER/...) layers on additively when the identity registry lands (docs/design/app-hardening-identity-integration.md §4.2)
579
534
  guard: {
580
535
  and: [
581
- (0, guards_js_1.signerIsParty)("state.charterAuthority"),
536
+ (0, guards_js_1.signerIsParty)('state.charterAuthority'),
582
537
  // the proposal must target this amendment, and its bound resolution must be EXECUTED
583
538
  {
584
- "==": [
585
- { var: "state.pendingAmendCharter.amendmentId" },
586
- { var: "event.amendmentId" },
587
- ],
539
+ '==': [{ var: 'state.pendingAmendCharter.amendmentId' }, { var: 'event.amendmentId' }],
588
540
  },
589
- (0, guards_js_1.depInState)("state.pendingAmendCharter.ref", "EXECUTED"),
541
+ (0, guards_js_1.depInState)('state.pendingAmendCharter.ref', 'EXECUTED'),
590
542
  ],
591
543
  },
592
544
  effect: {
593
545
  merge: [
594
- { var: "state" },
546
+ { var: 'state' },
595
547
  {
596
548
  charterAmendments: {
597
549
  merge: [
598
- { var: "state.charterAmendments" },
550
+ { var: 'state.charterAmendments' },
599
551
  [
600
552
  {
601
- amendmentId: { var: "event.amendmentId" },
602
- description: { var: "event.description" },
603
- effectiveDate: { var: "event.effectiveDate" },
604
- resolutionRef: { var: "state.pendingAmendCharter.ref" },
605
- filedDate: { var: "event.filedDate" },
553
+ amendmentId: { var: 'event.amendmentId' },
554
+ description: { var: 'event.description' },
555
+ effectiveDate: { var: 'event.effectiveDate' },
556
+ resolutionRef: { var: 'state.pendingAmendCharter.ref' },
557
+ filedDate: { var: 'event.filedDate' },
606
558
  },
607
559
  ],
608
560
  ],
609
561
  },
610
562
  legalName: {
611
563
  if: [
612
- { "!=": [{ var: "event.newLegalName" }, null] },
613
- { var: "event.newLegalName" },
614
- { var: "state.legalName" },
564
+ { '!=': [{ var: 'event.newLegalName' }, null] },
565
+ { var: 'event.newLegalName' },
566
+ { var: 'state.legalName' },
615
567
  ],
616
568
  },
617
- updatedAt: { var: "$ordinal" },
569
+ updatedAt: { var: '$ordinal' },
618
570
  // clear the consumed proposal
619
571
  pendingAmendCharter: null,
620
572
  },
621
573
  {
622
- _emit: [
623
- { name: "CHARTER_AMENDED", data: { var: "event" }, destination: "external" },
624
- ],
574
+ _emit: [{ name: 'CHARTER_AMENDED', data: { var: 'event' }, destination: 'external' }],
625
575
  },
626
576
  ],
627
577
  },
@@ -629,56 +579,50 @@ exports.corpEntityDef = (0, fiber_app_js_1.defineFiberApp)({
629
579
  },
630
580
  // ACTIVE -> ACTIVE (update_share_class)
631
581
  {
632
- from: "ACTIVE",
633
- to: "ACTIVE",
634
- eventName: "update_share_class",
582
+ from: 'ACTIVE',
583
+ to: 'ACTIVE',
584
+ eventName: 'update_share_class',
635
585
  guard: {
636
586
  some: [
637
- { var: "state.charterAmendments" },
587
+ { var: 'state.charterAmendments' },
638
588
  {
639
- "==": [
640
- { var: "amendmentId" },
641
- { var: "event.charterAmendmentRef" },
642
- ],
589
+ '==': [{ var: 'amendmentId' }, { var: 'event.charterAmendmentRef' }],
643
590
  },
644
591
  ],
645
592
  },
646
593
  effect: {
647
594
  merge: [
648
- { var: "state" },
595
+ { var: 'state' },
649
596
  {
650
597
  shareStructure: {
651
598
  merge: [
652
- { var: "state.shareStructure" },
599
+ { var: 'state.shareStructure' },
653
600
  {
654
601
  classes: {
655
602
  map: [
656
- { var: "state.shareStructure.classes" },
603
+ { var: 'state.shareStructure.classes' },
657
604
  {
658
605
  if: [
659
606
  {
660
- "==": [
661
- { var: "classId" },
662
- { var: "event.classId" },
663
- ],
607
+ '==': [{ var: 'classId' }, { var: 'event.classId' }],
664
608
  },
665
609
  {
666
- classId: { var: "event.classId" },
667
- className: { var: "event.className" },
668
- authorized: { var: "event.authorized" },
610
+ classId: { var: 'event.classId' },
611
+ className: { var: 'event.className' },
612
+ authorized: { var: 'event.authorized' },
669
613
  issued: 0,
670
614
  outstanding: 0,
671
615
  treasury: 0,
672
- parValue: { var: "event.parValue" },
673
- votingRights: { var: "event.votingRights" },
674
- votesPerShare: { var: "event.votesPerShare" },
616
+ parValue: { var: 'event.parValue' },
617
+ votingRights: { var: 'event.votingRights' },
618
+ votesPerShare: { var: 'event.votesPerShare' },
675
619
  liquidationPreference: {
676
- var: "event.liquidationPreference",
620
+ var: 'event.liquidationPreference',
677
621
  },
678
- dividendRate: { var: "event.dividendRate" },
679
- convertible: { var: "event.convertible" },
622
+ dividendRate: { var: 'event.dividendRate' },
623
+ convertible: { var: 'event.convertible' },
680
624
  },
681
- { var: "" },
625
+ { var: '' },
682
626
  ],
683
627
  },
684
628
  ],
@@ -692,73 +636,67 @@ exports.corpEntityDef = (0, fiber_app_js_1.defineFiberApp)({
692
636
  },
693
637
  // ACTIVE -> ACTIVE (update_registered_agent)
694
638
  {
695
- from: "ACTIVE",
696
- to: "ACTIVE",
697
- eventName: "update_registered_agent",
639
+ from: 'ACTIVE',
640
+ to: 'ACTIVE',
641
+ eventName: 'update_registered_agent',
698
642
  // authority gate — an identity role attestation (ISSUER/BOARD_MEMBER/...) layers on additively when the identity registry lands (docs/design/app-hardening-identity-integration.md §4.2)
699
- guard: (0, guards_js_1.signerIsParty)("state.boardAuthority"),
643
+ guard: (0, guards_js_1.signerIsParty)('state.boardAuthority'),
700
644
  effect: {
701
645
  merge: [
702
- { var: "state" },
646
+ { var: 'state' },
703
647
  {
704
648
  registeredAgent: {
705
- name: { var: "event.name" },
706
- address: { var: "event.address" },
707
- phone: { var: "event.phone" },
708
- email: { var: "event.email" },
709
- effectiveDate: { var: "event.effectiveDate" },
649
+ name: { var: 'event.name' },
650
+ address: { var: 'event.address' },
651
+ phone: { var: 'event.phone' },
652
+ email: { var: 'event.email' },
653
+ effectiveDate: { var: 'event.effectiveDate' },
710
654
  },
711
655
  },
712
656
  {
713
- _emit: [
714
- { name: "REGISTERED_AGENT_CHANGED", data: { var: "event" }, destination: "external" },
715
- ],
657
+ _emit: [{ name: 'REGISTERED_AGENT_CHANGED', data: { var: 'event' }, destination: 'external' }],
716
658
  },
717
659
  ],
718
660
  },
719
661
  },
720
662
  // ACTIVE -> SUSPENDED
721
663
  {
722
- from: "ACTIVE",
723
- to: "SUSPENDED",
724
- eventName: "suspend",
664
+ from: 'ACTIVE',
665
+ to: 'SUSPENDED',
666
+ eventName: 'suspend',
725
667
  // authority gate — state-initiated enforcement; an identity role attestation (ISSUER/BOARD_MEMBER/...) layers on additively when the identity registry lands (docs/design/app-hardening-identity-integration.md §4.2)
726
- guard: (0, guards_js_1.signerIsParty)("state.stateAuthority"),
668
+ guard: (0, guards_js_1.signerIsParty)('state.stateAuthority'),
727
669
  effect: {
728
670
  merge: [
729
- { var: "state" },
671
+ { var: 'state' },
730
672
  {
731
- status: "SUSPENDED",
732
- suspensionReason: { var: "event.reason" },
733
- suspensionDate: { var: "event.suspensionDate" },
673
+ status: 'SUSPENDED',
674
+ suspensionReason: { var: 'event.reason' },
675
+ suspensionDate: { var: 'event.suspensionDate' },
734
676
  },
735
677
  {
736
- _emit: [
737
- { name: "CORPORATION_SUSPENDED", data: { var: "event" }, destination: "external" },
738
- ],
678
+ _emit: [{ name: 'CORPORATION_SUSPENDED', data: { var: 'event' }, destination: 'external' }],
739
679
  },
740
680
  ],
741
681
  },
742
682
  },
743
683
  // SUSPENDED -> ACTIVE
744
684
  {
745
- from: "SUSPENDED",
746
- to: "ACTIVE",
747
- eventName: "reinstate",
685
+ from: 'SUSPENDED',
686
+ to: 'ACTIVE',
687
+ eventName: 'reinstate',
748
688
  // authority gate — an identity role attestation (ISSUER/BOARD_MEMBER/...) layers on additively when the identity registry lands (docs/design/app-hardening-identity-integration.md §4.2)
749
- guard: (0, guards_js_1.signerIsParty)("state.boardAuthority"),
689
+ guard: (0, guards_js_1.signerIsParty)('state.boardAuthority'),
750
690
  effect: {
751
691
  merge: [
752
- { var: "state" },
692
+ { var: 'state' },
753
693
  {
754
- status: "ACTIVE",
694
+ status: 'ACTIVE',
755
695
  suspensionReason: null,
756
696
  suspensionDate: null,
757
697
  },
758
698
  {
759
- _emit: [
760
- { name: "CORPORATION_REINSTATED", data: { var: "event" }, destination: "external" },
761
- ],
699
+ _emit: [{ name: 'CORPORATION_REINSTATED', data: { var: 'event' }, destination: 'external' }],
762
700
  },
763
701
  ],
764
702
  },
@@ -767,32 +705,29 @@ exports.corpEntityDef = (0, fiber_app_js_1.defineFiberApp)({
767
705
  // fibers (board + shareholder) and record the pending dissolution, so dissolve_voluntary can read
768
706
  // both resolutions' states next transition.
769
707
  {
770
- from: "ACTIVE",
771
- to: "ACTIVE",
772
- eventName: "propose_dissolve_voluntary",
708
+ from: 'ACTIVE',
709
+ to: 'ACTIVE',
710
+ eventName: 'propose_dissolve_voluntary',
773
711
  // authority gate — both the board and shareholder authorities must sign; identity role attestations (BOARD_MEMBER/...) layer on additively when the identity registry lands (docs/design/app-hardening-identity-integration.md §4.2)
774
712
  guard: {
775
- and: [
776
- (0, guards_js_1.signerIsParty)("state.boardAuthority"),
777
- (0, guards_js_1.signerIsParty)("state.shareholderAuthority"),
778
- ],
713
+ and: [(0, guards_js_1.signerIsParty)('state.boardAuthority'), (0, guards_js_1.signerIsParty)('state.shareholderAuthority')],
779
714
  },
780
715
  effect: {
781
716
  merge: [
782
- { var: "state" },
717
+ { var: 'state' },
783
718
  {
784
719
  pendingDissolveVoluntary: {
785
- dissolutionDate: { var: "event.dissolutionDate" },
786
- boardRef: { var: "event.boardResolutionRef" },
787
- shareholderRef: { var: "event.shareholderResolutionRef" },
788
- proposedAt: { var: "$ordinal" },
720
+ dissolutionDate: { var: 'event.dissolutionDate' },
721
+ boardRef: { var: 'event.boardResolutionRef' },
722
+ shareholderRef: { var: 'event.shareholderResolutionRef' },
723
+ proposedAt: { var: '$ordinal' },
789
724
  },
790
725
  },
791
726
  // bind both resolution fibers so dissolve_voluntary can assert their states next transition
792
727
  {
793
728
  _addDependency: [
794
- { fiberId: { var: "event.boardResolutionRef" } },
795
- { fiberId: { var: "event.shareholderResolutionRef" } },
729
+ { fiberId: { var: 'event.boardResolutionRef' } },
730
+ { fiberId: { var: 'event.shareholderResolutionRef' } },
796
731
  ],
797
732
  },
798
733
  ],
@@ -802,39 +737,34 @@ exports.corpEntityDef = (0, fiber_app_js_1.defineFiberApp)({
802
737
  // ACTIVE -> DISSOLVED (dissolve_voluntary) — phase 2 (#24): execute once BOTH bound resolutions are
803
738
  // EXECUTED. depInState replaces the dropped object-form dependencies (which silently never gated).
804
739
  {
805
- from: "ACTIVE",
806
- to: "DISSOLVED",
807
- eventName: "dissolve_voluntary",
740
+ from: 'ACTIVE',
741
+ to: 'DISSOLVED',
742
+ eventName: 'dissolve_voluntary',
808
743
  // authority gate — both the board and shareholder authorities must sign; identity role attestations (BOARD_MEMBER/...) layer on additively when the identity registry lands (docs/design/app-hardening-identity-integration.md §4.2)
809
744
  guard: {
810
745
  and: [
811
- (0, guards_js_1.signerIsParty)("state.boardAuthority"),
812
- (0, guards_js_1.signerIsParty)("state.shareholderAuthority"),
746
+ (0, guards_js_1.signerIsParty)('state.boardAuthority'),
747
+ (0, guards_js_1.signerIsParty)('state.shareholderAuthority'),
813
748
  // the proposal must target this dissolution, and its bound resolutions must both be EXECUTED
814
749
  {
815
- "==": [
816
- { var: "state.pendingDissolveVoluntary.dissolutionDate" },
817
- { var: "event.dissolutionDate" },
818
- ],
750
+ '==': [{ var: 'state.pendingDissolveVoluntary.dissolutionDate' }, { var: 'event.dissolutionDate' }],
819
751
  },
820
- (0, guards_js_1.depInState)("state.pendingDissolveVoluntary.boardRef", "EXECUTED"),
821
- (0, guards_js_1.depInState)("state.pendingDissolveVoluntary.shareholderRef", "EXECUTED"),
752
+ (0, guards_js_1.depInState)('state.pendingDissolveVoluntary.boardRef', 'EXECUTED'),
753
+ (0, guards_js_1.depInState)('state.pendingDissolveVoluntary.shareholderRef', 'EXECUTED'),
822
754
  ],
823
755
  },
824
756
  effect: {
825
757
  merge: [
826
- { var: "state" },
758
+ { var: 'state' },
827
759
  {
828
- status: "DISSOLVED",
829
- dissolutionDate: { var: "event.dissolutionDate" },
830
- dissolutionReason: "VOLUNTARY",
760
+ status: 'DISSOLVED',
761
+ dissolutionDate: { var: 'event.dissolutionDate' },
762
+ dissolutionReason: 'VOLUNTARY',
831
763
  // clear the consumed proposal
832
764
  pendingDissolveVoluntary: null,
833
765
  },
834
766
  {
835
- _emit: [
836
- { name: "CORPORATION_DISSOLVED", data: { var: "event" }, destination: "external" },
837
- ],
767
+ _emit: [{ name: 'CORPORATION_DISSOLVED', data: { var: 'event' }, destination: 'external' }],
838
768
  },
839
769
  ],
840
770
  },
@@ -842,25 +772,23 @@ exports.corpEntityDef = (0, fiber_app_js_1.defineFiberApp)({
842
772
  },
843
773
  // SUSPENDED -> DISSOLVED (administrative)
844
774
  {
845
- from: "SUSPENDED",
846
- to: "DISSOLVED",
847
- eventName: "dissolve_administrative",
775
+ from: 'SUSPENDED',
776
+ to: 'DISSOLVED',
777
+ eventName: 'dissolve_administrative',
848
778
  // authority gate — state-initiated dissolution; an identity role attestation (ISSUER/BOARD_MEMBER/...) layers on additively when the identity registry lands (docs/design/app-hardening-identity-integration.md §4.2)
849
- guard: (0, guards_js_1.signerIsParty)("state.stateAuthority"),
779
+ guard: (0, guards_js_1.signerIsParty)('state.stateAuthority'),
850
780
  effect: {
851
781
  merge: [
852
- { var: "state" },
782
+ { var: 'state' },
853
783
  {
854
- status: "DISSOLVED",
855
- dissolutionDate: { var: "event.dissolutionDate" },
784
+ status: 'DISSOLVED',
785
+ dissolutionDate: { var: 'event.dissolutionDate' },
856
786
  dissolutionReason: {
857
- cat: ["ADMINISTRATIVE: ", { var: "event.reason" }],
787
+ cat: ['ADMINISTRATIVE: ', { var: 'event.reason' }],
858
788
  },
859
789
  },
860
790
  {
861
- _emit: [
862
- { name: "CORPORATION_DISSOLVED", data: { var: "event" }, destination: "external" },
863
- ],
791
+ _emit: [{ name: 'CORPORATION_DISSOLVED', data: { var: 'event' }, destination: 'external' }],
864
792
  },
865
793
  ],
866
794
  },