@ottochain/sdk 1.7.0-beta.2 → 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 (113) 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 +20 -20
  20. package/dist/cjs/apps/identity/index.js +13 -21
  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/index.js +14 -7
  34. package/dist/cjs/generated/ottochain/apps/identity/v1/identity.js +197 -198
  35. package/dist/cjs/schema/fiber-app.js +55 -0
  36. package/dist/cjs/schema/index.js +20 -0
  37. package/dist/esm/apps/contracts/index.js +3 -3
  38. package/dist/esm/apps/contracts/state-machines/contract-agreement.js +269 -0
  39. package/dist/esm/apps/contracts/state-machines/contract-escrow.js +281 -0
  40. package/dist/esm/apps/contracts/state-machines/contract-universal.js +90 -0
  41. package/dist/esm/apps/contracts/state-machines/index.js +177 -1
  42. package/dist/esm/apps/corporate/index.js +3 -3
  43. package/dist/esm/apps/corporate/state-machines/corp-board.js +1019 -0
  44. package/dist/esm/apps/corporate/state-machines/corp-entity.js +668 -0
  45. package/dist/esm/apps/corporate/state-machines/corp-securities.js +995 -0
  46. package/dist/esm/apps/corporate/state-machines/corp-shareholders.js +1099 -0
  47. package/dist/esm/apps/corporate/state-machines/index.js +15 -4439
  48. package/dist/esm/apps/governance/index.js +9 -9
  49. package/dist/esm/apps/governance/state-machines/dao-multisig.js +464 -0
  50. package/dist/esm/apps/governance/state-machines/dao-reputation.js +455 -0
  51. package/dist/esm/apps/governance/state-machines/dao-single.js +196 -0
  52. package/dist/esm/apps/governance/state-machines/dao-token.js +500 -0
  53. package/dist/esm/apps/governance/state-machines/governance-simple.js +479 -0
  54. package/dist/esm/apps/governance/state-machines/governance-universal.js +135 -0
  55. package/dist/esm/apps/governance/state-machines/index.js +9 -2933
  56. package/dist/esm/apps/identity/constants.js +21 -21
  57. package/dist/esm/apps/identity/index.js +13 -22
  58. package/dist/esm/apps/identity/state-machines/identity-agent.js +253 -0
  59. package/dist/esm/apps/identity/state-machines/identity-oracle.js +318 -0
  60. package/dist/esm/apps/identity/state-machines/identity-universal.js +103 -0
  61. package/dist/esm/apps/identity/state-machines/index.js +11 -783
  62. package/dist/esm/apps/index.js +5 -5
  63. package/dist/esm/apps/markets/index.js +3 -3
  64. package/dist/esm/apps/markets/state-machines/index.js +8 -2297
  65. package/dist/esm/apps/markets/state-machines/market-auction.js +280 -0
  66. package/dist/esm/apps/markets/state-machines/market-crowdfund.js +309 -0
  67. package/dist/esm/apps/markets/state-machines/market-group-buy.js +404 -0
  68. package/dist/esm/apps/markets/state-machines/market-prediction.js +482 -0
  69. package/dist/esm/apps/markets/state-machines/market-universal.js +126 -0
  70. package/dist/esm/apps/oracles/index.js +21 -0
  71. package/dist/esm/generated/index.js +8 -3
  72. package/dist/esm/generated/ottochain/apps/identity/v1/identity.js +196 -197
  73. package/dist/esm/schema/fiber-app.js +47 -0
  74. package/dist/esm/schema/index.js +4 -0
  75. package/dist/types/apps/contracts/index.d.ts +151 -2
  76. package/dist/types/apps/contracts/state-machines/contract-agreement.d.ts +462 -0
  77. package/dist/types/apps/contracts/state-machines/contract-escrow.d.ts +511 -0
  78. package/dist/types/apps/contracts/state-machines/contract-universal.d.ts +147 -0
  79. package/dist/types/apps/contracts/state-machines/index.d.ts +149 -0
  80. package/dist/types/apps/corporate/index.d.ts +5263 -3825
  81. package/dist/types/apps/corporate/state-machines/corp-board.d.ts +1479 -0
  82. package/dist/types/apps/corporate/state-machines/corp-entity.d.ts +970 -0
  83. package/dist/types/apps/corporate/state-machines/corp-securities.d.ts +1381 -0
  84. package/dist/types/apps/corporate/state-machines/corp-shareholders.d.ts +1631 -0
  85. package/dist/types/apps/corporate/state-machines/index.d.ts +5245 -3802
  86. package/dist/types/apps/governance/index.d.ts +875 -37
  87. package/dist/types/apps/governance/state-machines/dao-multisig.d.ts +644 -0
  88. package/dist/types/apps/governance/state-machines/dao-reputation.d.ts +610 -0
  89. package/dist/types/apps/governance/state-machines/dao-single.d.ts +276 -0
  90. package/dist/types/apps/governance/state-machines/dao-token.d.ts +601 -0
  91. package/dist/types/apps/governance/state-machines/governance-simple.d.ts +652 -0
  92. package/dist/types/apps/governance/state-machines/governance-universal.d.ts +181 -0
  93. package/dist/types/apps/governance/state-machines/index.d.ts +9 -2136
  94. package/dist/types/apps/identity/constants.d.ts +4 -7
  95. package/dist/types/apps/identity/index.d.ts +1082 -592
  96. package/dist/types/apps/identity/state-machines/identity-agent.d.ts +401 -0
  97. package/dist/types/apps/identity/state-machines/identity-oracle.d.ts +550 -0
  98. package/dist/types/apps/identity/state-machines/identity-universal.d.ts +151 -0
  99. package/dist/types/apps/identity/state-machines/index.d.ts +1069 -567
  100. package/dist/types/apps/index.d.ts +5 -5
  101. package/dist/types/apps/markets/index.d.ts +535 -7
  102. package/dist/types/apps/markets/state-machines/index.d.ts +8 -1678
  103. package/dist/types/apps/markets/state-machines/market-auction.d.ts +392 -0
  104. package/dist/types/apps/markets/state-machines/market-crowdfund.d.ts +443 -0
  105. package/dist/types/apps/markets/state-machines/market-group-buy.d.ts +539 -0
  106. package/dist/types/apps/markets/state-machines/market-prediction.d.ts +651 -0
  107. package/dist/types/apps/markets/state-machines/market-universal.d.ts +191 -0
  108. package/dist/types/apps/oracles/index.d.ts +18 -0
  109. package/dist/types/generated/index.d.ts +3 -1
  110. package/dist/types/generated/ottochain/apps/identity/v1/identity.d.ts +43 -64
  111. package/dist/types/schema/fiber-app.d.ts +139 -0
  112. package/dist/types/schema/index.d.ts +4 -0
  113. package/package.json +1 -1
