@ottochain/sdk 1.6.0 → 1.7.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/cjs/apps/contracts/index.js +18 -13
  2. package/dist/cjs/apps/contracts/state-machines/index.js +139 -7
  3. package/dist/cjs/apps/corporate/index.js +18 -20
  4. package/dist/cjs/apps/corporate/state-machines/index.js +535 -6336
  5. package/dist/cjs/apps/governance/index.js +32 -31
  6. package/dist/cjs/apps/governance/state-machines/index.js +498 -2315
  7. package/dist/cjs/apps/identity/constants.js +28 -14
  8. package/dist/cjs/apps/identity/index.js +54 -23
  9. package/dist/cjs/apps/identity/state-machines/index.js +516 -4
  10. package/dist/cjs/apps/index.js +15 -13
  11. package/dist/cjs/apps/markets/index.js +23 -10
  12. package/dist/cjs/apps/markets/state-machines/index.js +1904 -230
  13. package/dist/cjs/generated/google/protobuf/struct.js +1 -1
  14. package/dist/cjs/generated/google/protobuf/timestamp.js +1 -1
  15. package/dist/cjs/generated/index.js +19 -22
  16. package/dist/cjs/generated/ottochain/apps/contracts/v1/contract.js +1 -1
  17. package/dist/cjs/generated/ottochain/apps/corporate/v1/corporate.js +1 -1
  18. package/dist/cjs/generated/ottochain/apps/governance/v1/governance.js +1 -1
  19. package/dist/cjs/generated/ottochain/apps/identity/v1/attestation.js +12 -12
  20. package/dist/cjs/generated/ottochain/apps/identity/v1/identity.js +1689 -0
  21. package/dist/cjs/generated/ottochain/apps/markets/v1/market.js +1 -1
  22. package/dist/cjs/generated/ottochain/v1/common.js +1 -1
  23. package/dist/cjs/generated/ottochain/v1/fiber.js +1 -1
  24. package/dist/cjs/generated/ottochain/v1/messages.js +1 -1
  25. package/dist/cjs/generated/ottochain/v1/records.js +1 -1
  26. package/dist/esm/apps/contracts/index.js +16 -13
  27. package/dist/esm/apps/contracts/state-machines/index.js +138 -6
  28. package/dist/esm/apps/corporate/index.js +14 -20
  29. package/dist/esm/apps/corporate/state-machines/index.js +534 -6335
  30. package/dist/esm/apps/governance/index.js +26 -30
  31. package/dist/esm/apps/governance/state-machines/index.js +497 -2314
  32. package/dist/esm/apps/identity/constants.js +27 -13
  33. package/dist/esm/apps/identity/index.js +32 -15
  34. package/dist/esm/apps/identity/state-machines/index.js +515 -3
  35. package/dist/esm/apps/index.js +14 -12
  36. package/dist/esm/apps/markets/index.js +19 -10
  37. package/dist/esm/apps/markets/state-machines/index.js +1903 -229
  38. package/dist/esm/generated/google/protobuf/struct.js +1 -1
  39. package/dist/esm/generated/google/protobuf/timestamp.js +1 -1
  40. package/dist/esm/generated/index.js +2 -3
  41. package/dist/esm/generated/ottochain/apps/contracts/v1/contract.js +1 -1
  42. package/dist/esm/generated/ottochain/apps/corporate/v1/corporate.js +1 -1
  43. package/dist/esm/generated/ottochain/apps/governance/v1/governance.js +1 -1
  44. package/dist/esm/generated/ottochain/apps/identity/v1/attestation.js +2 -2
  45. package/dist/esm/generated/ottochain/apps/identity/v1/identity.js +1677 -0
  46. package/dist/esm/generated/ottochain/apps/markets/v1/market.js +1 -1
  47. package/dist/esm/generated/ottochain/v1/common.js +1 -1
  48. package/dist/esm/generated/ottochain/v1/fiber.js +1 -1
  49. package/dist/esm/generated/ottochain/v1/messages.js +1 -1
  50. package/dist/esm/generated/ottochain/v1/records.js +1 -1
  51. package/dist/types/apps/contracts/index.d.ts +661 -9
  52. package/dist/types/apps/contracts/state-machines/index.d.ts +109 -6
  53. package/dist/types/apps/corporate/index.d.ts +4015 -7
  54. package/dist/types/apps/corporate/state-machines/index.d.ts +472 -5587
  55. package/dist/types/apps/governance/index.d.ts +2151 -12
  56. package/dist/types/apps/governance/state-machines/index.d.ts +462 -1875
  57. package/dist/types/apps/identity/constants.d.ts +10 -5
  58. package/dist/types/apps/identity/index.d.ts +620 -12
  59. package/dist/types/apps/identity/state-machines/index.d.ts +393 -3
  60. package/dist/types/apps/index.d.ts +14 -12
  61. package/dist/types/apps/markets/index.d.ts +1690 -7
  62. package/dist/types/apps/markets/state-machines/index.d.ts +1416 -184
  63. package/dist/types/generated/index.d.ts +1 -2
  64. package/dist/types/generated/ottochain/apps/identity/v1/attestation.d.ts +1 -1
  65. package/dist/types/generated/ottochain/apps/identity/v1/identity.d.ts +208 -0
  66. package/package.json +1 -1
  67. package/dist/cjs/apps/oracles/index.js +0 -59
  68. package/dist/cjs/apps/oracles/state-machines/index.js +0 -415
  69. package/dist/cjs/generated/ottochain/apps/identity/v1/agent.js +0 -619
  70. package/dist/cjs/generated/ottochain/apps/oracles/v1/oracle.js +0 -1223
  71. package/dist/esm/apps/oracles/index.js +0 -42
  72. package/dist/esm/apps/oracles/state-machines/index.js +0 -412
  73. package/dist/esm/generated/ottochain/apps/identity/v1/agent.js +0 -610
  74. package/dist/esm/generated/ottochain/apps/oracles/v1/oracle.js +0 -1217
  75. package/dist/types/apps/oracles/index.d.ts +0 -34
  76. package/dist/types/apps/oracles/state-machines/index.d.ts +0 -312
  77. package/dist/types/generated/ottochain/apps/identity/v1/agent.d.ts +0 -94
  78. package/dist/types/generated/ottochain/apps/oracles/v1/oracle.d.ts +0 -150
