@ottochain/sdk 2.2.0 → 2.2.2
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 +5 -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 +2 -0
- 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 -0
- package/package.json +1 -1
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Corporate
|
|
3
|
-
*
|
|
4
|
-
* TypeScript definitions using defineFiberApp() pattern.
|
|
5
|
-
* Converted from JSON state machine definitions.
|
|
2
|
+
* Corporate state machine definitions.
|
|
3
|
+
* Re-exports from TypeScript definition files.
|
|
6
4
|
*/
|
|
7
|
-
|
|
8
|
-
export { corpEntityDef
|
|
9
|
-
export {
|
|
10
|
-
export { corpShareholdersDef
|
|
11
|
-
export { corpSecuritiesDef, } from "./corp-securities.js";
|
|
12
|
-
// Re-export all definitions as a collection
|
|
13
|
-
export const corporateStateMachines = {
|
|
14
|
-
corpEntity: () => import("./corp-entity.js").then((m) => m.corpEntityDef),
|
|
15
|
-
corpBoard: () => import("./corp-board.js").then((m) => m.corpBoardDef),
|
|
16
|
-
corpShareholders: () => import("./corp-shareholders.js").then((m) => m.corpShareholdersDef),
|
|
17
|
-
corpSecurities: () => import("./corp-securities.js").then((m) => m.corpSecuritiesDef),
|
|
18
|
-
};
|
|
5
|
+
export { corpBoardDef } from './corp-board.js';
|
|
6
|
+
export { corpEntityDef } from './corp-entity.js';
|
|
7
|
+
export { corpSecuritiesDef } from './corp-securities.js';
|
|
8
|
+
export { corpShareholdersDef } from './corp-shareholders.js';
|
|
@@ -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';
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Identity
|
|
3
|
-
*
|
|
4
|
-
* TypeScript-first definitions - no JSON, no code generation.
|
|
2
|
+
* Identity state machine definitions.
|
|
3
|
+
* Re-exports from TypeScript definition files.
|
|
5
4
|
*/
|
|
6
|
-
export { identityAgentDef
|
|
7
|
-
export { identityOracleDef
|
|
8
|
-
export { identityUniversalDef
|
|
9
|
-
// Re-export all definitions as a record for iteration
|
|
10
|
-
export const IDENTITY_DEFINITIONS = {
|
|
11
|
-
agent: () => import("./identity-agent.js").then((m) => m.identityAgentDef),
|
|
12
|
-
oracle: () => import("./identity-oracle.js").then((m) => m.identityOracleDef),
|
|
13
|
-
universal: () => import("./identity-universal.js").then((m) => m.identityUniversalDef),
|
|
14
|
-
};
|
|
5
|
+
export { identityAgentDef } from './identity-agent.js';
|
|
6
|
+
export { identityOracleDef } from './identity-oracle.js';
|
|
7
|
+
export { identityUniversalDef } from './identity-universal.js';
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Markets
|
|
3
|
-
*
|
|
4
|
-
* TypeScript-first definitions using defineFiberApp() - no JSON, no code generation.
|
|
2
|
+
* Markets state machine definitions.
|
|
3
|
+
* Re-exports from TypeScript definition files.
|
|
5
4
|
*/
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
5
|
+
export { marketAuctionDef } from './market-auction.js';
|
|
6
|
+
export { marketCrowdfundDef } from './market-crowdfund.js';
|
|
7
|
+
export { marketGroupBuyDef } from './market-group-buy.js';
|
|
8
|
+
export { marketPredictionDef } from './market-prediction.js';
|
|
9
|
+
export { marketUniversalDef } from './market-universal.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -42,3 +42,5 @@ DagAddressSchema, PrivateKeySchema, PublicKeySchema, KeyPairSchema, SignaturePro
|
|
|
42
42
|
validate, validatePrivateKey, validatePublicKey, validateAddress, validateKeyPair, safeParse, assert, } from './validation.js';
|
|
43
43
|
// ─── OttoChain metagraph client ───────────────────────────────────────────────
|
|
44
44
|
export { MetagraphClient as OttoMetagraphClient } from './ottochain/metagraph-client.js';
|
|
45
|
+
// Proto definition helper
|
|
46
|
+
export { toProtoDefinition, defineFiberApp, } from './schema/fiber-app.js';
|
|
@@ -58,6 +58,7 @@ export function toJSON(def) {
|
|
|
58
58
|
*/
|
|
59
59
|
export function toProtoDefinition(def) {
|
|
60
60
|
// Extract only the proto-compatible fields
|
|
61
|
+
// NOTE: guard and effect are REQUIRED by the Scala Transition case class (no defaults)
|
|
61
62
|
const protoDef = {
|
|
62
63
|
states: {},
|
|
63
64
|
initialState: def.initialState,
|
|
@@ -65,10 +66,10 @@ export function toProtoDefinition(def) {
|
|
|
65
66
|
from: t.from,
|
|
66
67
|
to: t.to,
|
|
67
68
|
eventName: t.eventName,
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
guard: t.guard, // Required - Scala has no default
|
|
70
|
+
effect: t.effect, // Required - Scala has no default
|
|
71
|
+
// dependencies has default Set.empty in Scala, so omit if empty
|
|
70
72
|
...(t.dependencies?.length && { dependencies: [...t.dependencies] }),
|
|
71
|
-
...(t.emits?.length && { emits: [...t.emits] }),
|
|
72
73
|
})),
|
|
73
74
|
};
|
|
74
75
|
// Copy states (only id and isFinal)
|