@ottochain/sdk 2.2.1 → 2.2.3
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/state-machines/index.js +8 -1016
- package/dist/cjs/apps/corporate/state-machines/index.js +7 -17
- package/dist/cjs/apps/governance/state-machines/index.js +11 -12
- package/dist/cjs/apps/identity/state-machines/index.js +3 -10
- package/dist/cjs/apps/markets/state-machines/index.js +7 -8
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/ottochain/normalize.js +17 -1
- package/dist/cjs/schema/fiber-app.js +4 -3
- package/dist/esm/apps/contracts/state-machines/index.js +5 -1016
- package/dist/esm/apps/corporate/state-machines/index.js +6 -16
- package/dist/esm/apps/governance/state-machines/index.js +8 -9
- package/dist/esm/apps/identity/state-machines/index.js +5 -12
- package/dist/esm/apps/markets/state-machines/index.js +7 -8
- package/dist/esm/index.js +1 -1
- package/dist/esm/ottochain/normalize.js +17 -1
- package/dist/esm/schema/fiber-app.js +4 -3
- package/dist/types/apps/contracts/index.d.ts +1058 -743
- package/dist/types/apps/contracts/state-machines/index.d.ts +5 -799
- package/dist/types/apps/corporate/index.d.ts +5 -6
- package/dist/types/apps/corporate/state-machines/index.d.ts +6 -5447
- package/dist/types/apps/governance/index.d.ts +30 -36
- package/dist/types/apps/governance/state-machines/index.d.ts +8 -9
- package/dist/types/apps/identity/index.d.ts +3 -1
- package/dist/types/apps/identity/state-machines/index.d.ts +5 -1096
- package/dist/types/apps/markets/index.d.ts +8 -6
- package/dist/types/apps/markets/state-machines/index.d.ts +7 -8
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
export { DAOType, DAOStatus, ProposalStatus, VoteChoice, DAOMetadata, Proposal, Vote, VoteTally, SingleOwnerDAO, SingleOwnerAction, OwnershipTransfer, MultisigDAO, MultisigAction, TokenDAO, TokenProposalResult, ThresholdDAO, ThresholdVotes, ThresholdHistoryEntry, CreateDAORequest, ProposeRequest, VoteRequest, ExecuteRequest, dAOTypeFromJSON, dAOTypeToJSON, dAOStatusFromJSON, dAOStatusToJSON, proposalStatusFromJSON, proposalStatusToJSON, voteChoiceFromJSON, voteChoiceToJSON, } from "../../generated/ottochain/apps/governance/v1/governance.js";
|
|
23
23
|
import { govUniversalDef, govSimpleDef, daoSingleDef, daoMultisigDef, daoTokenDef, daoReputationDef } from "./state-machines/index.js";
|
|
24
|
+
import type { FiberAppDefinition } from "../../schema/fiber-app.js";
|
|
24
25
|
export { govUniversalDef, govSimpleDef, daoSingleDef, daoMultisigDef, daoTokenDef, daoReputationDef, };
|
|
25
26
|
/** All governance state machine definitions */
|
|
26
27
|
export declare const GOVERNANCE_DEFINITIONS: {
|
|
@@ -346,9 +347,7 @@ export declare const GOVERNANCE_DEFINITIONS: {
|
|
|
346
347
|
readonly required: readonly ["disputeId", "defendant", "claim"];
|
|
347
348
|
readonly properties: {
|
|
348
349
|
readonly agent: {
|
|
349
|
-
readonly type: "address";
|
|
350
|
-
* Check if multisig has enough signatures to execute
|
|
351
|
-
*/
|
|
350
|
+
readonly type: "address";
|
|
352
351
|
};
|
|
353
352
|
readonly disputeId: {
|
|
354
353
|
readonly type: "string";
|
|
@@ -366,6 +365,9 @@ export declare const GOVERNANCE_DEFINITIONS: {
|
|
|
366
365
|
readonly required: readonly ["content"];
|
|
367
366
|
readonly properties: {
|
|
368
367
|
readonly agent: {
|
|
368
|
+
/**
|
|
369
|
+
* Get remaining signatures needed
|
|
370
|
+
*/
|
|
369
371
|
readonly type: "address";
|
|
370
372
|
};
|
|
371
373
|
readonly content: {
|
|
@@ -394,7 +396,9 @@ export declare const GOVERNANCE_DEFINITIONS: {
|
|
|
394
396
|
};
|
|
395
397
|
};
|
|
396
398
|
};
|
|
397
|
-
};
|
|
399
|
+
}; /**
|
|
400
|
+
* Get effective voting power (includes delegation)
|
|
401
|
+
*/
|
|
398
402
|
readonly states: {
|
|
399
403
|
readonly ACTIVE: {
|
|
400
404
|
readonly id: "ACTIVE";
|
|
@@ -483,9 +487,6 @@ export declare const GOVERNANCE_DEFINITIONS: {
|
|
|
483
487
|
readonly getKey: readonly [{
|
|
484
488
|
readonly var: "state.members";
|
|
485
489
|
}, {
|
|
486
|
-
/**
|
|
487
|
-
* Check if threshold proposal has quorum
|
|
488
|
-
*/
|
|
489
490
|
readonly var: "event.agent";
|
|
490
491
|
}];
|
|
491
492
|
};
|
|
@@ -1015,9 +1016,6 @@ export declare const GOVERNANCE_DEFINITIONS: {
|
|
|
1015
1016
|
}];
|
|
1016
1017
|
};
|
|
1017
1018
|
readonly emits: readonly [{
|
|
1018
|
-
/**
|
|
1019
|
-
* Get remaining signatures needed
|
|
1020
|
-
*/
|
|
1021
1019
|
readonly event: "action_executed";
|
|
1022
1020
|
readonly to: "external";
|
|
1023
1021
|
}];
|
|
@@ -1270,9 +1268,6 @@ export declare const GOVERNANCE_DEFINITIONS: {
|
|
|
1270
1268
|
};
|
|
1271
1269
|
};
|
|
1272
1270
|
};
|
|
1273
|
-
/**
|
|
1274
|
-
* Check if multisig has enough signatures to execute
|
|
1275
|
-
*/
|
|
1276
1271
|
readonly propose_change_threshold: {
|
|
1277
1272
|
readonly description: "Propose changing the signature threshold";
|
|
1278
1273
|
readonly required: readonly ["proposalId", "newThreshold"];
|
|
@@ -1308,9 +1303,7 @@ export declare const GOVERNANCE_DEFINITIONS: {
|
|
|
1308
1303
|
};
|
|
1309
1304
|
readonly states: {
|
|
1310
1305
|
readonly ACTIVE: {
|
|
1311
|
-
readonly id: "ACTIVE";
|
|
1312
|
-
* Get effective voting power (includes delegation)
|
|
1313
|
-
*/
|
|
1306
|
+
readonly id: "ACTIVE";
|
|
1314
1307
|
readonly isFinal: false;
|
|
1315
1308
|
readonly metadata: null;
|
|
1316
1309
|
};
|
|
@@ -1397,7 +1390,9 @@ export declare const GOVERNANCE_DEFINITIONS: {
|
|
|
1397
1390
|
}, {
|
|
1398
1391
|
readonly "<": readonly [{
|
|
1399
1392
|
readonly size: {
|
|
1400
|
-
readonly var: "state.signatures";
|
|
1393
|
+
readonly var: "state.signatures"; /**
|
|
1394
|
+
* Check if agent is a member
|
|
1395
|
+
*/
|
|
1401
1396
|
};
|
|
1402
1397
|
}, {
|
|
1403
1398
|
readonly var: "state.threshold";
|
|
@@ -1406,7 +1401,9 @@ export declare const GOVERNANCE_DEFINITIONS: {
|
|
|
1406
1401
|
};
|
|
1407
1402
|
readonly effect: {
|
|
1408
1403
|
readonly merge: readonly [{
|
|
1409
|
-
readonly var: "state";
|
|
1404
|
+
readonly var: "state"; /**
|
|
1405
|
+
* Check if threshold proposal has quorum
|
|
1406
|
+
*/
|
|
1410
1407
|
}, {
|
|
1411
1408
|
readonly signatures: {
|
|
1412
1409
|
readonly setKey: readonly [{
|
|
@@ -1862,7 +1859,10 @@ export declare const GOVERNANCE_DEFINITIONS: {
|
|
|
1862
1859
|
};
|
|
1863
1860
|
readonly eventSchemas: {
|
|
1864
1861
|
readonly propose: {
|
|
1865
|
-
readonly description: "Submit a proposal (requires >= proposalThreshold tokens)";
|
|
1862
|
+
readonly description: "Submit a proposal (requires >= proposalThreshold tokens)"; /**
|
|
1863
|
+
* Get a governance state machine definition by type.
|
|
1864
|
+
* @param type - 'universal' | 'simple' | 'daoSingle' | 'daoMultisig' | 'daoToken' | 'daoReputation'
|
|
1865
|
+
*/
|
|
1866
1866
|
readonly required: readonly ["proposalId", "title", "description", "actionType", "payload"];
|
|
1867
1867
|
readonly properties: {
|
|
1868
1868
|
readonly agent: {
|
|
@@ -1911,9 +1911,6 @@ export declare const GOVERNANCE_DEFINITIONS: {
|
|
|
1911
1911
|
};
|
|
1912
1912
|
readonly reject: {
|
|
1913
1913
|
readonly description: "Formally reject a failed proposal (voting ended, failed conditions)";
|
|
1914
|
-
/**
|
|
1915
|
-
* Get remaining signatures needed
|
|
1916
|
-
*/
|
|
1917
1914
|
readonly properties: {};
|
|
1918
1915
|
};
|
|
1919
1916
|
readonly cancel: {
|
|
@@ -1983,9 +1980,6 @@ export declare const GOVERNANCE_DEFINITIONS: {
|
|
|
1983
1980
|
readonly var: "state.proposalThreshold";
|
|
1984
1981
|
}];
|
|
1985
1982
|
};
|
|
1986
|
-
/**
|
|
1987
|
-
* Check if proposal is passing
|
|
1988
|
-
*/
|
|
1989
1983
|
readonly effect: {
|
|
1990
1984
|
readonly merge: readonly [{
|
|
1991
1985
|
readonly var: "state";
|
|
@@ -2003,6 +1997,9 @@ export declare const GOVERNANCE_DEFINITIONS: {
|
|
|
2003
1997
|
readonly actionType: {
|
|
2004
1998
|
readonly var: "event.actionType";
|
|
2005
1999
|
};
|
|
2000
|
+
/**
|
|
2001
|
+
* Check if agent can propose
|
|
2002
|
+
*/
|
|
2006
2003
|
readonly payload: {
|
|
2007
2004
|
readonly var: "event.payload";
|
|
2008
2005
|
};
|
|
@@ -2013,6 +2010,9 @@ export declare const GOVERNANCE_DEFINITIONS: {
|
|
|
2013
2010
|
readonly var: "$timestamp";
|
|
2014
2011
|
};
|
|
2015
2012
|
readonly votingEndsAt: {
|
|
2013
|
+
/**
|
|
2014
|
+
* Check if agent meets threshold for action
|
|
2015
|
+
*/
|
|
2016
2016
|
readonly "+": readonly [{
|
|
2017
2017
|
readonly var: "$timestamp";
|
|
2018
2018
|
}, {
|
|
@@ -2515,9 +2515,6 @@ export declare const GOVERNANCE_DEFINITIONS: {
|
|
|
2515
2515
|
readonly description: "Join the DAO (requires >= memberThreshold reputation)";
|
|
2516
2516
|
readonly required: readonly ["agentReputation"];
|
|
2517
2517
|
readonly properties: {
|
|
2518
|
-
/**
|
|
2519
|
-
* Get remaining signatures needed
|
|
2520
|
-
*/
|
|
2521
2518
|
readonly agent: {
|
|
2522
2519
|
readonly type: "address";
|
|
2523
2520
|
};
|
|
@@ -2551,6 +2548,9 @@ export declare const GOVERNANCE_DEFINITIONS: {
|
|
|
2551
2548
|
readonly type: "number";
|
|
2552
2549
|
};
|
|
2553
2550
|
readonly voteThreshold: {
|
|
2551
|
+
/**
|
|
2552
|
+
* Get effective voting power (includes delegation)
|
|
2553
|
+
*/
|
|
2554
2554
|
readonly type: "number";
|
|
2555
2555
|
};
|
|
2556
2556
|
readonly proposeThreshold: {
|
|
@@ -2576,9 +2576,6 @@ export declare const GOVERNANCE_DEFINITIONS: {
|
|
|
2576
2576
|
readonly metadata: null;
|
|
2577
2577
|
};
|
|
2578
2578
|
};
|
|
2579
|
-
/**
|
|
2580
|
-
* Check if proposal has quorum
|
|
2581
|
-
*/
|
|
2582
2579
|
readonly initialState: "ACTIVE";
|
|
2583
2580
|
readonly transitions: readonly [{
|
|
2584
2581
|
readonly from: "ACTIVE";
|
|
@@ -2600,9 +2597,6 @@ export declare const GOVERNANCE_DEFINITIONS: {
|
|
|
2600
2597
|
readonly var: "event.proposalId";
|
|
2601
2598
|
};
|
|
2602
2599
|
readonly title: {
|
|
2603
|
-
/**
|
|
2604
|
-
* Check if agent can propose
|
|
2605
|
-
*/
|
|
2606
2600
|
readonly var: "event.title";
|
|
2607
2601
|
};
|
|
2608
2602
|
readonly description: {
|
|
@@ -3004,9 +2998,9 @@ export type GovernanceType = keyof typeof GOVERNANCE_DEFINITIONS;
|
|
|
3004
2998
|
* Get a governance state machine definition by type.
|
|
3005
2999
|
* @param type - 'universal' | 'simple' | 'daoSingle' | 'daoMultisig' | 'daoToken' | 'daoReputation'
|
|
3006
3000
|
*/
|
|
3007
|
-
export declare function getGovernanceDefinition(type: GovernanceType):
|
|
3001
|
+
export declare function getGovernanceDefinition(type: GovernanceType): FiberAppDefinition;
|
|
3008
3002
|
/** @deprecated Use getGovernanceDefinition('daoSingle' | 'daoMultisig' | 'daoToken' | 'daoReputation') */
|
|
3009
|
-
export declare function getDAODefinition(daoType: "Single" | "Multisig" | "Threshold" | "Token"):
|
|
3003
|
+
export declare function getDAODefinition(daoType: "Single" | "Multisig" | "Threshold" | "Token"): FiberAppDefinition;
|
|
3010
3004
|
import type { MultisigDAO, TokenDAO, ThresholdDAO } from "../../generated/ottochain/apps/governance/v1/governance.js";
|
|
3011
3005
|
/**
|
|
3012
3006
|
* Check if multisig has enough signatures to execute
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Governance
|
|
3
|
-
*
|
|
4
|
-
* TypeScript-first definitions using defineFiberApp() - no JSON, no code generation.
|
|
2
|
+
* Governance state machine definitions.
|
|
3
|
+
* Re-exports from TypeScript definition files.
|
|
5
4
|
*/
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export { daoSingleDef } from
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
5
|
+
export { daoMultisigDef } from './dao-multisig.js';
|
|
6
|
+
export { daoReputationDef } from './dao-reputation.js';
|
|
7
|
+
export { daoSingleDef } from './dao-single.js';
|
|
8
|
+
export { daoTokenDef } from './dao-token.js';
|
|
9
|
+
export { govSimpleDef } from './governance-simple.js';
|
|
10
|
+
export { govUniversalDef } from './governance-universal.js';
|
|
@@ -33,6 +33,7 @@ export declare const DEFAULT_REPUTATION_CONFIG: {
|
|
|
33
33
|
readonly challengeThreshold: 5;
|
|
34
34
|
};
|
|
35
35
|
import { identityUniversalDef, identityAgentDef, identityOracleDef } from "./state-machines/index.js";
|
|
36
|
+
import type { FiberAppDefinition } from "../../schema/fiber-app.js";
|
|
36
37
|
export { identityUniversalDef, identityAgentDef, identityOracleDef };
|
|
37
38
|
/** All identity state machine definitions */
|
|
38
39
|
export declare const IDENTITY_DEFINITIONS: {
|
|
@@ -698,6 +699,7 @@ export declare const IDENTITY_DEFINITIONS: {
|
|
|
698
699
|
type: "integer";
|
|
699
700
|
minimum: number;
|
|
700
701
|
};
|
|
702
|
+
/** All identity state machine definitions */
|
|
701
703
|
domains: {
|
|
702
704
|
type: "array";
|
|
703
705
|
items: {
|
|
@@ -1134,4 +1136,4 @@ export type IdentityDefType = keyof typeof IDENTITY_DEFINITIONS;
|
|
|
1134
1136
|
* Get an identity state machine definition by type.
|
|
1135
1137
|
* @param type - 'universal' | 'agent' | 'oracle' (default: 'agent')
|
|
1136
1138
|
*/
|
|
1137
|
-
export declare function getIdentityDefinition(type?: IdentityDefType):
|
|
1139
|
+
export declare function getIdentityDefinition(type?: IdentityDefType): FiberAppDefinition;
|