@ottochain/sdk 2.0.0 → 2.1.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 (142) hide show
  1. package/dist/cjs/apps/contracts/index.js +1 -1
  2. package/dist/cjs/apps/contracts/state-machines/contract-agreement.js +272 -0
  3. package/dist/cjs/apps/contracts/state-machines/contract-escrow.js +284 -0
  4. package/dist/cjs/apps/contracts/state-machines/contract-universal.js +93 -0
  5. package/dist/cjs/apps/contracts/state-machines/index.js +177 -1
  6. package/dist/cjs/apps/corporate/state-machines/corp-board.js +1022 -0
  7. package/dist/cjs/apps/corporate/state-machines/corp-entity.js +671 -0
  8. package/dist/cjs/apps/corporate/state-machines/corp-securities.js +998 -0
  9. package/dist/cjs/apps/corporate/state-machines/corp-shareholders.js +1102 -0
  10. package/dist/cjs/apps/corporate/state-machines/index.js +20 -4440
  11. package/dist/cjs/apps/governance/index.js +7 -7
  12. package/dist/cjs/apps/governance/state-machines/dao-multisig.js +467 -0
  13. package/dist/cjs/apps/governance/state-machines/dao-reputation.js +458 -0
  14. package/dist/cjs/apps/governance/state-machines/dao-single.js +199 -0
  15. package/dist/cjs/apps/governance/state-machines/dao-token.js +503 -0
  16. package/dist/cjs/apps/governance/state-machines/governance-simple.js +482 -0
  17. package/dist/cjs/apps/governance/state-machines/governance-universal.js +138 -0
  18. package/dist/cjs/apps/governance/state-machines/index.js +16 -2934
  19. package/dist/cjs/apps/identity/constants.js +28 -14
  20. package/dist/cjs/apps/identity/index.js +27 -12
  21. package/dist/cjs/apps/identity/state-machines/identity-agent.js +256 -0
  22. package/dist/cjs/apps/identity/state-machines/identity-oracle.js +321 -0
  23. package/dist/cjs/apps/identity/state-machines/identity-universal.js +106 -0
  24. package/dist/cjs/apps/identity/state-machines/index.js +15 -784
  25. package/dist/cjs/apps/markets/index.js +1 -1
  26. package/dist/cjs/apps/markets/state-machines/index.js +14 -2298
  27. package/dist/cjs/apps/markets/state-machines/market-auction.js +283 -0
  28. package/dist/cjs/apps/markets/state-machines/market-crowdfund.js +312 -0
  29. package/dist/cjs/apps/markets/state-machines/market-group-buy.js +407 -0
  30. package/dist/cjs/apps/markets/state-machines/market-prediction.js +485 -0
  31. package/dist/cjs/apps/markets/state-machines/market-universal.js +129 -0
  32. package/dist/cjs/apps/oracles/index.js +36 -0
  33. package/dist/cjs/generated/google/protobuf/struct.js +1 -1
  34. package/dist/cjs/generated/google/protobuf/timestamp.js +1 -1
  35. package/dist/cjs/generated/index.js +26 -22
  36. package/dist/cjs/generated/ottochain/apps/contracts/v1/contract.js +1 -1
  37. package/dist/cjs/generated/ottochain/apps/corporate/v1/corporate.js +1 -1
  38. package/dist/cjs/generated/ottochain/apps/governance/v1/governance.js +1 -1
  39. package/dist/cjs/generated/ottochain/apps/identity/v1/attestation.js +12 -12
  40. package/dist/cjs/generated/ottochain/apps/identity/v1/identity.js +1688 -0
  41. package/dist/cjs/generated/ottochain/apps/markets/v1/market.js +1 -1
  42. package/dist/cjs/generated/ottochain/v1/common.js +1 -1
  43. package/dist/cjs/generated/ottochain/v1/fiber.js +1 -1
  44. package/dist/cjs/generated/ottochain/v1/messages.js +1 -1
  45. package/dist/cjs/generated/ottochain/v1/records.js +1 -1
  46. package/dist/cjs/schema/fiber-app.js +55 -0
  47. package/dist/cjs/schema/index.js +20 -0
  48. package/dist/esm/apps/contracts/index.js +3 -3
  49. package/dist/esm/apps/contracts/state-machines/contract-agreement.js +269 -0
  50. package/dist/esm/apps/contracts/state-machines/contract-escrow.js +281 -0
  51. package/dist/esm/apps/contracts/state-machines/contract-universal.js +90 -0
  52. package/dist/esm/apps/contracts/state-machines/index.js +177 -1
  53. package/dist/esm/apps/corporate/index.js +3 -3
  54. package/dist/esm/apps/corporate/state-machines/corp-board.js +1019 -0
  55. package/dist/esm/apps/corporate/state-machines/corp-entity.js +668 -0
  56. package/dist/esm/apps/corporate/state-machines/corp-securities.js +995 -0
  57. package/dist/esm/apps/corporate/state-machines/corp-shareholders.js +1099 -0
  58. package/dist/esm/apps/corporate/state-machines/index.js +15 -4439
  59. package/dist/esm/apps/governance/index.js +9 -9
  60. package/dist/esm/apps/governance/state-machines/dao-multisig.js +464 -0
  61. package/dist/esm/apps/governance/state-machines/dao-reputation.js +455 -0
  62. package/dist/esm/apps/governance/state-machines/dao-single.js +196 -0
  63. package/dist/esm/apps/governance/state-machines/dao-token.js +500 -0
  64. package/dist/esm/apps/governance/state-machines/governance-simple.js +479 -0
  65. package/dist/esm/apps/governance/state-machines/governance-universal.js +135 -0
  66. package/dist/esm/apps/governance/state-machines/index.js +9 -2933
  67. package/dist/esm/apps/identity/constants.js +28 -14
  68. package/dist/esm/apps/identity/index.js +7 -5
  69. package/dist/esm/apps/identity/state-machines/identity-agent.js +253 -0
  70. package/dist/esm/apps/identity/state-machines/identity-oracle.js +318 -0
  71. package/dist/esm/apps/identity/state-machines/identity-universal.js +103 -0
  72. package/dist/esm/apps/identity/state-machines/index.js +11 -783
  73. package/dist/esm/apps/index.js +5 -5
  74. package/dist/esm/apps/markets/index.js +3 -3
  75. package/dist/esm/apps/markets/state-machines/index.js +8 -2297
  76. package/dist/esm/apps/markets/state-machines/market-auction.js +280 -0
  77. package/dist/esm/apps/markets/state-machines/market-crowdfund.js +309 -0
  78. package/dist/esm/apps/markets/state-machines/market-group-buy.js +404 -0
  79. package/dist/esm/apps/markets/state-machines/market-prediction.js +482 -0
  80. package/dist/esm/apps/markets/state-machines/market-universal.js +126 -0
  81. package/dist/esm/apps/oracles/index.js +21 -0
  82. package/dist/esm/generated/google/protobuf/struct.js +1 -1
  83. package/dist/esm/generated/google/protobuf/timestamp.js +1 -1
  84. package/dist/esm/generated/index.js +8 -4
  85. package/dist/esm/generated/ottochain/apps/contracts/v1/contract.js +1 -1
  86. package/dist/esm/generated/ottochain/apps/corporate/v1/corporate.js +1 -1
  87. package/dist/esm/generated/ottochain/apps/governance/v1/governance.js +1 -1
  88. package/dist/esm/generated/ottochain/apps/identity/v1/attestation.js +2 -2
  89. package/dist/esm/generated/ottochain/apps/identity/v1/identity.js +1676 -0
  90. package/dist/esm/generated/ottochain/apps/markets/v1/market.js +1 -1
  91. package/dist/esm/generated/ottochain/v1/common.js +1 -1
  92. package/dist/esm/generated/ottochain/v1/fiber.js +1 -1
  93. package/dist/esm/generated/ottochain/v1/messages.js +1 -1
  94. package/dist/esm/generated/ottochain/v1/records.js +1 -1
  95. package/dist/esm/schema/fiber-app.js +47 -0
  96. package/dist/esm/schema/index.js +4 -0
  97. package/dist/types/apps/contracts/index.d.ts +151 -2
  98. package/dist/types/apps/contracts/state-machines/contract-agreement.d.ts +462 -0
  99. package/dist/types/apps/contracts/state-machines/contract-escrow.d.ts +511 -0
  100. package/dist/types/apps/contracts/state-machines/contract-universal.d.ts +147 -0
  101. package/dist/types/apps/contracts/state-machines/index.d.ts +149 -0
  102. package/dist/types/apps/corporate/index.d.ts +5263 -3825
  103. package/dist/types/apps/corporate/state-machines/corp-board.d.ts +1479 -0
  104. package/dist/types/apps/corporate/state-machines/corp-entity.d.ts +970 -0
  105. package/dist/types/apps/corporate/state-machines/corp-securities.d.ts +1381 -0
  106. package/dist/types/apps/corporate/state-machines/corp-shareholders.d.ts +1631 -0
  107. package/dist/types/apps/corporate/state-machines/index.d.ts +5245 -3802
  108. package/dist/types/apps/governance/index.d.ts +875 -37
  109. package/dist/types/apps/governance/state-machines/dao-multisig.d.ts +644 -0
  110. package/dist/types/apps/governance/state-machines/dao-reputation.d.ts +610 -0
  111. package/dist/types/apps/governance/state-machines/dao-single.d.ts +276 -0
  112. package/dist/types/apps/governance/state-machines/dao-token.d.ts +601 -0
  113. package/dist/types/apps/governance/state-machines/governance-simple.d.ts +652 -0
  114. package/dist/types/apps/governance/state-machines/governance-universal.d.ts +181 -0
  115. package/dist/types/apps/governance/state-machines/index.d.ts +9 -2136
  116. package/dist/types/apps/identity/constants.d.ts +8 -6
  117. package/dist/types/apps/identity/index.d.ts +1078 -577
  118. package/dist/types/apps/identity/state-machines/identity-agent.d.ts +401 -0
  119. package/dist/types/apps/identity/state-machines/identity-oracle.d.ts +550 -0
  120. package/dist/types/apps/identity/state-machines/identity-universal.d.ts +151 -0
  121. package/dist/types/apps/identity/state-machines/index.d.ts +1069 -567
  122. package/dist/types/apps/index.d.ts +5 -5
  123. package/dist/types/apps/markets/index.d.ts +535 -7
  124. package/dist/types/apps/markets/state-machines/index.d.ts +8 -1678
  125. package/dist/types/apps/markets/state-machines/market-auction.d.ts +392 -0
  126. package/dist/types/apps/markets/state-machines/market-crowdfund.d.ts +443 -0
  127. package/dist/types/apps/markets/state-machines/market-group-buy.d.ts +539 -0
  128. package/dist/types/apps/markets/state-machines/market-prediction.d.ts +651 -0
  129. package/dist/types/apps/markets/state-machines/market-universal.d.ts +191 -0
  130. package/dist/types/apps/oracles/index.d.ts +18 -0
  131. package/dist/types/generated/index.d.ts +3 -2
  132. package/dist/types/generated/ottochain/apps/identity/v1/attestation.d.ts +1 -1
  133. package/dist/types/generated/ottochain/apps/identity/v1/identity.d.ts +187 -0
  134. package/dist/types/schema/fiber-app.d.ts +139 -0
  135. package/dist/types/schema/index.d.ts +4 -0
  136. package/package.json +1 -1
  137. package/dist/cjs/generated/ottochain/apps/identity/v1/agent.js +0 -619
  138. package/dist/cjs/generated/ottochain/apps/oracles/v1/oracle.js +0 -1223
  139. package/dist/esm/generated/ottochain/apps/identity/v1/agent.js +0 -610
  140. package/dist/esm/generated/ottochain/apps/oracles/v1/oracle.js +0 -1217
  141. package/dist/types/generated/ottochain/apps/identity/v1/agent.d.ts +0 -94
  142. package/dist/types/generated/ottochain/apps/oracles/v1/oracle.d.ts +0 -150
