@ottochain/sdk 1.6.0 → 2.0.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 (40) hide show
  1. package/dist/cjs/apps/contracts/index.js +18 -13
  2. package/dist/cjs/apps/contracts/state-machines/index.js +139 -7
  3. package/dist/cjs/apps/corporate/index.js +18 -20
  4. package/dist/cjs/apps/corporate/state-machines/index.js +535 -6336
  5. package/dist/cjs/apps/governance/index.js +32 -31
  6. package/dist/cjs/apps/governance/state-machines/index.js +498 -2315
  7. package/dist/cjs/apps/identity/index.js +15 -7
  8. package/dist/cjs/apps/identity/state-machines/index.js +516 -4
  9. package/dist/cjs/apps/index.js +15 -13
  10. package/dist/cjs/apps/markets/index.js +23 -10
  11. package/dist/cjs/apps/markets/state-machines/index.js +1904 -230
  12. package/dist/esm/apps/contracts/index.js +16 -13
  13. package/dist/esm/apps/contracts/state-machines/index.js +138 -6
  14. package/dist/esm/apps/corporate/index.js +14 -20
  15. package/dist/esm/apps/corporate/state-machines/index.js +534 -6335
  16. package/dist/esm/apps/governance/index.js +26 -30
  17. package/dist/esm/apps/governance/state-machines/index.js +497 -2314
  18. package/dist/esm/apps/identity/index.js +13 -7
  19. package/dist/esm/apps/identity/state-machines/index.js +515 -3
  20. package/dist/esm/apps/index.js +14 -12
  21. package/dist/esm/apps/markets/index.js +19 -10
  22. package/dist/esm/apps/markets/state-machines/index.js +1903 -229
  23. package/dist/types/apps/contracts/index.d.ts +661 -9
  24. package/dist/types/apps/contracts/state-machines/index.d.ts +109 -6
  25. package/dist/types/apps/corporate/index.d.ts +4015 -7
  26. package/dist/types/apps/corporate/state-machines/index.d.ts +472 -5587
  27. package/dist/types/apps/governance/index.d.ts +2151 -12
  28. package/dist/types/apps/governance/state-machines/index.d.ts +462 -1875
  29. package/dist/types/apps/identity/index.d.ts +601 -4
  30. package/dist/types/apps/identity/state-machines/index.d.ts +393 -3
  31. package/dist/types/apps/index.d.ts +14 -12
  32. package/dist/types/apps/markets/index.d.ts +1690 -7
  33. package/dist/types/apps/markets/state-machines/index.d.ts +1416 -184
  34. package/package.json +1 -1
  35. package/dist/cjs/apps/oracles/index.js +0 -59
  36. package/dist/cjs/apps/oracles/state-machines/index.js +0 -415
  37. package/dist/esm/apps/oracles/index.js +0 -42
  38. package/dist/esm/apps/oracles/state-machines/index.js +0 -412
  39. package/dist/types/apps/oracles/index.d.ts +0 -34
  40. package/dist/types/apps/oracles/state-machines/index.d.ts +0 -312
@@ -9,10 +9,12 @@
9
9
  * DAOType,
10
10
  * DAOStatus,
11
11
  * MultisigDAO,
12
- * getDAODefinition
12
+ * getGovernanceDefinition,
13
+ * GOVERNANCE_DEFINITIONS
13
14
  * } from '@ottochain/sdk/apps/governance';
14
15
  *
15
- * const multisigDef = getDAODefinition('Multisig');
16
+ * const multisigDef = getGovernanceDefinition('daoMultisig');
17
+ * const simpleDef = getGovernanceDefinition('simple');
16
18
  * ```
17
19
  *
18
20
  * @packageDocumentation
@@ -22,39 +24,33 @@ export { DAOType, DAOStatus, ProposalStatus, VoteChoice, DAOMetadata, Proposal,
22
24
  // ---------------------------------------------------------------------------
23
25
  // State Machine Definitions (generated from JSON at build time)
24
26
  // ---------------------------------------------------------------------------
25
- import { daoMultisigDef, daoSingleDef, daoThresholdDef, daoTokenDef, govLegislatureDef, govExecutiveDef, govJudiciaryDef, govConstitutionDef, govSimpleDef, } from './state-machines/index.js';
26
- export const DAO_DEFINITIONS = {
27
- Single: daoSingleDef,
28
- Multisig: daoMultisigDef,
29
- Threshold: daoThresholdDef,
30
- Token: daoTokenDef,
31
- };
27
+ import { govUniversalDef, govSimpleDef, daoSingleDef, daoMultisigDef, daoTokenDef, daoReputationDef, } from './state-machines/index.js';
28
+ export { govUniversalDef, govSimpleDef, daoSingleDef, daoMultisigDef, daoTokenDef, daoReputationDef, };
29
+ /** All governance state machine definitions */
32
30
  export const GOVERNANCE_DEFINITIONS = {
33
- Legislature: govLegislatureDef,
34
- Executive: govExecutiveDef,
35
- Judiciary: govJudiciaryDef,
36
- Constitution: govConstitutionDef,
37
- Simple: govSimpleDef,
31
+ universal: govUniversalDef,
32
+ simple: govSimpleDef,
33
+ daoSingle: daoSingleDef,
34
+ daoMultisig: daoMultisigDef,
35
+ daoToken: daoTokenDef,
36
+ daoReputation: daoReputationDef,
38
37
  };
39
38
  /**
40
- * Get the state machine definition for a DAO type.
39
+ * Get a governance state machine definition by type.
40
+ * @param type - 'universal' | 'simple' | 'daoSingle' | 'daoMultisig' | 'daoToken' | 'daoReputation'
41
41
  */
42
- export function getDAODefinition(daoType) {
43
- const def = DAO_DEFINITIONS[daoType];
44
- if (!def) {
45
- throw new Error(`Unknown DAO type: ${daoType}`);
46
- }
47
- return def;
42
+ export function getGovernanceDefinition(type) {
43
+ return GOVERNANCE_DEFINITIONS[type];
48
44
  }
49
- /**
50
- * Get the state machine definition for a governance type.
51
- */
52
- export function getGovernanceDefinition(governanceType) {
53
- const def = GOVERNANCE_DEFINITIONS[governanceType];
54
- if (!def) {
55
- throw new Error(`Unknown governance type: ${governanceType}`);
56
- }
57
- return def;
45
+ /** @deprecated Use getGovernanceDefinition('daoSingle' | 'daoMultisig' | 'daoToken' | 'daoReputation') */
46
+ export function getDAODefinition(daoType) {
47
+ const map = {
48
+ Single: 'daoSingle',
49
+ Multisig: 'daoMultisig',
50
+ Threshold: 'daoReputation',
51
+ Token: 'daoToken',
52
+ };
53
+ return GOVERNANCE_DEFINITIONS[map[daoType]];
58
54
  }
59
55
  /**
60
56
  * Check if multisig has enough signatures to execute