@@ -1,28 +1,27 @@
1
1
  /**
2
- * Identity Application
2
+ * Agent Identity Application
3
3
  *
4
- * Types and utilities for the Identity system on OttoChain.
5
- * Includes agents, oracles, and services.
4
+ * Types and utilities for the Agent Identity system on OttoChain.
6
5
  *
7
6
  * @example
8
7
  * ```typescript
9
8
  * import {
10
- * IdentityState,
11
- * IdentityType,
9
+ * AgentState,
10
+ * AgentIdentity,
12
11
  * getIdentityDefinition
13
12
  * } from '@ottochain/sdk/apps/identity';
14
13
  *
15
- * const oracleDef = getIdentityDefinition('oracle');
14
+ * const identityDef = getIdentityDefinition();
16
15
  * ```
17
16
  *
18
17
  * @packageDocumentation
19
18
  */
20
- export { IdentityType, IdentityState, Platform, PlatformLink, Reputation, PenaltyEvent, Identity, RegisterIdentityRequest, ActivateIdentityRequest, UpdateStakeRequest, ChallengeIdentityRequest, PenalizeIdentityRequest, WithdrawIdentityRequest, IdentityDefinition, identityTypeFromJSON, identityTypeToJSON, identityStateFromJSON, identityStateToJSON, platformFromJSON, platformToJSON, } 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, // Legacy alias
23
- ATTESTATION_DELTAS, IDENTITY_TYPE_NAMES, 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";
24
23
  /**
25
- * Default reputation configuration for identities
24
+ * Default reputation configuration for agent identity
26
25
  */
