@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.
- package/dist/cjs/apps/contracts/index.js +18 -13
- package/dist/cjs/apps/contracts/state-machines/index.js +139 -7
- package/dist/cjs/apps/corporate/index.js +18 -20
- package/dist/cjs/apps/corporate/state-machines/index.js +535 -6336
- package/dist/cjs/apps/governance/index.js +32 -31
- package/dist/cjs/apps/governance/state-machines/index.js +498 -2315
- package/dist/cjs/apps/identity/index.js +15 -7
- package/dist/cjs/apps/identity/state-machines/index.js +516 -4
- package/dist/cjs/apps/index.js +15 -13
- package/dist/cjs/apps/markets/index.js +23 -10
- package/dist/cjs/apps/markets/state-machines/index.js +1904 -230
- package/dist/esm/apps/contracts/index.js +16 -13
- package/dist/esm/apps/contracts/state-machines/index.js +138 -6
- package/dist/esm/apps/corporate/index.js +14 -20
- package/dist/esm/apps/corporate/state-machines/index.js +534 -6335
- package/dist/esm/apps/governance/index.js +26 -30
- package/dist/esm/apps/governance/state-machines/index.js +497 -2314
- package/dist/esm/apps/identity/index.js +13 -7
- package/dist/esm/apps/identity/state-machines/index.js +515 -3
- package/dist/esm/apps/index.js +14 -12
- package/dist/esm/apps/markets/index.js +19 -10
- package/dist/esm/apps/markets/state-machines/index.js +1903 -229
- package/dist/types/apps/contracts/index.d.ts +661 -9
- package/dist/types/apps/contracts/state-machines/index.d.ts +109 -6
- package/dist/types/apps/corporate/index.d.ts +4015 -7
- package/dist/types/apps/corporate/state-machines/index.d.ts +472 -5587
- package/dist/types/apps/governance/index.d.ts +2151 -12
- package/dist/types/apps/governance/state-machines/index.d.ts +462 -1875
- package/dist/types/apps/identity/index.d.ts +601 -4
- package/dist/types/apps/identity/state-machines/index.d.ts +393 -3
- package/dist/types/apps/index.d.ts +14 -12
- package/dist/types/apps/markets/index.d.ts +1690 -7
- package/dist/types/apps/markets/state-machines/index.d.ts +1416 -184
- package/package.json +1 -1
- package/dist/cjs/apps/oracles/index.js +0 -59
- package/dist/cjs/apps/oracles/state-machines/index.js +0 -415
- package/dist/esm/apps/oracles/index.js +0 -42
- package/dist/esm/apps/oracles/state-machines/index.js +0 -412
- package/dist/types/apps/oracles/index.d.ts +0 -34
- 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
|
-
*
|
|
12
|
+
* getGovernanceDefinition,
|
|
13
|
+
* GOVERNANCE_DEFINITIONS
|
|
13
14
|
* } from '@ottochain/sdk/apps/governance';
|
|
14
15
|
*
|
|
15
|
-
* const multisigDef =
|
|
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 {
|
|
26
|
-
export
|
|
27
|
-
|
|
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
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
universal: govUniversalDef,
|
|
32
|
+
simple: govSimpleDef,
|
|
33
|
+
daoSingle: daoSingleDef,
|
|
34
|
+
daoMultisig: daoMultisigDef,
|
|
35
|
+
daoToken: daoTokenDef,
|
|
36
|
+
daoReputation: daoReputationDef,
|
|
38
37
|
};
|
|
39
38
|
/**
|
|
40
|
-
* Get
|
|
39
|
+
* Get a governance state machine definition by type.
|
|
40
|
+
* @param type - 'universal' | 'simple' | 'daoSingle' | 'daoMultisig' | 'daoToken' | 'daoReputation'
|
|
41
41
|
*/
|
|
42
|
-
export function
|
|
43
|
-
|
|
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
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
return
|
|
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
|