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