27
26
  export declare const DEFAULT_REPUTATION_CONFIG: {
28
27
  readonly baseReputation: 10;
@@ -33,610 +32,1101 @@ export declare const DEFAULT_REPUTATION_CONFIG: {
33
32
  readonly minReputation: 0;
34
33
  readonly challengeThreshold: 5;
35
34
  };
36
- /**
37
- * Default oracle configuration
38
- */
39
- export declare const DEFAULT_ORACLE_CONFIG: {
40
- readonly minStake: 100;
41
- readonly slashCooldownEpochs: 7;
42
- readonly accuracyThreshold: 70;
43
- readonly maxDisputeRate: 30;
44
- };
45
- import { identityUniversalDef, identityAgentDef, identityOracleDef } from './state-machines/index.js';
35
+ import { identityUniversalDef, identityAgentDef, identityOracleDef } from "./state-machines/index.js";
46
36
  export { identityUniversalDef, identityAgentDef, identityOracleDef };
47
37
  /** All identity state machine definitions */
48
38
  export declare const IDENTITY_DEFINITIONS: {
49
39
  readonly universal: {
50
- readonly metadata: {
51
- readonly name: "IdentityUniversal";
52
- readonly description: "Minimal identity state machine - extend for custom use cases";
53
- readonly version: "1.0.0";
40
+ metadata: {
41
+ name: string;
42
+ app: string;
43
+ type: string;
44
+ version: string;
45
+ description: string;
46
+ };
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
+ };
60
+ };
54
61
  };
55
- readonly states: {
56
- readonly CREATED: {
57
- readonly id: "CREATED";
58
- readonly isFinal: false;
59
- readonly metadata: null;
60
- };
61
- readonly ACTIVE: {
62
- readonly id: "ACTIVE";
63
- readonly isFinal: false;
64
- readonly metadata: null;
65
- };
66
- readonly INACTIVE: {
67
- readonly id: "INACTIVE";
68
- readonly isFinal: true;
69
- readonly metadata: null;
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;
70
104
  };
71
105
  };
72
- readonly initialState: "CREATED";
73
- readonly transitions: readonly [{
74
- readonly from: "CREATED";
75
- readonly to: "ACTIVE";
76
- readonly eventName: "activate";
77
- readonly guard: {
78
- readonly "==": readonly [1, 1];
79
- };
80
- readonly effect: {
81
- readonly merge: readonly [{
82
- readonly var: "state";
83
- }, {
84
- readonly status: "ACTIVE";
85
- readonly activatedAt: {
86
- readonly var: "$timestamp";
87
- };
88
- }];
89
- };
90
- readonly dependencies: readonly [];
91
- }, {
92
- readonly from: "ACTIVE";
93
- readonly to: "ACTIVE";
94
- readonly eventName: "update";
95
- readonly guard: {
96
- readonly "==": readonly [1, 1];
97
- };
98
- readonly effect: {
99
- readonly merge: readonly [{
100
- readonly var: "state";
101
- }, {
102
- readonly updatedAt: {
103
- readonly var: "$timestamp";
104
- };
105
- readonly metadata: {
106
- readonly var: "event.metadata";
107
- };
108
- }];
109
- };
110
- readonly dependencies: readonly [];
111
- }, {
112
- readonly from: "ACTIVE";
113
- readonly to: "INACTIVE";
114
- readonly eventName: "deactivate";
115
- readonly guard: {
116
- readonly "==": readonly [1, 1];
117
- };
118
- readonly effect: {
119
- readonly merge: readonly [{
120
- readonly var: "state";
121
- }, {
122
- readonly status: "INACTIVE";
123
- readonly deactivatedAt: {
124
- readonly var: "$timestamp";
125
- };
126
- }];
127
- };
128
- readonly dependencies: readonly [];
129
- }];
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
+ })[];
130
189
  };