@@ -16,9 +16,10 @@
16
16
  *
17
17
  * @packageDocumentation
18
18
  */
19
- export { AgentState, Platform, PlatformLink, AgentIdentity, AgentIdentityDefinition, agentStateFromJSON, agentStateToJSON, platformFromJSON, platformToJSON, } from '../../generated/ottochain/apps/identity/v1/agent.js';
20
- export { AttestationType, ReputationDelta, Attestation, VouchRequest, ChallengeRequest, ReputationConfig, attestationTypeFromJSON, attestationTypeToJSON, } from '../../generated/ottochain/apps/identity/v1/attestation.js';
21
- export { AGENT_TRANSITIONS, ATTESTATION_DELTAS, canTransition, getReputationDelta, } from './constants.js';
19
+ export { IdentityType, IdentityState, Platform, PlatformLink, Reputation, PenaltyEvent, Identity, RegisterIdentityRequest, ActivateIdentityRequest, LinkPlatformRequest, ChallengeIdentityRequest, AddStakeRequest, WithdrawIdentityRequest, IdentityDefinition, identityTypeFromJSON, identityTypeToJSON, identityStateFromJSON, identityStateToJSON, platformFromJSON, platformToJSON, } from "../../generated/ottochain/apps/identity/v1/identity.js";
20
+ export { IdentityState as AgentState } from "../../generated/ottochain/apps/identity/v1/identity.js";
21
+ export { AttestationType, ReputationDelta, Attestation, VouchRequest, ChallengeRequest, ReputationConfig, attestationTypeFromJSON, attestationTypeToJSON, } from "../../generated/ottochain/apps/identity/v1/attestation.js";
22
+ export { IDENTITY_TRANSITIONS, AGENT_TRANSITIONS, ATTESTATION_DELTAS, canTransition, getReputationDelta, } from "./constants.js";
22
23
  /**
23
24
  * Default reputation configuration for agent identity
24
25
  */
@@ -31,606 +32,1106 @@ export declare const DEFAULT_REPUTATION_CONFIG: {
31
32
  readonly minReputation: 0;
32
33
  readonly challengeThreshold: 5;
33
34
  };
34
- import { identityUniversalDef, identityAgentDef, identityOracleDef } from './state-machines/index.js';
35
+ import { identityUniversalDef, identityAgentDef, identityOracleDef } from "./state-machines/index.js";
35
36
  export { identityUniversalDef, identityAgentDef, identityOracleDef };
36
37
  /** All identity state machine definitions */