@@ -1,17 +1,18 @@
1
1
  /**
2
2
  * Identity Constants
3
3
  *
4
- * State machine transitions and configuration constants for agent identity.
4
+ * State machine transitions and configuration constants for identities.
5
5
  *
6
6
  * @packageDocumentation
7
7
  */
8
- import { AgentState } from '../../generated/ottochain/apps/identity/v1/agent.js';
8
+ import { IdentityState, IdentityType } from '../../generated/ottochain/apps/identity/v1/identity.js';
9
9
  import { AttestationType } from '../../generated/ottochain/apps/identity/v1/attestation.js';
10
10
  /**
11
- * Valid transitions for each agent state.
11
+ * Valid transitions for each identity state.
12
12
  * Maps current state to allowed event names.
13
13
  */
14
- export declare const AGENT_TRANSITIONS: Record<AgentState, readonly string[]>;
14
+ export declare const IDENTITY_TRANSITIONS: Record<IdentityState, readonly string[]>;
15
+ export declare const AGENT_TRANSITIONS: Record<IdentityState, readonly string[]>;
15
16
  /**
16
17
  * Reputation delta by attestation type.
17
18
  * These values match the metagraph state machine defaults.
@@ -20,8 +21,12 @@ export declare const ATTESTATION_DELTAS: Record<AttestationType, number>;
20
21
  /**
21
22
  * Check if a transition is valid for the given state.
22
23
  */
23
- export declare function canTransition(state: AgentState, event: string): boolean;
24
+ export declare function canTransition(state: IdentityState, event: string): boolean;
24
25
  /**
25
26
  * Get reputation delta for an attestation type.
26
27
  */
27
28
  export declare function getReputationDelta(type: AttestationType): number;
29
+ /**
30
+ * Identity type display names
31
+ */
32
+ export declare const IDENTITY_TYPE_NAMES: Record<IdentityType, string>;
@@ -1,26 +1,28 @@
1
1
  /**
2
- * Agent Identity Application
2
+ * Identity Application
3
3
  *
4
- * Types and utilities for the Agent Identity system on OttoChain.
4
+ * Types and utilities for the Identity system on OttoChain.
5
+ * Includes agents, oracles, and services.
5
6
  *
6
7
  * @example
7
8
  * ```typescript
8
9
  * import {
9
- * AgentState,
10
- * AgentIdentity,
10
+ * IdentityState,
11
+ * IdentityType,
11
12
  * getIdentityDefinition
12
13
  * } from '@ottochain/sdk/apps/identity';
13
14
  *
14
- * const identityDef = getIdentityDefinition();
15
+ * const oracleDef = getIdentityDefinition('oracle');
15
16
  * ```
16
17
  *
17
18
  * @packageDocumentation
18
19
  */
19
- export { AgentState, Platform, PlatformLink, AgentIdentity, AgentIdentityDefinition, agentStateFromJSON, agentStateToJSON, platformFromJSON, platformToJSON, } from '../../generated/ottochain/apps/identity/v1/agent.js';
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';
20
21
  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';
22
+ export { IDENTITY_TRANSITIONS, AGENT_TRANSITIONS, // Legacy alias
23
+ ATTESTATION_DELTAS, IDENTITY_TYPE_NAMES, canTransition, getReputationDelta, } from './constants.js';
22
24
  /**
23
- * Default reputation configuration for agent identity
25
+ * Default reputation configuration for identities
24
26
  */
25
27
  export declare const DEFAULT_REPUTATION_CONFIG: {
26
28
  readonly baseReputation: 10;
@@ -32,8 +34,614 @@ export declare const DEFAULT_REPUTATION_CONFIG: {
32
34
  readonly challengeThreshold: 5;
33
35
  };
34
36
  /**
35
- * Get the agent identity state machine definition.
36
- *
37
- * @returns The state machine definition JSON for AgentIdentity
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';
46
+ export { identityUniversalDef, identityAgentDef, identityOracleDef };
47
+ /** All identity state machine definitions */
48
+ export declare const IDENTITY_DEFINITIONS: {
49
+ 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";
54
+ };
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;
70
+ };
71
+ };
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
+ }];
130
+ };
131
+ 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";
136
+ };
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;
167
+ };
168
+ };
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
+ }];
332
+ };
333
+ 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";
338
+ };
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;
364
+ };
365
+ };
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];
484
+ };
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
+ }];
495
+ };
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";
541
+ };
542
+ readonly amount: {
543
+ readonly var: "event.amount";
544
+ };
545
+ readonly marketId: {
546
+ readonly var: "event.marketId";
547
+ };
548
+ readonly slashedAt: {
549
+ readonly var: "$timestamp";
550
+ };
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
+ }];
640
+ };
641
+ };
642
+ export type IdentityDefType = keyof typeof IDENTITY_DEFINITIONS;
643
+ /**
644
+ * Get an identity state machine definition by type.
645
+ * @param type - 'universal' | 'agent' | 'oracle' (default: 'agent')
38
646
  */
39
- export declare function getIdentityDefinition(): unknown;
647
+ export declare function getIdentityDefinition(type?: IdentityDefType): unknown;