131
190
  readonly agent: {
132
- readonly metadata: {
133
- readonly name: "IdentityAgent";
134
- readonly description: "Standard agent identity with reputation tracking, vouching, and lifecycle management";
135
- readonly version: "1.0.0";
191
+ metadata: {
192
+ name: string;
193
+ app: string;
194
+ type: string;
195
+ version: string;
196
+ description: string;
197
+ };
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
+ };
227
+ };
228
+ };
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
+ };
136
335
  };
137
- readonly states: {
138
- readonly REGISTERED: {
139
- readonly id: "REGISTERED";
140
- readonly isFinal: false;
141
- readonly metadata: null;
142
- };
143
- readonly ACTIVE: {
144
- readonly id: "ACTIVE";
145
- readonly isFinal: false;
146
- readonly metadata: null;
147
- };
148
- readonly CHALLENGED: {
149
- readonly id: "CHALLENGED";
150
- readonly isFinal: false;
151
- readonly metadata: null;
152
- };
153
- readonly SUSPENDED: {
154
- readonly id: "SUSPENDED";
155
- readonly isFinal: false;
156
- readonly metadata: null;
157
- };
158
- readonly PROBATION: {
159
- readonly id: "PROBATION";
160
- readonly isFinal: false;
161
- readonly metadata: null;
162
- };
163
- readonly WITHDRAWN: {
164
- readonly id: "WITHDRAWN";
165
- readonly isFinal: true;
166
- readonly metadata: null;
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
+ };
167
353
  };
168
354
  };
169
- readonly initialState: "REGISTERED";
170
- readonly transitions: readonly [{
171
- readonly from: "REGISTERED";
172
- readonly to: "ACTIVE";
173
- readonly eventName: "activate";
174
- readonly guard: {
175
- readonly "==": readonly [1, 1];
176
- };
177
- readonly effect: {
178
- readonly merge: readonly [{
179
- readonly var: "state";
180
- }, {
181
- readonly status: "ACTIVE";
182
- readonly activatedAt: {
183
- readonly var: "$timestamp";
184
- };
185
- }];
186
- };
187
- readonly dependencies: readonly [];
188
- }, {
189
- readonly from: "ACTIVE";
190
- readonly to: "ACTIVE";
191
- readonly eventName: "receive_vouch";
192
- readonly guard: {
193
- readonly "!!": readonly [{
194
- readonly var: "event.from";
195
- }];
196
- };
197
- readonly effect: {
198
- readonly merge: readonly [{
199
- readonly var: "state";
200
- }, {
201
- readonly reputation: {
202
- readonly "+": readonly [{
203
- readonly var: "state.reputation";
204
- }, 2];
205
- };
206
- }];
207
- };
208
- readonly dependencies: readonly [];
209
- }, {
210
- readonly from: "ACTIVE";
211
- readonly to: "ACTIVE";
212
- readonly eventName: "receive_completion";
213
- readonly guard: {
214
- readonly "==": readonly [1, 1];
215
- };
216
- readonly effect: {
217
- readonly merge: readonly [{
218
- readonly var: "state";
219
- }, {
220
- readonly reputation: {
221
- readonly "+": readonly [{
222
- readonly var: "state.reputation";
223
- }, 5];
224
- };
225
- }];
226
- };
227
- readonly dependencies: readonly [];
228
- }, {
229
- readonly from: "ACTIVE";
230
- readonly to: "CHALLENGED";
231
- readonly eventName: "challenge";
232
- readonly guard: {
233
- readonly "!!": readonly [{
234
- readonly var: "event.challenger";
235
- }];
236
- };
237
- readonly effect: {
238
- readonly merge: readonly [{
239
- readonly var: "state";
240
- }, {
241
- readonly status: "CHALLENGED";
242
- readonly challengedBy: {
243
- readonly var: "event.challenger";
244
- };
245
- }];
246
- };
247
- readonly dependencies: readonly [];
248
- }, {
249
- readonly from: "CHALLENGED";
250
- readonly to: "ACTIVE";
251
- readonly eventName: "dismiss_challenge";
252
- readonly guard: {
253
- readonly "==": readonly [1, 1];
254
- };
255
- readonly effect: {
256
- readonly merge: readonly [{
257
- readonly var: "state";
258
- }, {
259
- readonly status: "ACTIVE";
260
- readonly challengedBy: null;
261
- }];
262
- };
263
- readonly dependencies: readonly [];
264
- }, {
265
- readonly from: "CHALLENGED";
266
- readonly to: "SUSPENDED";
267
- readonly eventName: "uphold_challenge";
268
- readonly guard: {
269
- readonly "==": readonly [1, 1];
270
- };
271
- readonly effect: {
272
- readonly merge: readonly [{
273
- readonly var: "state";
274
- }, {
275
- readonly status: "SUSPENDED";
276
- readonly suspendedAt: {
277
- readonly var: "$timestamp";
278
- };
279
- }];
280
- };
281
- readonly dependencies: readonly [];
282
- }, {
283
- readonly from: "SUSPENDED";
284
- readonly to: "PROBATION";
285
- readonly eventName: "begin_probation";
286
- readonly guard: {
287
- readonly "==": readonly [1, 1];
288
- };
289
- readonly effect: {
290
- readonly merge: readonly [{
291
- readonly var: "state";
292
- }, {
293
- readonly status: "PROBATION";
294
- readonly probationStartedAt: {
295
- readonly var: "$timestamp";
296
- };
297
- }];
298
- };
299
- readonly dependencies: readonly [];
300
- }, {
301
- readonly from: "PROBATION";
302
- readonly to: "ACTIVE";
303
- readonly eventName: "complete_probation";
304
- readonly guard: {
305
- readonly "==": readonly [1, 1];
306
- };
307
- readonly effect: {
308
- readonly merge: readonly [{
309
- readonly var: "state";
310
- }, {
311
- readonly status: "ACTIVE";
312
- readonly probationStartedAt: null;
313
- }];
314
- };
315
- readonly dependencies: readonly [];
316
- }, {
317
- readonly from: "ACTIVE";
318
- readonly to: "WITHDRAWN";
319
- readonly eventName: "withdraw";
320
- readonly guard: {
321
- readonly "==": readonly [1, 1];
322
- };
323
- readonly effect: {
324
- readonly merge: readonly [{
325
- readonly var: "state";
326
- }, {
327
- readonly status: "WITHDRAWN";
328
- }];
329
- };
330
- readonly dependencies: readonly [];
331
- }];
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
+ })[];
332
585
  };