37
38
  export declare const IDENTITY_DEFINITIONS: {
38
39
  readonly universal: {
39
- readonly metadata: {
40
- readonly name: "IdentityUniversal";
41
- readonly description: "Minimal identity state machine - extend for custom use cases";
42
- readonly version: "1.0.0";
40
+ metadata: {
41
+ name: string;
42
+ app: string;
43
+ type: string;
44
+ version: string;
45
+ description: string;
43
46
  };
44
- readonly states: {
45
- readonly CREATED: {
46
- readonly id: "CREATED";
47
- readonly isFinal: false;
48
- readonly metadata: null;
49
- };
50
- readonly ACTIVE: {
51
- readonly id: "ACTIVE";
52
- readonly isFinal: false;
53
- readonly metadata: null;
54
- };
55
- readonly INACTIVE: {
56
- readonly id: "INACTIVE";
57
- readonly isFinal: true;
58
- readonly metadata: null;
47
+ createSchema: {
48
+ required: readonly ["owner"];
49
+ properties: {
50
+ owner: {
51
+ type: "address";
52
+ description: string;
53
+ immutable: true;
54
+ };
55
+ metadata: {
56
+ type: "object";
57
+ description: string;
58
+ default: {};
59
+ };
59
60
  };
60
61
  };
61
- readonly initialState: "CREATED";
62
- readonly transitions: readonly [{
63
- readonly from: "CREATED";
64
- readonly to: "ACTIVE";
65
- readonly eventName: "activate";
66
- readonly guard: {
67
- readonly "==": readonly [1, 1];
68
- };
69
- readonly effect: {
70
- readonly merge: readonly [{
71
- readonly var: "state";
72
- }, {
73
- readonly status: "ACTIVE";
74
- readonly activatedAt: {
75
- readonly var: "$timestamp";
76
- };
77
- }];
78
- };
79
- readonly dependencies: readonly [];
80
- }, {
81
- readonly from: "ACTIVE";
82
- readonly to: "ACTIVE";
83
- readonly eventName: "update";
84
- readonly guard: {
85
- readonly "==": readonly [1, 1];
86
- };
87
- readonly effect: {
88
- readonly merge: readonly [{
89
- readonly var: "state";
90
- }, {
91
- readonly updatedAt: {
92
- readonly var: "$timestamp";
93
- };
94
- readonly metadata: {
95
- readonly var: "event.metadata";
96
- };
97
- }];
98
- };
99
- readonly dependencies: readonly [];
100
- }, {
101
- readonly from: "ACTIVE";
102
- readonly to: "INACTIVE";
103
- readonly eventName: "deactivate";
104
- readonly guard: {
105
- readonly "==": readonly [1, 1];
106
- };
107
- readonly effect: {
108
- readonly merge: readonly [{
109
- readonly var: "state";
110
- }, {
111
- readonly status: "INACTIVE";
112
- readonly deactivatedAt: {
113
- readonly var: "$timestamp";
114
- };
115
- }];
116
- };
117
- readonly dependencies: readonly [];
118
- }];
62
+ stateSchema: {
63
+ properties: {
64
+ owner: {
65
+ type: "address";
66
+ immutable: true;
67
+ };
68
+ status: {
69
+ type: "string";
70
+ enum: readonly ["CREATED", "ACTIVE", "INACTIVE"];
71
+ computed: true;
72
+ };
73
+ metadata: {
74
+ type: "object";
75
+ };
76
+ activatedAt: {
77
+ type: "timestamp";
78
+ computed: true;
79
+ };
80
+ updatedAt: {
81
+ type: "timestamp";
82
+ computed: true;
83
+ };
84
+ deactivatedAt: {
85
+ type: "timestamp";
86
+ computed: true;
87
+ };
88
+ };
89
+ };
90
+ eventSchemas: {
91
+ activate: {
92
+ description: string;
93
+ };
94
+ update: {
95
+ description: string;
96
+ properties: {
97
+ metadata: {
98
+ type: "object";
99
+ };
100
+ };
101
+ };
102
+ deactivate: {
103
+ description: string;
104
+ };
105
+ };
106
+ states: {
107
+ CREATED: {
108
+ id: string;
109
+ isFinal: false;
110
+ };
111
+ ACTIVE: {
112
+ id: string;
113
+ isFinal: false;
114
+ };
115
+ /**
116
+ * Default reputation configuration for agent identity
117
+ */
118
+ INACTIVE: {
119
+ id: string;
120
+ isFinal: true;
121
+ };
122
+ };
123
+ initialState: "CREATED"; /**
124
+ * Default reputation configuration for agent identity
125
+ */
126
+ transitions: ({
127
+ from: "CREATED";
128
+ to: "ACTIVE";
129
+ eventName: "activate";
130
+ guard: {
131
+ "==": number[];
132
+ };
133
+ effect: {
134
+ merge: ({
135
+ var: string;
136
+ status?: undefined;
137
+ activatedAt?: undefined;
138
+ } | {
139
+ status: string;
140
+ activatedAt: {
141
+ var: string;
142
+ };
143
+ var?: undefined;
144
+ })[];
145
+ };
146
+ } | {
147
+ from: "ACTIVE";
148
+ to: "ACTIVE";
149
+ eventName: "update";
150
+ guard: {
151
+ "==": number[];
152
+ };
153
+ effect: {
154
+ merge: ({
155
+ var: string;
156
+ updatedAt?: undefined;
157
+ metadata?: undefined;
158
+ } | {
159
+ updatedAt: {
160
+ var: string;
161
+ };
162
+ metadata: {
163
+ var: string;
164
+ };
165
+ var?: undefined;
166
+ })[];
167
+ };
168
+ } | {
169
+ from: "ACTIVE";
170
+ to: "INACTIVE";
171
+ eventName: "deactivate";
172
+ guard: {
173
+ "==": number[];
174
+ };
175
+ effect: {
176
+ merge: ({
177
+ var: string;
178
+ status?: undefined;
179
+ deactivatedAt?: undefined;
180
+ } | {
181
+ status: string;
182
+ deactivatedAt: {
183
+ var: string;
184
+ };
185
+ var?: undefined;
186
+ })[];
187
+ };
188
+ })[];
119
189
  };
120
190
  readonly agent: {
121
- readonly metadata: {
122
- readonly name: "IdentityAgent";
123
- readonly description: "Standard agent identity with reputation tracking, vouching, and lifecycle management";
124
- readonly version: "1.0.0";
191
+ metadata: {
192
+ name: string;
193
+ app: string;
194
+ type: string;
195
+ version: string;
196
+ description: string;
125
197
  };
126
- readonly states: {
127
- readonly REGISTERED: {
128
- readonly id: "REGISTERED";
129
- readonly isFinal: false;
130
- readonly metadata: null;
131
- };
132
- readonly ACTIVE: {
133
- readonly id: "ACTIVE";
134
- readonly isFinal: false;
135
- readonly metadata: null;
136
- };
137
- readonly CHALLENGED: {
138
- readonly id: "CHALLENGED";
139
- readonly isFinal: false;
140
- readonly metadata: null;
141
- };
142
- readonly SUSPENDED: {
143
- readonly id: "SUSPENDED";
144
- readonly isFinal: false;
145
- readonly metadata: null;
146
- };
147
- readonly PROBATION: {
148
- readonly id: "PROBATION";
149
- readonly isFinal: false;
150
- readonly metadata: null;
151
- };
152
- readonly WITHDRAWN: {
153
- readonly id: "WITHDRAWN";
154
- readonly isFinal: true;
155
- readonly metadata: null;
198
+ createSchema: {
199
+ required: readonly ["owner", "displayName"];
200
+ properties: {
201
+ owner: {
202
+ type: "address";
203
+ description: string;
204
+ immutable: true;
205
+ };
206
+ displayName: {
207
+ type: "string";
208
+ maxLength: number;
209
+ description: string;
210
+ };
211
+ bio: {
212
+ type: "string";
213
+ maxLength: number;
214
+ default: string;
215
+ };
216
+ avatar: {
217
+ type: "uri";
218
+ default: null;
219
+ };
220
+ platforms: {
221
+ type: "array";
222
+ items: {
223
+ $ref: string;
224
+ };
225
+ default: never[];
226
+ };
156
227
  };
157
228
  };
158
- readonly initialState: "REGISTERED";
159
- readonly transitions: readonly [{
160
- readonly from: "REGISTERED";
161
- readonly to: "ACTIVE";
162
- readonly eventName: "activate";
163
- readonly guard: {
164
- readonly "==": readonly [1, 1];
165
- };
166
- readonly effect: {
167
- readonly merge: readonly [{
168
- readonly var: "state";
169
- }, {
170
- readonly status: "ACTIVE";
171
- readonly activatedAt: {
172
- readonly var: "$timestamp";
173
- };
174
- }];
175
- };
176
- readonly dependencies: readonly [];
177
- }, {
178
- readonly from: "ACTIVE";
179
- readonly to: "ACTIVE";
180
- readonly eventName: "receive_vouch";
181
- readonly guard: {
182
- readonly "!!": readonly [{
183
- readonly var: "event.from";
184
- }];
185
- };
186
- readonly effect: {
187
- readonly merge: readonly [{
188
- readonly var: "state";
189
- }, {
190
- readonly reputation: {
191
- readonly "+": readonly [{
192
- readonly var: "state.reputation";
193
- }, 2];
194
- };
195
- }];
196
- };
197
- readonly dependencies: readonly [];
198
- }, {
199
- readonly from: "ACTIVE";
200
- readonly to: "ACTIVE";
201
- readonly eventName: "receive_completion";
202
- readonly guard: {
203
- readonly "==": readonly [1, 1];
204
- };
205
- readonly effect: {
206
- readonly merge: readonly [{
207
- readonly var: "state";
208
- }, {
209
- readonly reputation: {
210
- readonly "+": readonly [{
211
- readonly var: "state.reputation";
212
- }, 5];
213
- };
214
- }];
215
- };
216
- readonly dependencies: readonly [];
217
- }, {
218
- readonly from: "ACTIVE";
219
- readonly to: "CHALLENGED";
220
- readonly eventName: "challenge";
221
- readonly guard: {
222
- readonly "!!": readonly [{
223
- readonly var: "event.challenger";
224
- }];
225
- };
226
- readonly effect: {
227
- readonly merge: readonly [{
228
- readonly var: "state";
229
- }, {
230
- readonly status: "CHALLENGED";
231
- readonly challengedBy: {
232
- readonly var: "event.challenger";
233
- };
234
- }];
235
- };
236
- readonly dependencies: readonly [];
237
- }, {
238
- readonly from: "CHALLENGED";
239
- readonly to: "ACTIVE";
240
- readonly eventName: "dismiss_challenge";
241
- readonly guard: {
242
- readonly "==": readonly [1, 1];
243
- };
244
- readonly effect: {
245
- readonly merge: readonly [{
246
- readonly var: "state";
247
- }, {
248
- readonly status: "ACTIVE";
249
- readonly challengedBy: null;
250
- }];
251
- };
252
- readonly dependencies: readonly [];
253
- }, {
254
- readonly from: "CHALLENGED";
255
- readonly to: "SUSPENDED";
256
- readonly eventName: "uphold_challenge";
257
- readonly guard: {
258
- readonly "==": readonly [1, 1];
259
- };
260
- readonly effect: {
261
- readonly merge: readonly [{
262
- readonly var: "state";
263
- }, {
264
- readonly status: "SUSPENDED";
265
- readonly suspendedAt: {
266
- readonly var: "$timestamp";
267
- };
268
- }];
269
- };
270
- readonly dependencies: readonly [];
271
- }, {
272
- readonly from: "SUSPENDED";
273
- readonly to: "PROBATION";
274
- readonly eventName: "begin_probation";
275
- readonly guard: {
276
- readonly "==": readonly [1, 1];
277
- };
278
- readonly effect: {
279
- readonly merge: readonly [{
280
- readonly var: "state";
281
- }, {
282
- readonly status: "PROBATION";
283
- readonly probationStartedAt: {
284
- readonly var: "$timestamp";
285
- };
286
- }];
287
- };
288
- readonly dependencies: readonly [];
289
- }, {
290
- readonly from: "PROBATION";
291
- readonly to: "ACTIVE";
292
- readonly eventName: "complete_probation";
293
- readonly guard: {
294
- readonly "==": readonly [1, 1];
295
- };
296
- readonly effect: {
297
- readonly merge: readonly [{
298
- readonly var: "state";
299
- }, {
300
- readonly status: "ACTIVE";
301
- readonly probationStartedAt: null;
302
- }];
303
- };
304
- readonly dependencies: readonly [];
305
- }, {
306
- readonly from: "ACTIVE";
307
- readonly to: "WITHDRAWN";
308
- readonly eventName: "withdraw";
309
- readonly guard: {
310
- readonly "==": readonly [1, 1];
311
- };
312
- readonly effect: {
313
- readonly merge: readonly [{
314
- readonly var: "state";
315
- }, {
316
- readonly status: "WITHDRAWN";
317
- }];
318
- };
319
- readonly dependencies: readonly [];
320
- }];
229
+ stateSchema: {
230
+ properties: {
231
+ owner: {
232
+ type: "address";
233
+ immutable: true;
234
+ };
235
+ displayName: {
236
+ type: "string";
237
+ };
238
+ bio: {
239
+ type: "string";
240
+ };
241
+ avatar: {
242
+ type: "uri";
243
+ };
244
+ platforms: {
245
+ type: "array";
246
+ items: {
247
+ $ref: string;
248
+ };
249
+ };
250
+ status: {
251
+ type: "string";
252
+ enum: readonly ["REGISTERED", "ACTIVE", "CHALLENGED", "SUSPENDED", "PROBATION", "WITHDRAWN"];
253
+ computed: true;
254
+ };
255
+ reputation: {
256
+ type: "integer";
257
+ default: number;
258
+ computed: true;
259
+ };
260
+ activatedAt: {
261
+ type: "timestamp";
262
+ computed: true;
263
+ };
264
+ suspendedAt: {
265
+ type: "timestamp";
266
+ computed: true;
267
+ };
268
+ probationStartedAt: {
269
+ type: "timestamp";
270
+ computed: true;
271
+ };
272
+ challengedBy: {
273
+ type: "address";
274
+ computed: true;
275
+ };
276
+ };
277
+ };
278
+ eventSchemas: {
279
+ activate: {
280
+ description: string;
281
+ };
282
+ receive_vouch: {
283
+ description: string;
284
+ required: readonly ["from"];
285
+ properties: {
286
+ from: {
287
+ type: "address";
288
+ description: string;
289
+ };
290
+ weight: {
291
+ type: "integer";
292
+ minimum: number;
293
+ maximum: number;
294
+ default: number;
295
+ };
296
+ };
297
+ };
298
+ receive_completion: {
299
+ description: string;
300
+ };
301
+ challenge: {
302
+ description: string;
303
+ required: readonly ["challenger", "reason"];
304
+ properties: {
305
+ challenger: {
306
+ type: "address";
307
+ };
308
+ reason: {
309
+ type: "string";
310
+ maxLength: number;
311
+ };
312
+ evidence: {
313
+ type: "array";
314
+ items: {
315
+ type: "uri";
316
+ };
317
+ };
318
+ };
319
+ };
320
+ dismiss_challenge: {
321
+ description: string;
322
+ };
323
+ uphold_challenge: {
324
+ description: string;
325
+ };
326
+ begin_probation: {
327
+ description: string;
328
+ };
329
+ complete_probation: {
330
+ description: string;
331
+ };
332
+ withdraw: {
333
+ description: string;
334
+ };
335
+ };
336
+ definitions: {
337
+ PlatformLink: {
338
+ type: "object";
339
+ required: readonly ["platform", "handle"];
340
+ properties: {
341
+ platform: {
342
+ type: "string";
343
+ enum: readonly ["twitter", "github", "discord", "telegram", "moltbook"];
344
+ };
345
+ handle: {
346
+ type: "string";
347
+ };
348
+ verified: {
349
+ type: "boolean";
350
+ default: boolean;
351
+ };
352
+ };
353
+ };
354
+ };
355
+ states: {
356
+ REGISTERED: {
357
+ id: string;
358
+ isFinal: false;
359
+ };
360
+ ACTIVE: {
361
+ id: string;
362
+ isFinal: false;
363
+ };
364
+ CHALLENGED: {
365
+ id: string;
366
+ isFinal: false;
367
+ };
368
+ SUSPENDED: {
369
+ id: string;
370
+ isFinal: false;
371
+ };
372
+ PROBATION: {
373
+ id: string;
374
+ isFinal: false;
375
+ };
376
+ WITHDRAWN: {
377
+ id: string;
378
+ isFinal: true;
379
+ };
380
+ };
381
+ initialState: "REGISTERED";
382
+ transitions: ({
383
+ from: "REGISTERED";
384
+ to: "ACTIVE";
385
+ eventName: "activate";
386
+ guard: {
387
+ "==": number[];
388
+ "!!"?: undefined;
389
+ };
390
+ effect: {
391
+ merge: ({
392
+ var: string;
393
+ status?: undefined;
394
+ activatedAt?: undefined;
395
+ } | {
396
+ status: string;
397
+ activatedAt: {
398
+ var: string;
399
+ };
400
+ var?: undefined;
401
+ })[];
402
+ };
403
+ } | {
404
+ from: "ACTIVE";
405
+ to: "ACTIVE";
406
+ eventName: "receive_vouch";
407
+ guard: {
408
+ "!!": {
409
+ var: string;
410
+ }[];
411
+ "=="?: undefined;
412
+ };
413
+ effect: {
414
+ merge: ({
415
+ var: string;
416
+ reputation?: undefined;
417
+ } | {
418
+ reputation: {
419
+ "+": (number | {
420
+ var: string;
421
+ })[];
422
+ };
423
+ var?: undefined;
424
+ })[];
425
+ };
426
+ } | {
427
+ from: "ACTIVE";
428
+ to: "ACTIVE";
429
+ eventName: "receive_completion";
430
+ guard: {
431
+ "==": number[];
432
+ "!!"?: undefined;
433
+ };
434
+ effect: {
435
+ merge: ({
436
+ var: string;
437
+ reputation?: undefined;
438
+ } | {
439
+ reputation: {
440
+ "+": (number | {
441
+ var: string;
442
+ })[];
443
+ };
444
+ var?: undefined;
445
+ })[];
446
+ };
447
+ } | {
448
+ from: "ACTIVE";
449
+ to: "CHALLENGED";
450
+ eventName: "challenge";
451
+ guard: {
452
+ "!!": {
453
+ var: string;
454
+ }[];
455
+ "=="?: undefined;
456
+ };
457
+ effect: {
458
+ merge: ({
459
+ var: string;
460
+ status?: undefined;
461
+ challengedBy?: undefined;
462
+ } | {
463
+ status: string;
464
+ challengedBy: {
465
+ var: string;
466
+ };
467
+ var?: undefined;
468
+ })[];
469
+ };
470
+ } | {
471
+ from: "CHALLENGED";
472
+ to: "ACTIVE";
473
+ eventName: "dismiss_challenge";
474
+ guard: {
475
+ "==": number[];
476
+ "!!"?: undefined;
477
+ };
478
+ effect: {
479
+ merge: ({
480
+ var: string;
481
+ status?: undefined;
482
+ challengedBy?: undefined;
483
+ } | {
484
+ status: string;
485
+ challengedBy: null;
486
+ var?: undefined;
487
+ })[];
488
+ };
489
+ } | {
490
+ from: "CHALLENGED";
491
+ to: "SUSPENDED";
492
+ eventName: "uphold_challenge";
493
+ guard: {
494
+ "==": number[];
495
+ "!!"?: undefined;
496
+ };
497
+ effect: {
498
+ merge: ({
499
+ var: string;
500
+ status?: undefined;
501
+ suspendedAt?: undefined;
502
+ } | {
503
+ status: string;
504
+ suspendedAt: {
505
+ var: string;
506
+ };
507
+ var?: undefined;
508
+ })[];
509
+ };
510
+ } | {
511
+ from: "SUSPENDED";
512
+ to: "PROBATION";
513
+ eventName: "begin_probation";
514
+ guard: {
515
+ "==": number[];
516
+ "!!"?: undefined;
517
+ };
518
+ effect: {
519
+ merge: ({
520
+ var: string;
521
+ status?: undefined;
522
+ probationStartedAt?: undefined;
523
+ } | {
524
+ status: string;
525
+ probationStartedAt: {
526
+ var: string;
527
+ };
528
+ var?: undefined;
529
+ })[];
530
+ };
531
+ } | {
532
+ from: "PROBATION";
533
+ to: "ACTIVE";
534
+ eventName: "complete_probation";
535
+ guard: {
536
+ "==": number[];
537
+ "!!"?: undefined;
538
+ };
539
+ effect: {
540
+ merge: ({
541
+ var: string;
542
+ status?: undefined;
543
+ probationStartedAt?: undefined;
544
+ } | {
545
+ status: string;
546
+ probationStartedAt: null;
547
+ var?: undefined;
548
+ })[];
549
+ };
550
+ } | {
551
+ from: "ACTIVE";
552
+ to: "WITHDRAWN";
553
+ eventName: "withdraw";
554
+ guard: {
555
+ "==": number[];
556
+ "!!"?: undefined;
557
+ };
558
+ effect: {
559
+ merge: ({
560
+ var: string;
561
+ status?: undefined;
562
+ } | {
563
+ status: string;
564
+ var?: undefined;
565
+ })[];
566
+ };
567
+ } | {
568
+ from: "REGISTERED";
569
+ to: "WITHDRAWN";
570
+ eventName: "withdraw";
571
+ guard: {
572
+ "==": number[];
573
+ "!!"?: undefined;
574
+ };
575
+ effect: {
576
+ merge: ({
577
+ var: string;
578
+ status?: undefined;
579
+ } | {
580
+ status: string;
581
+ var?: undefined;
582
+ })[];
583
+ };
584
+ })[];
321
585
  };
322
586
  readonly oracle: {
323
- readonly metadata: {
324
- readonly name: "IdentityOracle";
325
- readonly description: "Oracle identity with staking, attestations, reputation, and slashing mechanics";
326
- readonly version: "1.0.0";
587
+ metadata: {
588
+ name: string;
589
+ app: string;
590
+ type: string;
591
+ version: string;
592
+ description: string;
593
+ };
594
+ createSchema: {
595
+ required: readonly ["owner", "stake", "domains"];
596
+ properties: {
597
+ owner: {
598
+ type: "address";
599
+ description: string;
600
+ immutable: true;
601
+ };
602
+ stake: {
603
+ type: "integer";
604
+ minimum: number;
605
+ description: string;
606
+ };
607
+ domains: {
608
+ type: "array";
609
+ items: {
610
+ type: "string";
611
+ };
612
+ description: string;
613
+ };
614
+ minStake: {
615
+ type: "integer";
616
+ default: number;
617
+ description: string;
618
+ };
619
+ };
620
+ };
621
+ stateSchema: {
622
+ properties: {
623
+ owner: {
624
+ type: "address";
625
+ immutable: true;
626
+ };
627
+ address: {
628
+ type: "address";
629
+ computed: true;
630
+ };
631
+ stake: {
632
+ type: "integer";
633
+ computed: true;
634
+ };
635
+ minStake: {
636
+ type: "integer";
637
+ };
638
+ domains: {
639
+ type: "array";
640
+ items: {
641
+ type: "string";
642
+ };
643
+ };
644
+ status: {
645
+ type: "string";
646
+ enum: readonly ["UNREGISTERED", "REGISTERED", "ACTIVE", "SLASHED", "WITHDRAWN"];
647
+ computed: true;
648
+ };
649
+ reputation: {
650
+ type: "object";
651
+ properties: {
652
+ accuracy: {
653
+ type: "integer";
654
+ };
655
+ totalResolutions: {
656
+ type: "integer";
657
+ };
658
+ disputesWon: {
659
+ type: "integer";
660
+ };
661
+ disputesLost: {
662
+ type: "integer";
663
+ };
664
+ };
665
+ computed: true;
666
+ };
667
+ slashingHistory: {
668
+ type: "array";
669
+ computed: true;
670
+ };
671
+ registeredAt: {
672
+ type: "timestamp";
673
+ computed: true;
674
+ };
675
+ activatedAt: {
676
+ type: "timestamp";
677
+ computed: true;
678
+ };
679
+ slashedAt: {
680
+ type: "timestamp";
681
+ computed: true;
682
+ };
683
+ withdrawnAt: {
684
+ type: "timestamp";
685
+ computed: true;
686
+ };
687
+ };
688
+ };
689
+ eventSchemas: {
690
+ register: {
691
+ description: string;
692
+ required: readonly ["agent", "stake", "domains"];
693
+ properties: {
694
+ agent: {
695
+ type: "address";
696
+ };
697
+ stake: {
698
+ type: "integer";
699
+ minimum: number;
700
+ };
701
+ domains: {
702
+ type: "array";
703
+ items: {
704
+ type: "string";
705
+ };
706
+ };
707
+ };
708
+ };
709
+ activate: {
710
+ description: string;
711
+ required: readonly ["agent"];
712
+ properties: {
713
+ agent: {
714
+ type: "address";
715
+ };
716
+ adminOverride: {
717
+ type: "boolean";
718
+ default: boolean;
719
+ };
720
+ };
721
+ };
722
+ add_stake: {
723
+ description: string;
724
+ required: readonly ["agent", "amount"];
725
+ properties: {
726
+ agent: {
727
+ type: "address";
728
+ };
729
+ amount: {
730
+ type: "integer";
731
+ minimum: number;
732
+ };
733
+ };
734
+ };
735
+ record_resolution: {
736
+ description: string;
737
+ required: readonly ["marketId", "correct"];
738
+ properties: {
739
+ marketId: {
740
+ type: "uuid";
741
+ };
742
+ correct: {
743
+ type: "boolean";
744
+ };
745
+ };
746
+ };
747
+ slash: {
748
+ description: string;
749
+ required: readonly ["reason", "amount"];
750
+ properties: {
751
+ reason: {
752
+ type: "string";
753
+ };
754
+ amount: {
755
+ type: "integer";
756
+ minimum: number;
757
+ };
758
+ marketId: {
759
+ type: "uuid";
760
+ };
761
+ };
762
+ };
763
+ reactivate: {
764
+ description: string;
765
+ required: readonly ["agent"];
766
+ properties: {
767
+ agent: {
768
+ type: "address";
769
+ };
770
+ };
771
+ };
772
+ withdraw: {
773
+ description: string;
774
+ required: readonly ["agent"];
775
+ properties: {
776
+ agent: {
777
+ type: "address";
778
+ };
779
+ };
780
+ };
327
781
  };
328
- readonly states: {
329
- readonly UNREGISTERED: {
330
- readonly id: "UNREGISTERED";
331
- readonly isFinal: false;
332
- readonly metadata: null;
333
- };
334
- readonly REGISTERED: {
335
- readonly id: "REGISTERED";
336
- readonly isFinal: false;
337
- readonly metadata: null;
338
- };
339
- readonly ACTIVE: {
340
- readonly id: "ACTIVE";
341
- readonly isFinal: false;
342
- readonly metadata: null;
343
- };
344
- readonly SLASHED: {
345
- readonly id: "SLASHED";
346
- readonly isFinal: false;
347
- readonly metadata: null;
348
- };
349
- readonly WITHDRAWN: {
350
- readonly id: "WITHDRAWN";
351
- readonly isFinal: true;
352
- readonly metadata: null;
782
+ states: {
783
+ UNREGISTERED: {
784
+ id: string;
785
+ isFinal: false;
786
+ };
787
+ REGISTERED: {
788
+ id: string;
789
+ isFinal: false;
790
+ };
791
+ ACTIVE: {
792
+ id: string;
793
+ isFinal: false;
794
+ };
795
+ SLASHED: {
796
+ id: string;
797
+ isFinal: false;
798
+ };
799
+ WITHDRAWN: {
800
+ id: string;
801
+ isFinal: true;
353
802
  };
354
803
  };
355
- readonly initialState: "UNREGISTERED";
356
- readonly transitions: readonly [{
357
- readonly from: "UNREGISTERED";
358
- readonly to: "REGISTERED";
359
- readonly eventName: "register";
360
- readonly guard: {
361
- readonly ">=": readonly [{
362
- readonly var: "event.stake";
363
- }, {
364
- readonly var: "state.minStake";
365
- }];
366
- };
367
- readonly effect: {
368
- readonly merge: readonly [{
369
- readonly var: "state";
370
- }, {
371
- readonly status: "REGISTERED";
372
- readonly address: {
373
- readonly var: "event.agent";
374
- };
375
- readonly stake: {
376
- readonly var: "event.stake";
377
- };
378
- readonly registeredAt: {
379
- readonly var: "$timestamp";
380
- };
381
- readonly reputation: {
382
- readonly accuracy: 100;
383
- readonly totalResolutions: 0;
384
- readonly disputesWon: 0;
385
- readonly disputesLost: 0;
386
- };
387
- readonly domains: {
388
- readonly var: "event.domains";
389
- };
390
- readonly slashingHistory: readonly [];
391
- }];
392
- };
393
- readonly dependencies: readonly [];
394
- }, {
395
- readonly from: "REGISTERED";
396
- readonly to: "ACTIVE";
397
- readonly eventName: "activate";
398
- readonly guard: {
399
- readonly or: readonly [{
400
- readonly "===": readonly [{
401
- readonly var: "event.agent";
402
- }, {
403
- readonly var: "state.address";
404
- }];
405
- }, {
406
- readonly var: "event.adminOverride";
407
- }];
408
- };
409
- readonly effect: {
410
- readonly merge: readonly [{
411
- readonly var: "state";
412
- }, {
413
- readonly status: "ACTIVE";
414
- readonly activatedAt: {
415
- readonly var: "$timestamp";
416
- };
417
- }];
418
- };
419
- readonly dependencies: readonly [];
420
- }, {
421
- readonly from: "ACTIVE";
422
- readonly to: "ACTIVE";
423
- readonly eventName: "add_stake";
424
- readonly guard: {
425
- readonly and: readonly [{
426
- readonly "===": readonly [{
427
- readonly var: "event.agent";
428
- }, {
429
- readonly var: "state.address";
430
- }];
431
- }, {
432
- readonly ">": readonly [{
433
- readonly var: "event.amount";
434
- }, 0];
435
- }];
436
- };
437
- readonly effect: {
438
- readonly merge: readonly [{
439
- readonly var: "state";
440
- }, {
441
- readonly stake: {
442
- readonly "+": readonly [{
443
- readonly var: "state.stake";
444
- }, {
445
- readonly var: "event.amount";
446
- }];
447
- };
448
- readonly lastStakeAt: {
449
- readonly var: "$timestamp";
450
- };
451
- }];
452
- };
453
- readonly dependencies: readonly [];
454
- }, {
455
- readonly from: "ACTIVE";
456
- readonly to: "ACTIVE";
457
- readonly eventName: "record_resolution";
458
- readonly guard: {
459
- readonly var: "event.marketId";
460
- };
461
- readonly effect: {
462
- readonly merge: readonly [{
463
- readonly var: "state";
464
- }, {
465
- readonly reputation: {
466
- readonly merge: readonly [{
467
- readonly var: "state.reputation";
468
- }, {
469
- readonly totalResolutions: {
470
- readonly "+": readonly [{
471
- readonly var: "state.reputation.totalResolutions";
472
- }, 1];
804
+ initialState: "UNREGISTERED";
805
+ transitions: ({
806
+ from: "UNREGISTERED";
807
+ to: "REGISTERED";
808
+ eventName: "register";
809
+ guard: {
810
+ ">=": {
811
+ var: string;
812
+ }[];
813
+ or?: undefined;
814
+ and?: undefined;
815
+ var?: undefined;
816
+ "==="?: undefined;
817
+ };
818
+ effect: {
819
+ merge: ({
820
+ var: string;
821
+ status?: undefined;
822
+ address?: undefined;
823
+ stake?: undefined;
824
+ registeredAt?: undefined;
825
+ reputation?: undefined;
826
+ domains?: undefined;
827
+ slashingHistory?: undefined;
828
+ } | {
829
+ status: string;
830
+ address: {
831
+ var: string;
832
+ };
833
+ stake: {
834
+ var: string;
835
+ };
836
+ registeredAt: {
837
+ var: string;
838
+ };
839
+ reputation: {
840
+ accuracy: number;
841
+ totalResolutions: number;
842
+ disputesWon: number;
843
+ disputesLost: number;
844
+ };
845
+ domains: {
846
+ var: string;
847
+ };
848
+ slashingHistory: never[];
849
+ var?: undefined;
850
+ })[];
851
+ };
852
+ } | {
853
+ from: "REGISTERED";
854
+ to: "ACTIVE";
855
+ eventName: "activate";
856
+ guard: {
857
+ or: ({
858
+ "===": {
859
+ var: string;
860
+ }[];
861
+ var?: undefined;
862
+ } | {
863
+ var: string;
864
+ "==="?: undefined;
865
+ })[];
866
+ ">="?: undefined;
867
+ and?: undefined;
868
+ var?: undefined;
869
+ "==="?: undefined;
870
+ };
871
+ effect: {
872
+ merge: ({
873
+ var: string;
874
+ status?: undefined;
875
+ activatedAt?: undefined;
876
+ } | {
877
+ status: string;
878
+ activatedAt: {
879
+ var: string;
880
+ };
881
+ var?: undefined;
882
+ })[];
883
+ };
884
+ } | {
885
+ from: "ACTIVE";
886
+ to: "ACTIVE";
887
+ eventName: "add_stake";
888
+ guard: {
889
+ and: ({
890
+ "===": {
891
+ var: string;
892
+ }[];
893
+ ">"?: undefined;
894
+ } | {
895
+ ">": (number | {
896
+ var: string;
897
+ })[];
898
+ "==="?: undefined;
899
+ })[];
900
+ ">="?: undefined;
901
+ or?: undefined;
902
+ var?: undefined;
903
+ "==="?: undefined;
904
+ };
905
+ effect: {
906
+ merge: ({
907
+ var: string;
908
+ stake?: undefined;
909
+ lastStakeAt?: undefined;
910
+ } | {
911
+ stake: {
912
+ "+": {
913
+ var: string;
914
+ }[];
915
+ };
916
+ lastStakeAt: {
917
+ var: string;
918
+ };
919
+ var?: undefined;
920
+ })[];
921
+ };
922
+ } | {
923
+ from: "ACTIVE";
924
+ to: "ACTIVE";
925
+ eventName: "record_resolution";
926
+ guard: {
927
+ var: string;
928
+ ">="?: undefined;
929
+ or?: undefined;
930
+ and?: undefined;
931
+ "==="?: undefined;
932
+ };
933
+ effect: {
934
+ merge: ({
935
+ var: string;
936
+ reputation?: undefined;
937
+ lastResolutionAt?: undefined;
938
+ } | {
939
+ reputation: {
940
+ merge: ({
941
+ var: string;
942
+ totalResolutions?: undefined;
943
+ accuracy?: undefined;
944
+ } | {
945
+ totalResolutions: {
946
+ "+": (number | {
947
+ var: string;
948
+ })[];
473
949
  };
474
- readonly accuracy: {
475
- readonly if: readonly [{
476
- readonly var: "event.correct";
477
- }, {
478
- readonly var: "state.reputation.accuracy";
479
- }, {
480
- readonly "-": readonly [{
481
- readonly var: "state.reputation.accuracy";
482
- }, 5];
483
- }];
950
+ accuracy: {
951
+ if: ({
952
+ var: string;
953
+ "-"?: undefined;
954
+ } | {
955
+ "-": (number | {
956
+ var: string;
957
+ })[];
958
+ var?: undefined;
959
+ })[];
484
960
  };
485
- }];
486
- };
487
- readonly lastResolutionAt: {
488
- readonly var: "$timestamp";
489
- };
490
- }];
491
- };
492
- readonly dependencies: readonly [];
493
- }, {
494
- readonly from: "ACTIVE";
495
- readonly to: "SLASHED";
496
- readonly eventName: "slash";
497
- readonly guard: {
498
- readonly and: readonly [{
499
- readonly var: "event.reason";
500
- }, {
501
- readonly ">": readonly [{
502
- readonly var: "event.amount";
503
- }, 0];
504
- }, {
505
- readonly "<=": readonly [{
506
- readonly var: "event.amount";
507
- }, {
508
- readonly var: "state.stake";
509
- }];
510
- }];
511
- };
512
- readonly effect: {
513
- readonly merge: readonly [{
514
- readonly var: "state";
515
- }, {
516
- readonly status: "SLASHED";
517
- readonly stake: {
518
- readonly "-": readonly [{
519
- readonly var: "state.stake";
520
- }, {
521
- readonly var: "event.amount";
522
- }];
523
- };
524
- readonly slashingHistory: {
525
- readonly cat: readonly [{
526
- readonly var: "state.slashingHistory";
527
- }, readonly [{
528
- readonly reason: {
529
- readonly var: "event.reason";
961
+ var?: undefined;
962
+ })[];
963
+ };
964
+ lastResolutionAt: {
965
+ var: string;
966
+ };
967
+ var?: undefined;
968
+ })[];
969
+ };
970
+ } | {
971
+ from: "ACTIVE";
972
+ to: "SLASHED";
973
+ eventName: "slash";
974
+ guard: {
975
+ and: ({
976
+ var: string;
977
+ ">"?: undefined;
978
+ "<="?: undefined;
979
+ } | {
980
+ ">": (number | {
981
+ var: string;
982
+ })[];
983
+ var?: undefined;
984
+ "<="?: undefined;
985
+ } | {
986
+ "<=": {
987
+ var: string;
988
+ }[];
989
+ var?: undefined;
990
+ ">"?: undefined;
991
+ })[];
992
+ ">="?: undefined;
993
+ or?: undefined;
994
+ var?: undefined;
995
+ "==="?: undefined;
996
+ };
997
+ effect: {
998
+ merge: ({
999
+ var: string;
1000
+ status?: undefined;
1001
+ stake?: undefined;
1002
+ slashingHistory?: undefined;
1003
+ slashedAt?: undefined;
1004
+ } | {
1005
+ status: string;
1006
+ stake: {
1007
+ "-": {
1008
+ var: string;
1009
+ }[];
1010
+ };
1011
+ slashingHistory: {
1012
+ cat: ({
1013
+ var: string;
1014
+ } | {
1015
+ reason: {
1016
+ var: string;
530
1017
  };
531
- readonly amount: {
532
- readonly var: "event.amount";
1018
+ amount: {
1019
+ var: string;
533
1020
  };
534
- readonly marketId: {
535
- readonly var: "event.marketId";
1021
+ marketId: {
1022
+ var: string;
536
1023
  };
537
- readonly slashedAt: {
538
- readonly var: "$timestamp";
1024
+ slashedAt: {
1025
+ var: string;
539
1026
  };
540
- }]];
541
- };
542
- readonly slashedAt: {
543
- readonly var: "$timestamp";
544
- };
545
- }];
546
- };
547
- readonly dependencies: readonly [];
548
- }, {
549
- readonly from: "SLASHED";
550
- readonly to: "ACTIVE";
551
- readonly eventName: "reactivate";
552
- readonly guard: {
553
- readonly and: readonly [{
554
- readonly "===": readonly [{
555
- readonly var: "event.agent";
556
- }, {
557
- readonly var: "state.address";
558
- }];
559
- }, {
560
- readonly ">=": readonly [{
561
- readonly var: "state.stake";
562
- }, {
563
- readonly var: "state.minStake";
564
- }];
565
- }];
566
- };
567
- readonly effect: {
568
- readonly merge: readonly [{
569
- readonly var: "state";
570
- }, {
571
- readonly status: "ACTIVE";
572
- readonly reactivatedAt: {
573
- readonly var: "$timestamp";
574
- };
575
- }];
576
- };
577
- readonly dependencies: readonly [];
578
- }, {
579
- readonly from: "ACTIVE";
580
- readonly to: "WITHDRAWN";
581
- readonly eventName: "withdraw";
582
- readonly guard: {
583
- readonly "===": readonly [{
584
- readonly var: "event.agent";
585
- }, {
586
- readonly var: "state.address";
587
- }];
588
- };
589
- readonly effect: {
590
- readonly merge: readonly [{
591
- readonly var: "state";
592
- }, {
593
- readonly status: "WITHDRAWN";
594
- readonly withdrawnAt: {
595
- readonly var: "$timestamp";
596
- };
597
- readonly finalStake: {
598
- readonly var: "state.stake";
599
- };
600
- }];
601
- };
602
- readonly dependencies: readonly [];
603
- }, {
604
- readonly from: "SLASHED";
605
- readonly to: "WITHDRAWN";
606
- readonly eventName: "withdraw";
607
- readonly guard: {
608
- readonly "===": readonly [{
609
- readonly var: "event.agent";
610
- }, {
611
- readonly var: "state.address";
612
- }];
613
- };
614
- readonly effect: {
615
- readonly merge: readonly [{
616
- readonly var: "state";
617
- }, {
618
- readonly status: "WITHDRAWN";
619
- readonly withdrawnAt: {
620
- readonly var: "$timestamp";
621
- };
622
- readonly finalStake: {
623
- readonly var: "state.stake";
624
- };
625
- }];
626
- };
627
- readonly dependencies: readonly [];
628
- }];
1027
+ }[])[];
1028
+ };
1029
+ slashedAt: {
1030
+ var: string;
1031
+ };
1032
+ var?: undefined;
1033
+ })[];
1034
+ };
1035
+ } | {
1036
+ from: "SLASHED";
1037
+ to: "ACTIVE";
1038
+ eventName: "reactivate";
1039
+ guard: {
1040
+ and: ({
1041
+ "===": {
1042
+ var: string;
1043
+ }[];
1044
+ ">="?: undefined;
1045
+ } | {
1046
+ ">=": {
1047
+ var: string;
1048
+ }[];
1049
+ "==="?: undefined;
1050
+ })[];
1051
+ ">="?: undefined;
1052
+ or?: undefined;
1053
+ var?: undefined;
1054
+ "==="?: undefined;
1055
+ };
1056
+ effect: {
1057
+ merge: ({
1058
+ var: string;
1059
+ status?: undefined;
1060
+ reactivatedAt?: undefined;
1061
+ } | {
1062
+ status: string;
1063
+ reactivatedAt: {
1064
+ var: string;
1065
+ };
1066
+ var?: undefined;
1067
+ })[];
1068
+ };
1069
+ } | {
1070
+ from: "ACTIVE";
1071
+ to: "WITHDRAWN";
1072
+ eventName: "withdraw";
1073
+ guard: {
1074
+ "===": {
1075
+ var: string;
1076
+ }[];
1077
+ ">="?: undefined;
1078
+ or?: undefined;
1079
+ and?: undefined;
1080
+ var?: undefined;
1081
+ };
1082
+ effect: {
1083
+ merge: ({
1084
+ var: string;
1085
+ status?: undefined;
1086
+ withdrawnAt?: undefined;
1087
+ finalStake?: undefined;
1088
+ } | {
1089
+ status: string;
1090
+ withdrawnAt: {
1091
+ var: string;
1092
+ };
1093
+ finalStake: {
1094
+ var: string;
1095
+ };
1096
+ var?: undefined;
1097
+ })[];
1098
+ };
1099
+ } | {
1100
+ from: "SLASHED";
1101
+ to: "WITHDRAWN";
1102
+ eventName: "withdraw";
1103
+ guard: {
1104
+ "===": {
1105
+ var: string;
1106
+ }[];
1107
+ ">="?: undefined;
1108
+ or?: undefined;
1109
+ and?: undefined;
1110
+ var?: undefined;
1111
+ };
1112
+ effect: {
1113
+ merge: ({
1114
+ var: string;
1115
+ status?: undefined;
1116
+ withdrawnAt?: undefined;
1117
+ finalStake?: undefined;
1118
+ } | {
1119
+ status: string;
1120
+ withdrawnAt: {
1121
+ var: string;
1122
+ };
1123
+ finalStake: {
1124
+ var: string;
1125
+ };
1126
+ var?: undefined;
1127
+ })[];
1128
+ };
1129
+ })[];
629
1130
  };
630
1131
  };
631
- export type IdentityType = keyof typeof IDENTITY_DEFINITIONS;
1132
+ export type IdentityDefType = keyof typeof IDENTITY_DEFINITIONS;
632
1133
  /**
633
1134
  * Get an identity state machine definition by type.
634
1135
  * @param type - 'universal' | 'agent' | 'oracle' (default: 'agent')
635
1136
  */
636
- export declare function getIdentityDefinition(type?: IdentityType): unknown;
1137
+ export declare function getIdentityDefinition(type?: IdentityDefType): unknown;