@ottochain/sdk 2.0.0 → 2.2.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 +1 -1
- package/dist/cjs/apps/contracts/state-machines/contract-agreement.js +272 -0
- package/dist/cjs/apps/contracts/state-machines/contract-escrow.js +284 -0
- package/dist/cjs/apps/contracts/state-machines/contract-universal.js +93 -0
- package/dist/cjs/apps/contracts/state-machines/index.js +177 -1
- package/dist/cjs/apps/corporate/state-machines/corp-board.js +1022 -0
- package/dist/cjs/apps/corporate/state-machines/corp-entity.js +671 -0
- package/dist/cjs/apps/corporate/state-machines/corp-securities.js +998 -0
- package/dist/cjs/apps/corporate/state-machines/corp-shareholders.js +1102 -0
- package/dist/cjs/apps/corporate/state-machines/index.js +20 -4440
- package/dist/cjs/apps/governance/index.js +7 -7
- package/dist/cjs/apps/governance/state-machines/dao-multisig.js +467 -0
- package/dist/cjs/apps/governance/state-machines/dao-reputation.js +458 -0
- package/dist/cjs/apps/governance/state-machines/dao-single.js +199 -0
- package/dist/cjs/apps/governance/state-machines/dao-token.js +503 -0
- package/dist/cjs/apps/governance/state-machines/governance-simple.js +482 -0
- package/dist/cjs/apps/governance/state-machines/governance-universal.js +138 -0
- package/dist/cjs/apps/governance/state-machines/index.js +16 -2934
- package/dist/cjs/apps/identity/constants.js +28 -14
- package/dist/cjs/apps/identity/index.js +27 -12
- package/dist/cjs/apps/identity/state-machines/identity-agent.js +256 -0
- package/dist/cjs/apps/identity/state-machines/identity-oracle.js +321 -0
- package/dist/cjs/apps/identity/state-machines/identity-universal.js +106 -0
- package/dist/cjs/apps/identity/state-machines/index.js +15 -784
- package/dist/cjs/apps/markets/index.js +1 -1
- package/dist/cjs/apps/markets/state-machines/index.js +14 -2298
- package/dist/cjs/apps/markets/state-machines/market-auction.js +283 -0
- package/dist/cjs/apps/markets/state-machines/market-crowdfund.js +312 -0
- package/dist/cjs/apps/markets/state-machines/market-group-buy.js +407 -0
- package/dist/cjs/apps/markets/state-machines/market-prediction.js +485 -0
- package/dist/cjs/apps/markets/state-machines/market-universal.js +129 -0
- package/dist/cjs/apps/oracles/index.js +36 -0
- package/dist/cjs/generated/google/protobuf/struct.js +1 -1
- package/dist/cjs/generated/google/protobuf/timestamp.js +1 -1
- package/dist/cjs/generated/index.js +26 -22
- package/dist/cjs/generated/ottochain/apps/contracts/v1/contract.js +1 -1
- package/dist/cjs/generated/ottochain/apps/corporate/v1/corporate.js +1 -1
- package/dist/cjs/generated/ottochain/apps/governance/v1/governance.js +1 -1
- package/dist/cjs/generated/ottochain/apps/identity/v1/attestation.js +12 -12
- package/dist/cjs/generated/ottochain/apps/identity/v1/identity.js +1688 -0
- package/dist/cjs/generated/ottochain/apps/markets/v1/market.js +1 -1
- package/dist/cjs/generated/ottochain/v1/common.js +1 -1
- package/dist/cjs/generated/ottochain/v1/fiber.js +1 -1
- package/dist/cjs/generated/ottochain/v1/messages.js +1 -1
- package/dist/cjs/generated/ottochain/v1/records.js +1 -1
- package/dist/cjs/schema/fiber-app.js +95 -0
- package/dist/cjs/schema/index.js +20 -0
- package/dist/esm/apps/contracts/index.js +3 -3
- package/dist/esm/apps/contracts/state-machines/contract-agreement.js +269 -0
- package/dist/esm/apps/contracts/state-machines/contract-escrow.js +281 -0
- package/dist/esm/apps/contracts/state-machines/contract-universal.js +90 -0
- package/dist/esm/apps/contracts/state-machines/index.js +177 -1
- package/dist/esm/apps/corporate/index.js +3 -3
- package/dist/esm/apps/corporate/state-machines/corp-board.js +1019 -0
- package/dist/esm/apps/corporate/state-machines/corp-entity.js +668 -0
- package/dist/esm/apps/corporate/state-machines/corp-securities.js +995 -0
- package/dist/esm/apps/corporate/state-machines/corp-shareholders.js +1099 -0
- package/dist/esm/apps/corporate/state-machines/index.js +15 -4439
- package/dist/esm/apps/governance/index.js +9 -9
- package/dist/esm/apps/governance/state-machines/dao-multisig.js +464 -0
- package/dist/esm/apps/governance/state-machines/dao-reputation.js +455 -0
- package/dist/esm/apps/governance/state-machines/dao-single.js +196 -0
- package/dist/esm/apps/governance/state-machines/dao-token.js +500 -0
- package/dist/esm/apps/governance/state-machines/governance-simple.js +479 -0
- package/dist/esm/apps/governance/state-machines/governance-universal.js +135 -0
- package/dist/esm/apps/governance/state-machines/index.js +9 -2933
- package/dist/esm/apps/identity/constants.js +28 -14
- package/dist/esm/apps/identity/index.js +7 -5
- package/dist/esm/apps/identity/state-machines/identity-agent.js +253 -0
- package/dist/esm/apps/identity/state-machines/identity-oracle.js +318 -0
- package/dist/esm/apps/identity/state-machines/identity-universal.js +103 -0
- package/dist/esm/apps/identity/state-machines/index.js +11 -783
- package/dist/esm/apps/index.js +5 -5
- package/dist/esm/apps/markets/index.js +3 -3
- package/dist/esm/apps/markets/state-machines/index.js +8 -2297
- package/dist/esm/apps/markets/state-machines/market-auction.js +280 -0
- package/dist/esm/apps/markets/state-machines/market-crowdfund.js +309 -0
- package/dist/esm/apps/markets/state-machines/market-group-buy.js +404 -0
- package/dist/esm/apps/markets/state-machines/market-prediction.js +482 -0
- package/dist/esm/apps/markets/state-machines/market-universal.js +126 -0
- package/dist/esm/apps/oracles/index.js +21 -0
- package/dist/esm/generated/google/protobuf/struct.js +1 -1
- package/dist/esm/generated/google/protobuf/timestamp.js +1 -1
- package/dist/esm/generated/index.js +8 -4
- package/dist/esm/generated/ottochain/apps/contracts/v1/contract.js +1 -1
- package/dist/esm/generated/ottochain/apps/corporate/v1/corporate.js +1 -1
- package/dist/esm/generated/ottochain/apps/governance/v1/governance.js +1 -1
- package/dist/esm/generated/ottochain/apps/identity/v1/attestation.js +2 -2
- package/dist/esm/generated/ottochain/apps/identity/v1/identity.js +1676 -0
- package/dist/esm/generated/ottochain/apps/markets/v1/market.js +1 -1
- package/dist/esm/generated/ottochain/v1/common.js +1 -1
- package/dist/esm/generated/ottochain/v1/fiber.js +1 -1
- package/dist/esm/generated/ottochain/v1/messages.js +1 -1
- package/dist/esm/generated/ottochain/v1/records.js +1 -1
- package/dist/esm/schema/fiber-app.js +86 -0
- package/dist/esm/schema/index.js +4 -0
- package/dist/types/apps/contracts/index.d.ts +151 -2
- package/dist/types/apps/contracts/state-machines/contract-agreement.d.ts +462 -0
- package/dist/types/apps/contracts/state-machines/contract-escrow.d.ts +511 -0
- package/dist/types/apps/contracts/state-machines/contract-universal.d.ts +147 -0
- package/dist/types/apps/contracts/state-machines/index.d.ts +149 -0
- package/dist/types/apps/corporate/index.d.ts +5263 -3825
- package/dist/types/apps/corporate/state-machines/corp-board.d.ts +1479 -0
- package/dist/types/apps/corporate/state-machines/corp-entity.d.ts +970 -0
- package/dist/types/apps/corporate/state-machines/corp-securities.d.ts +1381 -0
- package/dist/types/apps/corporate/state-machines/corp-shareholders.d.ts +1631 -0
- package/dist/types/apps/corporate/state-machines/index.d.ts +5245 -3802
- package/dist/types/apps/governance/index.d.ts +875 -37
- package/dist/types/apps/governance/state-machines/dao-multisig.d.ts +644 -0
- package/dist/types/apps/governance/state-machines/dao-reputation.d.ts +610 -0
- package/dist/types/apps/governance/state-machines/dao-single.d.ts +276 -0
- package/dist/types/apps/governance/state-machines/dao-token.d.ts +601 -0
- package/dist/types/apps/governance/state-machines/governance-simple.d.ts +652 -0
- package/dist/types/apps/governance/state-machines/governance-universal.d.ts +181 -0
- package/dist/types/apps/governance/state-machines/index.d.ts +9 -2136
- package/dist/types/apps/identity/constants.d.ts +8 -6
- package/dist/types/apps/identity/index.d.ts +1078 -577
- package/dist/types/apps/identity/state-machines/identity-agent.d.ts +401 -0
- package/dist/types/apps/identity/state-machines/identity-oracle.d.ts +550 -0
- package/dist/types/apps/identity/state-machines/identity-universal.d.ts +151 -0
- package/dist/types/apps/identity/state-machines/index.d.ts +1069 -567
- package/dist/types/apps/index.d.ts +5 -5
- package/dist/types/apps/markets/index.d.ts +535 -7
- package/dist/types/apps/markets/state-machines/index.d.ts +8 -1678
- package/dist/types/apps/markets/state-machines/market-auction.d.ts +392 -0
- package/dist/types/apps/markets/state-machines/market-crowdfund.d.ts +443 -0
- package/dist/types/apps/markets/state-machines/market-group-buy.d.ts +539 -0
- package/dist/types/apps/markets/state-machines/market-prediction.d.ts +651 -0
- package/dist/types/apps/markets/state-machines/market-universal.d.ts +191 -0
- package/dist/types/apps/oracles/index.d.ts +18 -0
- package/dist/types/generated/index.d.ts +3 -2
- package/dist/types/generated/ottochain/apps/identity/v1/attestation.d.ts +1 -1
- package/dist/types/generated/ottochain/apps/identity/v1/identity.d.ts +187 -0
- package/dist/types/schema/fiber-app.d.ts +172 -0
- package/dist/types/schema/index.d.ts +4 -0
- package/package.json +1 -1
- package/dist/cjs/generated/ottochain/apps/identity/v1/agent.js +0 -619
- package/dist/cjs/generated/ottochain/apps/oracles/v1/oracle.js +0 -1223
- package/dist/esm/generated/ottochain/apps/identity/v1/agent.js +0 -610
- package/dist/esm/generated/ottochain/apps/oracles/v1/oracle.js +0 -1217
- package/dist/types/generated/ottochain/apps/identity/v1/agent.d.ts +0 -94
- package/dist/types/generated/ottochain/apps/oracles/v1/oracle.d.ts +0 -150
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal market state machine - extend for custom use cases.
|
|
3
|
+
*/
|
|
4
|
+
export declare const marketUniversalDef: {
|
|
5
|
+
readonly metadata: {
|
|
6
|
+
readonly name: "MarketUniversal";
|
|
7
|
+
readonly app: "markets";
|
|
8
|
+
readonly type: "universal";
|
|
9
|
+
readonly version: "1.0.0";
|
|
10
|
+
readonly description: "Minimal market state machine - extend for custom use cases";
|
|
11
|
+
};
|
|
12
|
+
readonly createSchema: {
|
|
13
|
+
readonly properties: {};
|
|
14
|
+
};
|
|
15
|
+
readonly stateSchema: {
|
|
16
|
+
readonly properties: {
|
|
17
|
+
readonly status: {
|
|
18
|
+
readonly type: "string";
|
|
19
|
+
};
|
|
20
|
+
readonly totalCommitted: {
|
|
21
|
+
readonly type: "number";
|
|
22
|
+
readonly computed: true;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
readonly eventSchemas: {
|
|
27
|
+
readonly open: {
|
|
28
|
+
readonly description: "Open the market for participation";
|
|
29
|
+
};
|
|
30
|
+
readonly cancel: {
|
|
31
|
+
readonly description: "Cancel the market";
|
|
32
|
+
};
|
|
33
|
+
readonly commit: {
|
|
34
|
+
readonly description: "Commit funds to the market";
|
|
35
|
+
readonly properties: {
|
|
36
|
+
readonly amount: {
|
|
37
|
+
readonly type: "number";
|
|
38
|
+
readonly minimum: 0;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
readonly close: {
|
|
43
|
+
readonly description: "Close the market to new commits";
|
|
44
|
+
};
|
|
45
|
+
readonly settle: {
|
|
46
|
+
readonly description: "Settle the market";
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
readonly states: {
|
|
50
|
+
readonly PROPOSED: {
|
|
51
|
+
readonly id: "PROPOSED";
|
|
52
|
+
readonly isFinal: false;
|
|
53
|
+
readonly metadata: null;
|
|
54
|
+
};
|
|
55
|
+
readonly OPEN: {
|
|
56
|
+
readonly id: "OPEN";
|
|
57
|
+
readonly isFinal: false;
|
|
58
|
+
readonly metadata: null;
|
|
59
|
+
};
|
|
60
|
+
readonly CLOSED: {
|
|
61
|
+
readonly id: "CLOSED";
|
|
62
|
+
readonly isFinal: false;
|
|
63
|
+
readonly metadata: null;
|
|
64
|
+
};
|
|
65
|
+
readonly SETTLED: {
|
|
66
|
+
readonly id: "SETTLED";
|
|
67
|
+
readonly isFinal: true;
|
|
68
|
+
readonly metadata: null;
|
|
69
|
+
};
|
|
70
|
+
readonly CANCELLED: {
|
|
71
|
+
readonly id: "CANCELLED";
|
|
72
|
+
readonly isFinal: true;
|
|
73
|
+
readonly metadata: null;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
readonly initialState: "PROPOSED";
|
|
77
|
+
readonly transitions: readonly [{
|
|
78
|
+
readonly from: "PROPOSED";
|
|
79
|
+
readonly to: "OPEN";
|
|
80
|
+
readonly eventName: "open";
|
|
81
|
+
readonly guard: {
|
|
82
|
+
readonly "==": readonly [1, 1];
|
|
83
|
+
};
|
|
84
|
+
readonly effect: {
|
|
85
|
+
readonly merge: readonly [{
|
|
86
|
+
readonly var: "state";
|
|
87
|
+
}, {
|
|
88
|
+
readonly status: "OPEN";
|
|
89
|
+
readonly openedAt: {
|
|
90
|
+
readonly var: "$timestamp";
|
|
91
|
+
};
|
|
92
|
+
}];
|
|
93
|
+
};
|
|
94
|
+
readonly dependencies: readonly [];
|
|
95
|
+
}, {
|
|
96
|
+
readonly from: "PROPOSED";
|
|
97
|
+
readonly to: "CANCELLED";
|
|
98
|
+
readonly eventName: "cancel";
|
|
99
|
+
readonly guard: {
|
|
100
|
+
readonly "==": readonly [1, 1];
|
|
101
|
+
};
|
|
102
|
+
readonly effect: {
|
|
103
|
+
readonly merge: readonly [{
|
|
104
|
+
readonly var: "state";
|
|
105
|
+
}, {
|
|
106
|
+
readonly status: "CANCELLED";
|
|
107
|
+
readonly cancelledAt: {
|
|
108
|
+
readonly var: "$timestamp";
|
|
109
|
+
};
|
|
110
|
+
}];
|
|
111
|
+
};
|
|
112
|
+
readonly dependencies: readonly [];
|
|
113
|
+
}, {
|
|
114
|
+
readonly from: "OPEN";
|
|
115
|
+
readonly to: "OPEN";
|
|
116
|
+
readonly eventName: "commit";
|
|
117
|
+
readonly guard: {
|
|
118
|
+
readonly ">": readonly [{
|
|
119
|
+
readonly var: "event.amount";
|
|
120
|
+
}, 0];
|
|
121
|
+
};
|
|
122
|
+
readonly effect: {
|
|
123
|
+
readonly merge: readonly [{
|
|
124
|
+
readonly var: "state";
|
|
125
|
+
}, {
|
|
126
|
+
readonly totalCommitted: {
|
|
127
|
+
readonly "+": readonly [{
|
|
128
|
+
readonly var: "state.totalCommitted";
|
|
129
|
+
}, {
|
|
130
|
+
readonly var: "event.amount";
|
|
131
|
+
}];
|
|
132
|
+
};
|
|
133
|
+
}];
|
|
134
|
+
};
|
|
135
|
+
readonly dependencies: readonly [];
|
|
136
|
+
}, {
|
|
137
|
+
readonly from: "OPEN";
|
|
138
|
+
readonly to: "CLOSED";
|
|
139
|
+
readonly eventName: "close";
|
|
140
|
+
readonly guard: {
|
|
141
|
+
readonly "==": readonly [1, 1];
|
|
142
|
+
};
|
|
143
|
+
readonly effect: {
|
|
144
|
+
readonly merge: readonly [{
|
|
145
|
+
readonly var: "state";
|
|
146
|
+
}, {
|
|
147
|
+
readonly status: "CLOSED";
|
|
148
|
+
readonly closedAt: {
|
|
149
|
+
readonly var: "$timestamp";
|
|
150
|
+
};
|
|
151
|
+
}];
|
|
152
|
+
};
|
|
153
|
+
readonly dependencies: readonly [];
|
|
154
|
+
}, {
|
|
155
|
+
readonly from: "CLOSED";
|
|
156
|
+
readonly to: "SETTLED";
|
|
157
|
+
readonly eventName: "settle";
|
|
158
|
+
readonly guard: {
|
|
159
|
+
readonly "==": readonly [1, 1];
|
|
160
|
+
};
|
|
161
|
+
readonly effect: {
|
|
162
|
+
readonly merge: readonly [{
|
|
163
|
+
readonly var: "state";
|
|
164
|
+
}, {
|
|
165
|
+
readonly status: "SETTLED";
|
|
166
|
+
readonly settledAt: {
|
|
167
|
+
readonly var: "$timestamp";
|
|
168
|
+
};
|
|
169
|
+
}];
|
|
170
|
+
};
|
|
171
|
+
readonly dependencies: readonly [];
|
|
172
|
+
}, {
|
|
173
|
+
readonly from: "CLOSED";
|
|
174
|
+
readonly to: "CANCELLED";
|
|
175
|
+
readonly eventName: "cancel";
|
|
176
|
+
readonly guard: {
|
|
177
|
+
readonly "==": readonly [1, 1];
|
|
178
|
+
};
|
|
179
|
+
readonly effect: {
|
|
180
|
+
readonly merge: readonly [{
|
|
181
|
+
readonly var: "state";
|
|
182
|
+
}, {
|
|
183
|
+
readonly status: "CANCELLED";
|
|
184
|
+
readonly cancelledAt: {
|
|
185
|
+
readonly var: "$timestamp";
|
|
186
|
+
};
|
|
187
|
+
}];
|
|
188
|
+
};
|
|
189
|
+
readonly dependencies: readonly [];
|
|
190
|
+
}];
|
|
191
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Oracle Application — Backward Compatibility Shim
|
|
3
|
+
*
|
|
4
|
+
* ⚠️ DEPRECATED: Oracle types have been unified into the Identity app.
|
|
5
|
+
* Import from `@ottochain/sdk/apps/identity` instead.
|
|
6
|
+
*
|
|
7
|
+
* @deprecated Use `@ottochain/sdk/apps/identity`
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
export { IdentityState as OracleState, Reputation as OracleReputation, PenaltyEvent as SlashingEvent, Identity as Oracle, RegisterIdentityRequest as RegisterOracleRequest, ActivateIdentityRequest as ActivateOracleRequest, AddStakeRequest, WithdrawIdentityRequest as WithdrawOracleRequest, IdentityDefinition as OracleDefinition, identityStateFromJSON as oracleStateFromJSON, identityStateToJSON as oracleStateToJSON, } from "../identity/index.js";
|
|
11
|
+
/** @deprecated Use `getIdentityDefinition('oracle')` from `@ottochain/sdk/apps/identity` */
|
|
12
|
+
export declare function getOracleDefinition(_type?: string): unknown;
|
|
13
|
+
/** @deprecated Use `DEFAULT_REPUTATION_CONFIG` from `@ottochain/sdk/apps/identity` */
|
|
14
|
+
export declare const DEFAULT_ORACLE_CONFIG: {
|
|
15
|
+
readonly minStake: 100;
|
|
16
|
+
readonly baseReputation: 10;
|
|
17
|
+
readonly reputationDecay: 0.95;
|
|
18
|
+
};
|
|
@@ -19,10 +19,11 @@
|
|
|
19
19
|
export { FiberStatus, AccessControlPolicy, PublicAccess, WhitelistAccess, FiberOwnedAccess, StateMachineDefinition, EmittedEvent, EventReceipt, ScriptInvocation, FiberLogEntry, } from './ottochain/v1/fiber.js';
|
|
20
20
|
export { CreateStateMachine, TransitionStateMachine, ArchiveStateMachine, CreateScript, InvokeScript, OttochainMessage, } from './ottochain/v1/messages.js';
|
|
21
21
|
export { StateMachineFiberRecord, ScriptFiberRecord, FiberCommit, OnChainState, CalculatedState, } from './ottochain/v1/records.js';
|
|
22
|
-
export {
|
|
22
|
+
export { IdentityType, IdentityState, Platform, PlatformLink, Reputation, PenaltyEvent, Identity, RegisterIdentityRequest, ActivateIdentityRequest, LinkPlatformRequest, ChallengeIdentityRequest, AddStakeRequest, WithdrawIdentityRequest, IdentityDefinition, } from './ottochain/apps/identity/v1/identity.js';
|
|
23
|
+
export { IdentityState as AgentState } from './ottochain/apps/identity/v1/identity.js';
|
|
24
|
+
export { IdentityState as OracleState } from './ottochain/apps/identity/v1/identity.js';
|
|
23
25
|
export { AttestationType, ReputationDelta, Attestation, VouchRequest, ChallengeRequest, ReputationConfig, } from './ottochain/apps/identity/v1/attestation.js';
|
|
24
26
|
export { ContractState, Contract, ProposeContractRequest, AcceptContractRequest, CompleteContractRequest, RejectContractRequest, DisputeContractRequest, ContractDefinition, } from './ottochain/apps/contracts/v1/contract.js';
|
|
25
27
|
export { MarketType, MarketState, Commitment, Resolution, Market, CreateMarketRequest, CommitToMarketRequest, SubmitResolutionRequest, CancelMarketRequest, MarketDefinition, } from './ottochain/apps/markets/v1/market.js';
|
|
26
|
-
export { OracleState, OracleReputation, SlashingEvent, Oracle, RegisterOracleRequest, ActivateOracleRequest, AddStakeRequest, WithdrawStakeRequest, SlashOracleRequest, WithdrawOracleRequest, OracleDefinition, } from './ottochain/apps/oracles/v1/oracle.js';
|
|
27
28
|
export { DAOType, DAOStatus, ProposalStatus, VoteChoice, DAOMetadata, Proposal, Vote, VoteTally, SingleOwnerDAO, SingleOwnerAction, OwnershipTransfer, MultisigDAO, MultisigAction, TokenDAO, TokenProposalResult, ThresholdDAO, ThresholdVotes, ThresholdHistoryEntry, CreateDAORequest, ProposeRequest, VoteRequest, ExecuteRequest, } from './ottochain/apps/governance/v1/governance.js';
|
|
28
29
|
export { EntityType, EntityState, DirectorStatus, OfficerStatus, BoardMeetingType, ResolutionStatus, Jurisdiction, ShareClass, CorporateEntity, RegisteredAgent, Incorporator, ShareStructure, CorporateBoard, Director, SeatInfo, QuorumRules, BoardMeeting, MeetingAttendee, CorporateOfficers, Officer, OfficerAction, CorporateShareholders, Shareholder, ShareHolding, CorporateResolution, ResolutionVote, CorporateSecurities, SecurityIssuance, SecurityTransfer, CorporateCompliance, FilingRecord, ComplianceRequirement, CreateEntityRequest, AppointDirectorRequest, IssueSharesRequest, ProposeResolutionRequest, } from './ottochain/apps/corporate/v1/corporate.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
-
import { Platform } from "./
|
|
2
|
+
import { Platform } from "./identity.js";
|
|
3
3
|
export declare const protobufPackage = "ottochain.apps.identity.v1";
|
|
4
4
|
/** Types of attestations that affect reputation */
|
|
5
5
|
export declare enum AttestationType {
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire";
|
|
2
|
+
export declare const protobufPackage = "ottochain.apps.identity.v1";
|
|
3
|
+
/** Identity type - determines which state machine variant applies */
|
|
4
|
+
export declare enum IdentityType {
|
|
5
|
+
IDENTITY_TYPE_UNSPECIFIED = "IDENTITY_TYPE_UNSPECIFIED",
|
|
6
|
+
/** IDENTITY_TYPE_AGENT - AI agent identity */
|
|
7
|
+
IDENTITY_TYPE_AGENT = "IDENTITY_TYPE_AGENT",
|
|
8
|
+
/** IDENTITY_TYPE_ORACLE - Oracle service identity */
|
|
9
|
+
IDENTITY_TYPE_ORACLE = "IDENTITY_TYPE_ORACLE",
|
|
10
|
+
/** IDENTITY_TYPE_SERVICE - Generic service identity */
|
|
11
|
+
IDENTITY_TYPE_SERVICE = "IDENTITY_TYPE_SERVICE",
|
|
12
|
+
UNRECOGNIZED = "UNRECOGNIZED"
|
|
13
|
+
}
|
|
14
|
+
export declare function identityTypeFromJSON(object: any): IdentityType;
|
|
15
|
+
export declare function identityTypeToJSON(object: IdentityType): string;
|
|
16
|
+
export declare function identityTypeToNumber(object: IdentityType): number;
|
|
17
|
+
/**
|
|
18
|
+
* Unified identity lifecycle states
|
|
19
|
+
* Shared across all identity types with type-specific transitions
|
|
20
|
+
*/
|
|
21
|
+
export declare enum IdentityState {
|
|
22
|
+
IDENTITY_STATE_UNSPECIFIED = "IDENTITY_STATE_UNSPECIFIED",
|
|
23
|
+
/** IDENTITY_STATE_UNREGISTERED - Not yet registered (oracle initial) */
|
|
24
|
+
IDENTITY_STATE_UNREGISTERED = "IDENTITY_STATE_UNREGISTERED",
|
|
25
|
+
/** IDENTITY_STATE_REGISTERED - Registered, pending activation */
|
|
26
|
+
IDENTITY_STATE_REGISTERED = "IDENTITY_STATE_REGISTERED",
|
|
27
|
+
/** IDENTITY_STATE_ACTIVE - Active and participating */
|
|
28
|
+
IDENTITY_STATE_ACTIVE = "IDENTITY_STATE_ACTIVE",
|
|
29
|
+
/** IDENTITY_STATE_CHALLENGED - Under dispute (agent-specific) */
|
|
30
|
+
IDENTITY_STATE_CHALLENGED = "IDENTITY_STATE_CHALLENGED",
|
|
31
|
+
/** IDENTITY_STATE_SUSPENDED - Temporarily suspended */
|
|
32
|
+
IDENTITY_STATE_SUSPENDED = "IDENTITY_STATE_SUSPENDED",
|
|
33
|
+
/** IDENTITY_STATE_PROBATION - Recovering from suspension */
|
|
34
|
+
IDENTITY_STATE_PROBATION = "IDENTITY_STATE_PROBATION",
|
|
35
|
+
/** IDENTITY_STATE_SLASHED - Penalized (oracle-specific) */
|
|
36
|
+
IDENTITY_STATE_SLASHED = "IDENTITY_STATE_SLASHED",
|
|
37
|
+
/** IDENTITY_STATE_INACTIVE - Voluntarily inactive but can reactivate */
|
|
38
|
+
IDENTITY_STATE_INACTIVE = "IDENTITY_STATE_INACTIVE",
|
|
39
|
+
/** IDENTITY_STATE_WITHDRAWN - Terminal - exited permanently */
|
|
40
|
+
IDENTITY_STATE_WITHDRAWN = "IDENTITY_STATE_WITHDRAWN",
|
|
41
|
+
UNRECOGNIZED = "UNRECOGNIZED"
|
|
42
|
+
}
|
|
43
|
+
export declare function identityStateFromJSON(object: any): IdentityState;
|
|
44
|
+
export declare function identityStateToJSON(object: IdentityState): string;
|
|
45
|
+
export declare function identityStateToNumber(object: IdentityState): number;
|
|
46
|
+
/** Platform where identity is linked */
|
|
47
|
+
export declare enum Platform {
|
|
48
|
+
PLATFORM_UNSPECIFIED = "PLATFORM_UNSPECIFIED",
|
|
49
|
+
PLATFORM_DISCORD = "PLATFORM_DISCORD",
|
|
50
|
+
PLATFORM_TELEGRAM = "PLATFORM_TELEGRAM",
|
|
51
|
+
PLATFORM_TWITTER = "PLATFORM_TWITTER",
|
|
52
|
+
PLATFORM_GITHUB = "PLATFORM_GITHUB",
|
|
53
|
+
PLATFORM_CUSTOM = "PLATFORM_CUSTOM",
|
|
54
|
+
UNRECOGNIZED = "UNRECOGNIZED"
|
|
55
|
+
}
|
|
56
|
+
export declare function platformFromJSON(object: any): Platform;
|
|
57
|
+
export declare function platformToJSON(object: Platform): string;
|
|
58
|
+
export declare function platformToNumber(object: Platform): number;
|
|
59
|
+
/** Platform identity link */
|
|
60
|
+
export interface PlatformLink {
|
|
61
|
+
platform: Platform;
|
|
62
|
+
platformUserId: string;
|
|
63
|
+
platformUsername: string;
|
|
64
|
+
linkedAt?: Date | undefined;
|
|
65
|
+
verified: boolean;
|
|
66
|
+
}
|
|
67
|
+
/** Reputation metrics (unified for all identity types) */
|
|
68
|
+
export interface Reputation {
|
|
69
|
+
/** Overall reputation score */
|
|
70
|
+
score: number;
|
|
71
|
+
/** Accuracy percentage (oracles) */
|
|
72
|
+
accuracy: number;
|
|
73
|
+
/** Total actions/resolutions */
|
|
74
|
+
totalActions: number;
|
|
75
|
+
disputesWon: number;
|
|
76
|
+
disputesLost: number;
|
|
77
|
+
}
|
|
78
|
+
/** Record of a penalty event (slashing, suspension, etc.) */
|
|
79
|
+
export interface PenaltyEvent {
|
|
80
|
+
reason: string;
|
|
81
|
+
/** Amount slashed (if applicable) */
|
|
82
|
+
amount: number;
|
|
83
|
+
/** Market/contract where infraction occurred */
|
|
84
|
+
contextId: string;
|
|
85
|
+
timestamp?: Date | undefined;
|
|
86
|
+
}
|
|
87
|
+
/** Unified identity on-chain state */
|
|
88
|
+
export interface Identity {
|
|
89
|
+
id: string;
|
|
90
|
+
address: string;
|
|
91
|
+
publicKey: string;
|
|
92
|
+
displayName: string;
|
|
93
|
+
identityType: IdentityType;
|
|
94
|
+
state: IdentityState;
|
|
95
|
+
reputation?: Reputation | undefined;
|
|
96
|
+
/** Staked amount (oracles/services) */
|
|
97
|
+
stake: number;
|
|
98
|
+
/** Expertise domains (oracles) */
|
|
99
|
+
domains: string[];
|
|
100
|
+
platformLinks: PlatformLink[];
|
|
101
|
+
penaltyHistory: PenaltyEvent[];
|
|
102
|
+
createdAt?: Date | undefined;
|
|
103
|
+
updatedAt?: Date | undefined;
|
|
104
|
+
}
|
|
105
|
+
export interface RegisterIdentityRequest {
|
|
106
|
+
identityType: IdentityType;
|
|
107
|
+
address: string;
|
|
108
|
+
displayName: string;
|
|
109
|
+
/** For oracles/services */
|
|
110
|
+
initialStake: number;
|
|
111
|
+
/** For oracles */
|
|
112
|
+
domains: string[];
|
|
113
|
+
}
|
|
114
|
+
export interface ActivateIdentityRequest {
|
|
115
|
+
identityId: string;
|
|
116
|
+
address: string;
|
|
117
|
+
}
|
|
118
|
+
export interface LinkPlatformRequest {
|
|
119
|
+
identityId: string;
|
|
120
|
+
platform: Platform;
|
|
121
|
+
platformUserId: string;
|
|
122
|
+
platformUsername: string;
|
|
123
|
+
}
|
|
124
|
+
export interface ChallengeIdentityRequest {
|
|
125
|
+
identityId: string;
|
|
126
|
+
challengerAddress: string;
|
|
127
|
+
reason: string;
|
|
128
|
+
}
|
|
129
|
+
export interface AddStakeRequest {
|
|
130
|
+
identityId: string;
|
|
131
|
+
address: string;
|
|
132
|
+
amount: number;
|
|
133
|
+
}
|
|
134
|
+
export interface WithdrawIdentityRequest {
|
|
135
|
+
identityId: string;
|
|
136
|
+
address: string;
|
|
137
|
+
}
|
|
138
|
+
export interface IdentityDefinition {
|
|
139
|
+
/** Configuration for identity state machine */
|
|
140
|
+
identityType: IdentityType;
|
|
141
|
+
/** Default starting reputation */
|
|
142
|
+
initialReputation: number;
|
|
143
|
+
/** Min rep/stake to activate */
|
|
144
|
+
activationThreshold: number;
|
|
145
|
+
/** Min stake for oracles/services */
|
|
146
|
+
minStake: number;
|
|
147
|
+
suspensionDurationEpochs: number;
|
|
148
|
+
slashCooldownEpochs: number;
|
|
149
|
+
/** Min accuracy for oracles */
|
|
150
|
+
accuracyThreshold: number;
|
|
151
|
+
}
|
|
152
|
+
export declare const PlatformLink: MessageFns<PlatformLink>;
|
|
153
|
+
export declare const Reputation: MessageFns<Reputation>;
|
|
154
|
+
export declare const PenaltyEvent: MessageFns<PenaltyEvent>;
|
|
155
|
+
export declare const Identity: MessageFns<Identity>;
|
|
156
|
+
export declare const RegisterIdentityRequest: MessageFns<RegisterIdentityRequest>;
|
|
157
|
+
export declare const ActivateIdentityRequest: MessageFns<ActivateIdentityRequest>;
|
|
158
|
+
export declare const LinkPlatformRequest: MessageFns<LinkPlatformRequest>;
|
|
159
|
+
export declare const ChallengeIdentityRequest: MessageFns<ChallengeIdentityRequest>;
|
|
160
|
+
export declare const AddStakeRequest: MessageFns<AddStakeRequest>;
|
|
161
|
+
export declare const WithdrawIdentityRequest: MessageFns<WithdrawIdentityRequest>;
|
|
162
|
+
export declare const IdentityDefinition: MessageFns<IdentityDefinition>;
|
|
163
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
164
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {
|
|
165
|
+
$case: string;
|
|
166
|
+
} ? {
|
|
167
|
+
[K in keyof Omit<T, "$case">]?: DeepPartial<T[K]>;
|
|
168
|
+
} & {
|
|
169
|
+
$case: T["$case"];
|
|
170
|
+
} : T extends {} ? {
|
|
171
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
172
|
+
} : Partial<T>;
|
|
173
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
174
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
175
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
176
|
+
} & {
|
|
177
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
178
|
+
};
|
|
179
|
+
export interface MessageFns<T> {
|
|
180
|
+
encode(message: T, writer?: BinaryWriter): BinaryWriter;
|
|
181
|
+
decode(input: BinaryReader | Uint8Array, length?: number): T;
|
|
182
|
+
fromJSON(object: any): T;
|
|
183
|
+
toJSON(message: T): unknown;
|
|
184
|
+
create<I extends Exact<DeepPartial<T>, I>>(base?: I): T;
|
|
185
|
+
fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T;
|
|
186
|
+
}
|
|
187
|
+
export {};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fiber App Definition Schema
|
|
3
|
+
*
|
|
4
|
+
* TypeScript-first definitions for fiber apps. This is the source of truth —
|
|
5
|
+
* no JSON, no code generation. Import types directly.
|
|
6
|
+
*/
|
|
7
|
+
export type SchemaFieldType = 'string' | 'integer' | 'number' | 'boolean' | 'address' | 'uri' | 'timestamp' | 'uuid' | 'hash' | 'object' | 'array';
|
|
8
|
+
export interface SchemaField {
|
|
9
|
+
type?: SchemaFieldType;
|
|
10
|
+
description?: string;
|
|
11
|
+
default?: unknown;
|
|
12
|
+
maxLength?: number;
|
|
13
|
+
minLength?: number;
|
|
14
|
+
minimum?: number;
|
|
15
|
+
maximum?: number;
|
|
16
|
+
enum?: readonly string[];
|
|
17
|
+
pattern?: string;
|
|
18
|
+
format?: string;
|
|
19
|
+
nullable?: boolean;
|
|
20
|
+
immutable?: boolean;
|
|
21
|
+
computed?: boolean;
|
|
22
|
+
indexed?: boolean;
|
|
23
|
+
$ref?: string;
|
|
24
|
+
items?: SchemaField | {
|
|
25
|
+
$ref: string;
|
|
26
|
+
};
|
|
27
|
+
properties?: Record<string, SchemaField>;
|
|
28
|
+
required?: readonly string[];
|
|
29
|
+
additionalProperties?: boolean | SchemaField;
|
|
30
|
+
}
|
|
31
|
+
export interface SchemaDefinition {
|
|
32
|
+
type: 'object';
|
|
33
|
+
description?: string;
|
|
34
|
+
required?: readonly string[];
|
|
35
|
+
properties: Record<string, SchemaField>;
|
|
36
|
+
nullable?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface EventSchema {
|
|
39
|
+
description?: string;
|
|
40
|
+
required?: readonly string[];
|
|
41
|
+
properties?: Record<string, SchemaField>;
|
|
42
|
+
}
|
|
43
|
+
export interface StateDefinition {
|
|
44
|
+
id: string;
|
|
45
|
+
isFinal: boolean;
|
|
46
|
+
description?: string;
|
|
47
|
+
metadata?: Record<string, unknown> | null;
|
|
48
|
+
}
|
|
49
|
+
export type JsonLogicRule = Record<string, unknown>;
|
|
50
|
+
export interface EmitSpec {
|
|
51
|
+
event: string;
|
|
52
|
+
to?: string;
|
|
53
|
+
payload?: JsonLogicRule;
|
|
54
|
+
}
|
|
55
|
+
export interface DependencySpec {
|
|
56
|
+
machine: string;
|
|
57
|
+
instanceRef: JsonLogicRule;
|
|
58
|
+
requiredState?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface Transition<TState extends string = string, TEvent extends string = string> {
|
|
61
|
+
from: TState;
|
|
62
|
+
to: TState;
|
|
63
|
+
eventName: TEvent;
|
|
64
|
+
guard?: JsonLogicRule;
|
|
65
|
+
effect?: JsonLogicRule;
|
|
66
|
+
dependencies?: readonly (string | DependencySpec)[];
|
|
67
|
+
emits?: readonly (string | EmitSpec)[];
|
|
68
|
+
}
|
|
69
|
+
export interface FiberAppMetadata {
|
|
70
|
+
name: string;
|
|
71
|
+
app: string;
|
|
72
|
+
type: string;
|
|
73
|
+
version: string;
|
|
74
|
+
description?: string;
|
|
75
|
+
category?: string;
|
|
76
|
+
/** Cross-references to other fiber types (informational) */
|
|
77
|
+
crossReferences?: CrossReferences;
|
|
78
|
+
}
|
|
79
|
+
export interface CrossReferenceSpec {
|
|
80
|
+
machine: string;
|
|
81
|
+
description: string;
|
|
82
|
+
foreignKey?: string;
|
|
83
|
+
}
|
|
84
|
+
export interface CrossReferences {
|
|
85
|
+
[key: string]: string | CrossReferenceSpec;
|
|
86
|
+
}
|
|
87
|
+
export interface FiberAppDefinition<TState extends string = string, TEvent extends string = string> {
|
|
88
|
+
metadata: FiberAppMetadata;
|
|
89
|
+
/** Schema for fiber creation inputs (user-provided) */
|
|
90
|
+
createSchema?: {
|
|
91
|
+
required?: readonly string[];
|
|
92
|
+
properties: Record<string, SchemaField>;
|
|
93
|
+
};
|
|
94
|
+
/** Schema for full fiber state (includes computed fields) */
|
|
95
|
+
stateSchema?: {
|
|
96
|
+
properties: Record<string, SchemaField>;
|
|
97
|
+
};
|
|
98
|
+
/** Schema for each event's payload */
|
|
99
|
+
eventSchemas?: Record<TEvent, EventSchema>;
|
|
100
|
+
/** Reusable type definitions */
|
|
101
|
+
definitions?: Record<string, SchemaDefinition>;
|
|
102
|
+
/** State machine states */
|
|
103
|
+
states: Record<TState, StateDefinition>;
|
|
104
|
+
/** Initial state */
|
|
105
|
+
initialState: TState;
|
|
106
|
+
/** State transitions */
|
|
107
|
+
transitions: readonly Transition<TState, TEvent>[];
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Define a fiber app with full type inference.
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```ts
|
|
114
|
+
* const agentDef = defineFiberApp({
|
|
115
|
+
* metadata: { name: 'Agent', app: 'identity', type: 'agent', version: '1.0.0' },
|
|
116
|
+
* states: {
|
|
117
|
+
* REGISTERED: { id: 'REGISTERED', isFinal: false },
|
|
118
|
+
* ACTIVE: { id: 'ACTIVE', isFinal: false },
|
|
119
|
+
* },
|
|
120
|
+
* initialState: 'REGISTERED',
|
|
121
|
+
* transitions: [
|
|
122
|
+
* { from: 'REGISTERED', to: 'ACTIVE', eventName: 'activate' },
|
|
123
|
+
* ],
|
|
124
|
+
* });
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
export declare function defineFiberApp<TState extends string, TEvent extends string, TDef extends FiberAppDefinition<TState, TEvent>>(definition: TDef): TDef;
|
|
128
|
+
/** Extract state names from a fiber app definition */
|
|
129
|
+
export type StateNames<T extends FiberAppDefinition> = keyof T['states'] & string;
|
|
130
|
+
/** Extract event names from a fiber app definition */
|
|
131
|
+
export type EventNames<T extends FiberAppDefinition> = T['transitions'][number]['eventName'];
|
|
132
|
+
/** Get valid transitions from a given state */
|
|
133
|
+
export declare function getTransitionsFrom<T extends FiberAppDefinition>(def: T, state: StateNames<T>): T['transitions'][number][];
|
|
134
|
+
/** Get valid event names from a given state */
|
|
135
|
+
export declare function getEventsFrom<T extends FiberAppDefinition>(def: T, state: StateNames<T>): string[];
|
|
136
|
+
/** Check if a state is final */
|
|
137
|
+
export declare function isFinalState<T extends FiberAppDefinition>(def: T, state: StateNames<T>): boolean;
|
|
138
|
+
/** Convert definition to plain JSON (for serialization) */
|
|
139
|
+
export declare function toJSON<T extends FiberAppDefinition>(def: T): object;
|
|
140
|
+
/**
|
|
141
|
+
* Proto-compatible state machine definition for metagraph submission.
|
|
142
|
+
* Matches StateMachineDefinition from ottochain/v1/fiber.proto
|
|
143
|
+
*/
|
|
144
|
+
export interface ProtoStateMachineDefinition {
|
|
145
|
+
states: Record<string, {
|
|
146
|
+
id: string;
|
|
147
|
+
isFinal: boolean;
|
|
148
|
+
}>;
|
|
149
|
+
initialState: string;
|
|
150
|
+
transitions: Array<{
|
|
151
|
+
from: string;
|
|
152
|
+
to: string;
|
|
153
|
+
eventName: string;
|
|
154
|
+
guard?: unknown;
|
|
155
|
+
effect?: unknown;
|
|
156
|
+
dependencies?: unknown[];
|
|
157
|
+
emits?: unknown[];
|
|
158
|
+
}>;
|
|
159
|
+
metadata?: Record<string, unknown>;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Extract proto-compatible StateMachineDefinition from a FiberAppDefinition.
|
|
163
|
+
* Use this when submitting to the metagraph.
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```ts
|
|
167
|
+
* const def = getContractDefinition('agreement');
|
|
168
|
+
* const protoDef = toProtoDefinition(def);
|
|
169
|
+
* // Submit protoDef to metagraph
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
172
|
+
export declare function toProtoDefinition<T extends FiberAppDefinition>(def: T): ProtoStateMachineDefinition;
|
package/package.json
CHANGED