333
586
  readonly oracle: {
334
- readonly metadata: {
335
- readonly name: "IdentityOracle";
336
- readonly description: "Oracle identity with staking, attestations, reputation, and slashing mechanics";
337
- 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
+ };
338
620
  };
339
- readonly states: {
340
- readonly UNREGISTERED: {
341
- readonly id: "UNREGISTERED";
342
- readonly isFinal: false;
343
- readonly metadata: null;
344
- };
345
- readonly REGISTERED: {
346
- readonly id: "REGISTERED";
347
- readonly isFinal: false;
348
- readonly metadata: null;
349
- };
350
- readonly ACTIVE: {
351
- readonly id: "ACTIVE";
352
- readonly isFinal: false;
353
- readonly metadata: null;
354
- };
355
- readonly SLASHED: {
356
- readonly id: "SLASHED";
357
- readonly isFinal: false;
358
- readonly metadata: null;
359
- };
360
- readonly WITHDRAWN: {
361
- readonly id: "WITHDRAWN";
362
- readonly isFinal: true;
363
- readonly metadata: null;
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
+ };
781
+ };
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;
364
802
  };
365
803
  };
366
- readonly initialState: "UNREGISTERED";
367
- readonly transitions: readonly [{
368
- readonly from: "UNREGISTERED";
369
- readonly to: "REGISTERED";
370
- readonly eventName: "register";
371
- readonly guard: {
372
- readonly ">=": readonly [{
373
- readonly var: "event.stake";
374
- }, {
375
- readonly var: "state.minStake";
376
- }];
377
- };
378
- readonly effect: {
379
- readonly merge: readonly [{
380
- readonly var: "state";
381
- }, {
382
- readonly status: "REGISTERED";
383
- readonly address: {
384
- readonly var: "event.agent";
385
- };
386
- readonly stake: {
387
- readonly var: "event.stake";
388
- };
389
- readonly registeredAt: {
390
- readonly var: "$timestamp";
391
- };
392
- readonly reputation: {
393
- readonly accuracy: 100;
394
- readonly totalResolutions: 0;
395
- readonly disputesWon: 0;
396
- readonly disputesLost: 0;
397
- };
398
- readonly domains: {
399
- readonly var: "event.domains";
400
- };
401
- readonly slashingHistory: readonly [];
402
- }];
403
- };
404
- readonly dependencies: readonly [];
405
- }, {
406
- readonly from: "REGISTERED";
407
- readonly to: "ACTIVE";
408
- readonly eventName: "activate";
409
- readonly guard: {
410
- readonly or: readonly [{
411
- readonly "===": readonly [{
412
- readonly var: "event.agent";
413
- }, {
414
- readonly var: "state.address";
415
- }];
416
- }, {
417
- readonly var: "event.adminOverride";
418
- }];
419
- };
420
- readonly effect: {
421
- readonly merge: readonly [{
422
- readonly var: "state";
423
- }, {
424
- readonly status: "ACTIVE";
425
- readonly activatedAt: {
426
- readonly var: "$timestamp";
427
- };
428
- }];
429
- };
430
- readonly dependencies: readonly [];
431
- }, {
432
- readonly from: "ACTIVE";
433
- readonly to: "ACTIVE";
434
- readonly eventName: "add_stake";
435
- readonly guard: {
436
- readonly and: readonly [{
437
- readonly "===": readonly [{
438
- readonly var: "event.agent";
439
- }, {
440
- readonly var: "state.address";
441
- }];
442
- }, {
443
- readonly ">": readonly [{
444
- readonly var: "event.amount";
445
- }, 0];
446
- }];
447
- };
448
- readonly effect: {
449
- readonly merge: readonly [{
450
- readonly var: "state";
451
- }, {
452
- readonly stake: {
453
- readonly "+": readonly [{
454
- readonly var: "state.stake";
455
- }, {
456
- readonly var: "event.amount";
457
- }];
458
- };
459
- readonly lastStakeAt: {
460
- readonly var: "$timestamp";
461
- };
462
- }];
463
- };
464
- readonly dependencies: readonly [];
465
- }, {
466
- readonly from: "ACTIVE";
467
- readonly to: "ACTIVE";
468
- readonly eventName: "record_resolution";
469
- readonly guard: {
470
- readonly var: "event.marketId";
471
- };
472
- readonly effect: {
473
- readonly merge: readonly [{
474
- readonly var: "state";
475
- }, {
476
- readonly reputation: {
477
- readonly merge: readonly [{
478
- readonly var: "state.reputation";
479
- }, {
480
- readonly totalResolutions: {
481
- readonly "+": readonly [{
482
- readonly var: "state.reputation.totalResolutions";
483
- }, 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
+ })[];
484
949
  };
485
- readonly accuracy: {
486
- readonly if: readonly [{
487
- readonly var: "event.correct";
488
- }, {
489
- readonly var: "state.reputation.accuracy";
490
- }, {
491
- readonly "-": readonly [{
492
- readonly var: "state.reputation.accuracy";
493
- }, 5];
494
- }];
950
+ accuracy: {
951
+ if: ({
952
+ var: string;
953
+ "-"?: undefined;
954
+ } | {
955
+ "-": (number | {
956
+ var: string;
957
+ })[];
958
+ var?: undefined;
959
+ })[];
495
960
  };
496
- }];
497
- };
498
- readonly lastResolutionAt: {
499
- readonly var: "$timestamp";
500
- };
501
- }];
502
- };
503
- readonly dependencies: readonly [];
504
- }, {
505
- readonly from: "ACTIVE";
506
- readonly to: "SLASHED";
507
- readonly eventName: "slash";
508
- readonly guard: {
509
- readonly and: readonly [{
510
- readonly var: "event.reason";
511
- }, {
512
- readonly ">": readonly [{
513
- readonly var: "event.amount";
514
- }, 0];
515
- }, {
516
- readonly "<=": readonly [{
517
- readonly var: "event.amount";
518
- }, {
519
- readonly var: "state.stake";
520
- }];
521
- }];
522
- };
523
- readonly effect: {
524
- readonly merge: readonly [{
525
- readonly var: "state";
526
- }, {
527
- readonly status: "SLASHED";
528
- readonly stake: {
529
- readonly "-": readonly [{
530
- readonly var: "state.stake";
531
- }, {
532
- readonly var: "event.amount";
533
- }];
534
- };
535
- readonly slashingHistory: {
536
- readonly cat: readonly [{
537
- readonly var: "state.slashingHistory";
538
- }, readonly [{
539
- readonly reason: {
540
- 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;
541
1017
  };
542
- readonly amount: {
543
- readonly var: "event.amount";
1018
+ amount: {
1019
+ var: string;
544
1020
  };
545
- readonly marketId: {
546
- readonly var: "event.marketId";
1021
+ marketId: {
1022
+ var: string;
547
1023
  };
548
- readonly slashedAt: {
549
- readonly var: "$timestamp";
1024
+ slashedAt: {
1025
+ var: string;
550
1026
  };
551
- }]];
552
- };
553
- readonly slashedAt: {
554
- readonly var: "$timestamp";
555
- };
556
- }];
557
- };
558
- readonly dependencies: readonly [];
559
- }, {
560
- readonly from: "SLASHED";
561
- readonly to: "ACTIVE";
562
- readonly eventName: "reactivate";
563
- readonly guard: {
564
- readonly and: readonly [{
565
- readonly "===": readonly [{
566
- readonly var: "event.agent";
567
- }, {
568
- readonly var: "state.address";
569
- }];
570
- }, {
571
- readonly ">=": readonly [{
572
- readonly var: "state.stake";
573
- }, {
574
- readonly var: "state.minStake";
575
- }];
576
- }];
577
- };
578
- readonly effect: {
579
- readonly merge: readonly [{
580
- readonly var: "state";
581
- }, {
582
- readonly status: "ACTIVE";
583
- readonly reactivatedAt: {
584
- readonly var: "$timestamp";
585
- };
586
- }];
587
- };
588
- readonly dependencies: readonly [];
589
- }, {
590
- readonly from: "ACTIVE";
591
- readonly to: "WITHDRAWN";
592
- readonly eventName: "withdraw";
593
- readonly guard: {
594
- readonly "===": readonly [{
595
- readonly var: "event.agent";
596
- }, {
597
- readonly var: "state.address";
598
- }];
599
- };
600
- readonly effect: {
601
- readonly merge: readonly [{
602
- readonly var: "state";
603
- }, {
604
- readonly status: "WITHDRAWN";
605
- readonly withdrawnAt: {
606
- readonly var: "$timestamp";
607
- };
608
- readonly finalStake: {
609
- readonly var: "state.stake";
610
- };
611
- }];
612
- };
613
- readonly dependencies: readonly [];
614
- }, {
615
- readonly from: "SLASHED";
616
- readonly to: "WITHDRAWN";
617
- readonly eventName: "withdraw";
618
- readonly guard: {
619
- readonly "===": readonly [{
620
- readonly var: "event.agent";
621
- }, {
622
- readonly var: "state.address";
623
- }];
624
- };
625
- readonly effect: {
626
- readonly merge: readonly [{
627
- readonly var: "state";
628
- }, {
629
- readonly status: "WITHDRAWN";
630
- readonly withdrawnAt: {
631
- readonly var: "$timestamp";
632
- };
633
- readonly finalStake: {
634
- readonly var: "state.stake";
635
- };
636
- }];
637
- };
638
- readonly dependencies: readonly [];
639
- }];
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
+ })[];
640
1130
  };
641
1131
  };
642
1132
  export type IdentityDefType = keyof typeof IDENTITY_DEFINITIONS;