@ottochain/sdk 1.6.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/apps/contracts/index.js +18 -13
- package/dist/cjs/apps/contracts/state-machines/index.js +139 -7
- package/dist/cjs/apps/corporate/index.js +18 -20
- package/dist/cjs/apps/corporate/state-machines/index.js +535 -6336
- package/dist/cjs/apps/governance/index.js +32 -31
- package/dist/cjs/apps/governance/state-machines/index.js +498 -2315
- package/dist/cjs/apps/identity/index.js +15 -7
- package/dist/cjs/apps/identity/state-machines/index.js +516 -4
- package/dist/cjs/apps/index.js +15 -13
- package/dist/cjs/apps/markets/index.js +23 -10
- package/dist/cjs/apps/markets/state-machines/index.js +1904 -230
- package/dist/esm/apps/contracts/index.js +16 -13
- package/dist/esm/apps/contracts/state-machines/index.js +138 -6
- package/dist/esm/apps/corporate/index.js +14 -20
- package/dist/esm/apps/corporate/state-machines/index.js +534 -6335
- package/dist/esm/apps/governance/index.js +26 -30
- package/dist/esm/apps/governance/state-machines/index.js +497 -2314
- package/dist/esm/apps/identity/index.js +13 -7
- package/dist/esm/apps/identity/state-machines/index.js +515 -3
- package/dist/esm/apps/index.js +14 -12
- package/dist/esm/apps/markets/index.js +19 -10
- package/dist/esm/apps/markets/state-machines/index.js +1903 -229
- package/dist/types/apps/contracts/index.d.ts +661 -9
- package/dist/types/apps/contracts/state-machines/index.d.ts +109 -6
- package/dist/types/apps/corporate/index.d.ts +4015 -7
- package/dist/types/apps/corporate/state-machines/index.d.ts +472 -5587
- package/dist/types/apps/governance/index.d.ts +2151 -12
- package/dist/types/apps/governance/state-machines/index.d.ts +462 -1875
- package/dist/types/apps/identity/index.d.ts +601 -4
- package/dist/types/apps/identity/state-machines/index.d.ts +393 -3
- package/dist/types/apps/index.d.ts +14 -12
- package/dist/types/apps/markets/index.d.ts +1690 -7
- package/dist/types/apps/markets/state-machines/index.d.ts +1416 -184
- package/package.json +1 -1
- package/dist/cjs/apps/oracles/index.js +0 -59
- package/dist/cjs/apps/oracles/state-machines/index.js +0 -415
- package/dist/esm/apps/oracles/index.js +0 -42
- package/dist/esm/apps/oracles/state-machines/index.js +0 -412
- package/dist/types/apps/oracles/index.d.ts +0 -34
- package/dist/types/apps/oracles/state-machines/index.d.ts +0 -312
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
* Auto-generated from JSON state machine definitions.
|
|
3
3
|
* DO NOT EDIT - regenerate with: npm run prebuild
|
|
4
4
|
*/
|
|
5
|
-
export declare const
|
|
5
|
+
export declare const identityAgentDef: {
|
|
6
6
|
readonly metadata: {
|
|
7
|
-
readonly name: "
|
|
8
|
-
readonly description: "
|
|
7
|
+
readonly name: "IdentityAgent";
|
|
8
|
+
readonly description: "Standard agent identity with reputation tracking, vouching, and lifecycle management";
|
|
9
9
|
readonly version: "1.0.0";
|
|
10
10
|
};
|
|
11
11
|
readonly states: {
|
|
@@ -204,3 +204,393 @@ export declare const agentIdentityDef: {
|
|
|
204
204
|
readonly dependencies: readonly [];
|
|
205
205
|
}];
|
|
206
206
|
};
|
|
207
|
+
export declare const identityOracleDef: {
|
|
208
|
+
readonly metadata: {
|
|
209
|
+
readonly name: "IdentityOracle";
|
|
210
|
+
readonly description: "Oracle identity with staking, attestations, reputation, and slashing mechanics";
|
|
211
|
+
readonly version: "1.0.0";
|
|
212
|
+
};
|
|
213
|
+
readonly states: {
|
|
214
|
+
readonly UNREGISTERED: {
|
|
215
|
+
readonly id: "UNREGISTERED";
|
|
216
|
+
readonly isFinal: false;
|
|
217
|
+
readonly metadata: null;
|
|
218
|
+
};
|
|
219
|
+
readonly REGISTERED: {
|
|
220
|
+
readonly id: "REGISTERED";
|
|
221
|
+
readonly isFinal: false;
|
|
222
|
+
readonly metadata: null;
|
|
223
|
+
};
|
|
224
|
+
readonly ACTIVE: {
|
|
225
|
+
readonly id: "ACTIVE";
|
|
226
|
+
readonly isFinal: false;
|
|
227
|
+
readonly metadata: null;
|
|
228
|
+
};
|
|
229
|
+
readonly SLASHED: {
|
|
230
|
+
readonly id: "SLASHED";
|
|
231
|
+
readonly isFinal: false;
|
|
232
|
+
readonly metadata: null;
|
|
233
|
+
};
|
|
234
|
+
readonly WITHDRAWN: {
|
|
235
|
+
readonly id: "WITHDRAWN";
|
|
236
|
+
readonly isFinal: true;
|
|
237
|
+
readonly metadata: null;
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
readonly initialState: "UNREGISTERED";
|
|
241
|
+
readonly transitions: readonly [{
|
|
242
|
+
readonly from: "UNREGISTERED";
|
|
243
|
+
readonly to: "REGISTERED";
|
|
244
|
+
readonly eventName: "register";
|
|
245
|
+
readonly guard: {
|
|
246
|
+
readonly ">=": readonly [{
|
|
247
|
+
readonly var: "event.stake";
|
|
248
|
+
}, {
|
|
249
|
+
readonly var: "state.minStake";
|
|
250
|
+
}];
|
|
251
|
+
};
|
|
252
|
+
readonly effect: {
|
|
253
|
+
readonly merge: readonly [{
|
|
254
|
+
readonly var: "state";
|
|
255
|
+
}, {
|
|
256
|
+
readonly status: "REGISTERED";
|
|
257
|
+
readonly address: {
|
|
258
|
+
readonly var: "event.agent";
|
|
259
|
+
};
|
|
260
|
+
readonly stake: {
|
|
261
|
+
readonly var: "event.stake";
|
|
262
|
+
};
|
|
263
|
+
readonly registeredAt: {
|
|
264
|
+
readonly var: "$timestamp";
|
|
265
|
+
};
|
|
266
|
+
readonly reputation: {
|
|
267
|
+
readonly accuracy: 100;
|
|
268
|
+
readonly totalResolutions: 0;
|
|
269
|
+
readonly disputesWon: 0;
|
|
270
|
+
readonly disputesLost: 0;
|
|
271
|
+
};
|
|
272
|
+
readonly domains: {
|
|
273
|
+
readonly var: "event.domains";
|
|
274
|
+
};
|
|
275
|
+
readonly slashingHistory: readonly [];
|
|
276
|
+
}];
|
|
277
|
+
};
|
|
278
|
+
readonly dependencies: readonly [];
|
|
279
|
+
}, {
|
|
280
|
+
readonly from: "REGISTERED";
|
|
281
|
+
readonly to: "ACTIVE";
|
|
282
|
+
readonly eventName: "activate";
|
|
283
|
+
readonly guard: {
|
|
284
|
+
readonly or: readonly [{
|
|
285
|
+
readonly "===": readonly [{
|
|
286
|
+
readonly var: "event.agent";
|
|
287
|
+
}, {
|
|
288
|
+
readonly var: "state.address";
|
|
289
|
+
}];
|
|
290
|
+
}, {
|
|
291
|
+
readonly var: "event.adminOverride";
|
|
292
|
+
}];
|
|
293
|
+
};
|
|
294
|
+
readonly effect: {
|
|
295
|
+
readonly merge: readonly [{
|
|
296
|
+
readonly var: "state";
|
|
297
|
+
}, {
|
|
298
|
+
readonly status: "ACTIVE";
|
|
299
|
+
readonly activatedAt: {
|
|
300
|
+
readonly var: "$timestamp";
|
|
301
|
+
};
|
|
302
|
+
}];
|
|
303
|
+
};
|
|
304
|
+
readonly dependencies: readonly [];
|
|
305
|
+
}, {
|
|
306
|
+
readonly from: "ACTIVE";
|
|
307
|
+
readonly to: "ACTIVE";
|
|
308
|
+
readonly eventName: "add_stake";
|
|
309
|
+
readonly guard: {
|
|
310
|
+
readonly and: readonly [{
|
|
311
|
+
readonly "===": readonly [{
|
|
312
|
+
readonly var: "event.agent";
|
|
313
|
+
}, {
|
|
314
|
+
readonly var: "state.address";
|
|
315
|
+
}];
|
|
316
|
+
}, {
|
|
317
|
+
readonly ">": readonly [{
|
|
318
|
+
readonly var: "event.amount";
|
|
319
|
+
}, 0];
|
|
320
|
+
}];
|
|
321
|
+
};
|
|
322
|
+
readonly effect: {
|
|
323
|
+
readonly merge: readonly [{
|
|
324
|
+
readonly var: "state";
|
|
325
|
+
}, {
|
|
326
|
+
readonly stake: {
|
|
327
|
+
readonly "+": readonly [{
|
|
328
|
+
readonly var: "state.stake";
|
|
329
|
+
}, {
|
|
330
|
+
readonly var: "event.amount";
|
|
331
|
+
}];
|
|
332
|
+
};
|
|
333
|
+
readonly lastStakeAt: {
|
|
334
|
+
readonly var: "$timestamp";
|
|
335
|
+
};
|
|
336
|
+
}];
|
|
337
|
+
};
|
|
338
|
+
readonly dependencies: readonly [];
|
|
339
|
+
}, {
|
|
340
|
+
readonly from: "ACTIVE";
|
|
341
|
+
readonly to: "ACTIVE";
|
|
342
|
+
readonly eventName: "record_resolution";
|
|
343
|
+
readonly guard: {
|
|
344
|
+
readonly var: "event.marketId";
|
|
345
|
+
};
|
|
346
|
+
readonly effect: {
|
|
347
|
+
readonly merge: readonly [{
|
|
348
|
+
readonly var: "state";
|
|
349
|
+
}, {
|
|
350
|
+
readonly reputation: {
|
|
351
|
+
readonly merge: readonly [{
|
|
352
|
+
readonly var: "state.reputation";
|
|
353
|
+
}, {
|
|
354
|
+
readonly totalResolutions: {
|
|
355
|
+
readonly "+": readonly [{
|
|
356
|
+
readonly var: "state.reputation.totalResolutions";
|
|
357
|
+
}, 1];
|
|
358
|
+
};
|
|
359
|
+
readonly accuracy: {
|
|
360
|
+
readonly if: readonly [{
|
|
361
|
+
readonly var: "event.correct";
|
|
362
|
+
}, {
|
|
363
|
+
readonly var: "state.reputation.accuracy";
|
|
364
|
+
}, {
|
|
365
|
+
readonly "-": readonly [{
|
|
366
|
+
readonly var: "state.reputation.accuracy";
|
|
367
|
+
}, 5];
|
|
368
|
+
}];
|
|
369
|
+
};
|
|
370
|
+
}];
|
|
371
|
+
};
|
|
372
|
+
readonly lastResolutionAt: {
|
|
373
|
+
readonly var: "$timestamp";
|
|
374
|
+
};
|
|
375
|
+
}];
|
|
376
|
+
};
|
|
377
|
+
readonly dependencies: readonly [];
|
|
378
|
+
}, {
|
|
379
|
+
readonly from: "ACTIVE";
|
|
380
|
+
readonly to: "SLASHED";
|
|
381
|
+
readonly eventName: "slash";
|
|
382
|
+
readonly guard: {
|
|
383
|
+
readonly and: readonly [{
|
|
384
|
+
readonly var: "event.reason";
|
|
385
|
+
}, {
|
|
386
|
+
readonly ">": readonly [{
|
|
387
|
+
readonly var: "event.amount";
|
|
388
|
+
}, 0];
|
|
389
|
+
}, {
|
|
390
|
+
readonly "<=": readonly [{
|
|
391
|
+
readonly var: "event.amount";
|
|
392
|
+
}, {
|
|
393
|
+
readonly var: "state.stake";
|
|
394
|
+
}];
|
|
395
|
+
}];
|
|
396
|
+
};
|
|
397
|
+
readonly effect: {
|
|
398
|
+
readonly merge: readonly [{
|
|
399
|
+
readonly var: "state";
|
|
400
|
+
}, {
|
|
401
|
+
readonly status: "SLASHED";
|
|
402
|
+
readonly stake: {
|
|
403
|
+
readonly "-": readonly [{
|
|
404
|
+
readonly var: "state.stake";
|
|
405
|
+
}, {
|
|
406
|
+
readonly var: "event.amount";
|
|
407
|
+
}];
|
|
408
|
+
};
|
|
409
|
+
readonly slashingHistory: {
|
|
410
|
+
readonly cat: readonly [{
|
|
411
|
+
readonly var: "state.slashingHistory";
|
|
412
|
+
}, readonly [{
|
|
413
|
+
readonly reason: {
|
|
414
|
+
readonly var: "event.reason";
|
|
415
|
+
};
|
|
416
|
+
readonly amount: {
|
|
417
|
+
readonly var: "event.amount";
|
|
418
|
+
};
|
|
419
|
+
readonly marketId: {
|
|
420
|
+
readonly var: "event.marketId";
|
|
421
|
+
};
|
|
422
|
+
readonly slashedAt: {
|
|
423
|
+
readonly var: "$timestamp";
|
|
424
|
+
};
|
|
425
|
+
}]];
|
|
426
|
+
};
|
|
427
|
+
readonly slashedAt: {
|
|
428
|
+
readonly var: "$timestamp";
|
|
429
|
+
};
|
|
430
|
+
}];
|
|
431
|
+
};
|
|
432
|
+
readonly dependencies: readonly [];
|
|
433
|
+
}, {
|
|
434
|
+
readonly from: "SLASHED";
|
|
435
|
+
readonly to: "ACTIVE";
|
|
436
|
+
readonly eventName: "reactivate";
|
|
437
|
+
readonly guard: {
|
|
438
|
+
readonly and: readonly [{
|
|
439
|
+
readonly "===": readonly [{
|
|
440
|
+
readonly var: "event.agent";
|
|
441
|
+
}, {
|
|
442
|
+
readonly var: "state.address";
|
|
443
|
+
}];
|
|
444
|
+
}, {
|
|
445
|
+
readonly ">=": readonly [{
|
|
446
|
+
readonly var: "state.stake";
|
|
447
|
+
}, {
|
|
448
|
+
readonly var: "state.minStake";
|
|
449
|
+
}];
|
|
450
|
+
}];
|
|
451
|
+
};
|
|
452
|
+
readonly effect: {
|
|
453
|
+
readonly merge: readonly [{
|
|
454
|
+
readonly var: "state";
|
|
455
|
+
}, {
|
|
456
|
+
readonly status: "ACTIVE";
|
|
457
|
+
readonly reactivatedAt: {
|
|
458
|
+
readonly var: "$timestamp";
|
|
459
|
+
};
|
|
460
|
+
}];
|
|
461
|
+
};
|
|
462
|
+
readonly dependencies: readonly [];
|
|
463
|
+
}, {
|
|
464
|
+
readonly from: "ACTIVE";
|
|
465
|
+
readonly to: "WITHDRAWN";
|
|
466
|
+
readonly eventName: "withdraw";
|
|
467
|
+
readonly guard: {
|
|
468
|
+
readonly "===": readonly [{
|
|
469
|
+
readonly var: "event.agent";
|
|
470
|
+
}, {
|
|
471
|
+
readonly var: "state.address";
|
|
472
|
+
}];
|
|
473
|
+
};
|
|
474
|
+
readonly effect: {
|
|
475
|
+
readonly merge: readonly [{
|
|
476
|
+
readonly var: "state";
|
|
477
|
+
}, {
|
|
478
|
+
readonly status: "WITHDRAWN";
|
|
479
|
+
readonly withdrawnAt: {
|
|
480
|
+
readonly var: "$timestamp";
|
|
481
|
+
};
|
|
482
|
+
readonly finalStake: {
|
|
483
|
+
readonly var: "state.stake";
|
|
484
|
+
};
|
|
485
|
+
}];
|
|
486
|
+
};
|
|
487
|
+
readonly dependencies: readonly [];
|
|
488
|
+
}, {
|
|
489
|
+
readonly from: "SLASHED";
|
|
490
|
+
readonly to: "WITHDRAWN";
|
|
491
|
+
readonly eventName: "withdraw";
|
|
492
|
+
readonly guard: {
|
|
493
|
+
readonly "===": readonly [{
|
|
494
|
+
readonly var: "event.agent";
|
|
495
|
+
}, {
|
|
496
|
+
readonly var: "state.address";
|
|
497
|
+
}];
|
|
498
|
+
};
|
|
499
|
+
readonly effect: {
|
|
500
|
+
readonly merge: readonly [{
|
|
501
|
+
readonly var: "state";
|
|
502
|
+
}, {
|
|
503
|
+
readonly status: "WITHDRAWN";
|
|
504
|
+
readonly withdrawnAt: {
|
|
505
|
+
readonly var: "$timestamp";
|
|
506
|
+
};
|
|
507
|
+
readonly finalStake: {
|
|
508
|
+
readonly var: "state.stake";
|
|
509
|
+
};
|
|
510
|
+
}];
|
|
511
|
+
};
|
|
512
|
+
readonly dependencies: readonly [];
|
|
513
|
+
}];
|
|
514
|
+
};
|
|
515
|
+
export declare const identityUniversalDef: {
|
|
516
|
+
readonly metadata: {
|
|
517
|
+
readonly name: "IdentityUniversal";
|
|
518
|
+
readonly description: "Minimal identity state machine - extend for custom use cases";
|
|
519
|
+
readonly version: "1.0.0";
|
|
520
|
+
};
|
|
521
|
+
readonly states: {
|
|
522
|
+
readonly CREATED: {
|
|
523
|
+
readonly id: "CREATED";
|
|
524
|
+
readonly isFinal: false;
|
|
525
|
+
readonly metadata: null;
|
|
526
|
+
};
|
|
527
|
+
readonly ACTIVE: {
|
|
528
|
+
readonly id: "ACTIVE";
|
|
529
|
+
readonly isFinal: false;
|
|
530
|
+
readonly metadata: null;
|
|
531
|
+
};
|
|
532
|
+
readonly INACTIVE: {
|
|
533
|
+
readonly id: "INACTIVE";
|
|
534
|
+
readonly isFinal: true;
|
|
535
|
+
readonly metadata: null;
|
|
536
|
+
};
|
|
537
|
+
};
|
|
538
|
+
readonly initialState: "CREATED";
|
|
539
|
+
readonly transitions: readonly [{
|
|
540
|
+
readonly from: "CREATED";
|
|
541
|
+
readonly to: "ACTIVE";
|
|
542
|
+
readonly eventName: "activate";
|
|
543
|
+
readonly guard: {
|
|
544
|
+
readonly "==": readonly [1, 1];
|
|
545
|
+
};
|
|
546
|
+
readonly effect: {
|
|
547
|
+
readonly merge: readonly [{
|
|
548
|
+
readonly var: "state";
|
|
549
|
+
}, {
|
|
550
|
+
readonly status: "ACTIVE";
|
|
551
|
+
readonly activatedAt: {
|
|
552
|
+
readonly var: "$timestamp";
|
|
553
|
+
};
|
|
554
|
+
}];
|
|
555
|
+
};
|
|
556
|
+
readonly dependencies: readonly [];
|
|
557
|
+
}, {
|
|
558
|
+
readonly from: "ACTIVE";
|
|
559
|
+
readonly to: "ACTIVE";
|
|
560
|
+
readonly eventName: "update";
|
|
561
|
+
readonly guard: {
|
|
562
|
+
readonly "==": readonly [1, 1];
|
|
563
|
+
};
|
|
564
|
+
readonly effect: {
|
|
565
|
+
readonly merge: readonly [{
|
|
566
|
+
readonly var: "state";
|
|
567
|
+
}, {
|
|
568
|
+
readonly updatedAt: {
|
|
569
|
+
readonly var: "$timestamp";
|
|
570
|
+
};
|
|
571
|
+
readonly metadata: {
|
|
572
|
+
readonly var: "event.metadata";
|
|
573
|
+
};
|
|
574
|
+
}];
|
|
575
|
+
};
|
|
576
|
+
readonly dependencies: readonly [];
|
|
577
|
+
}, {
|
|
578
|
+
readonly from: "ACTIVE";
|
|
579
|
+
readonly to: "INACTIVE";
|
|
580
|
+
readonly eventName: "deactivate";
|
|
581
|
+
readonly guard: {
|
|
582
|
+
readonly "==": readonly [1, 1];
|
|
583
|
+
};
|
|
584
|
+
readonly effect: {
|
|
585
|
+
readonly merge: readonly [{
|
|
586
|
+
readonly var: "state";
|
|
587
|
+
}, {
|
|
588
|
+
readonly status: "INACTIVE";
|
|
589
|
+
readonly deactivatedAt: {
|
|
590
|
+
readonly var: "$timestamp";
|
|
591
|
+
};
|
|
592
|
+
}];
|
|
593
|
+
};
|
|
594
|
+
readonly dependencies: readonly [];
|
|
595
|
+
}];
|
|
596
|
+
};
|
|
@@ -3,22 +3,25 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Application-specific types and utilities for OttoChain SDK.
|
|
5
5
|
*
|
|
6
|
+
* Each app provides:
|
|
7
|
+
* - Universal state machine (minimal, extensible)
|
|
8
|
+
* - Specialized state machines (opinionated defaults)
|
|
9
|
+
* - getXxxDefinition() helper to retrieve definitions
|
|
10
|
+
*
|
|
6
11
|
* @example
|
|
7
12
|
* ```typescript
|
|
8
|
-
* import { identity, contracts, markets,
|
|
13
|
+
* import { identity, contracts, markets, governance, corporate } from '@ottochain/sdk/apps';
|
|
9
14
|
*
|
|
10
|
-
* //
|
|
11
|
-
* const
|
|
15
|
+
* // Get identity definitions
|
|
16
|
+
* const agentDef = identity.getIdentityDefinition('agent');
|
|
17
|
+
* const oracleDef = identity.getIdentityDefinition('oracle');
|
|
12
18
|
*
|
|
13
|
-
* //
|
|
14
|
-
* const
|
|
19
|
+
* // Get market definitions
|
|
20
|
+
* const predictionDef = markets.getMarketDefinition('prediction');
|
|
21
|
+
* const auctionDef = markets.getMarketDefinition('auction');
|
|
15
22
|
*
|
|
16
|
-
* //
|
|
17
|
-
* const
|
|
18
|
-
* name: 'Treasury',
|
|
19
|
-
* signers: ['DAG...', 'DAG...', 'DAG...'],
|
|
20
|
-
* threshold: 2
|
|
21
|
-
* });
|
|
23
|
+
* // Get DAO definitions
|
|
24
|
+
* const multisigDef = governance.getGovernanceDefinition('daoMultisig');
|
|
22
25
|
* ```
|
|
23
26
|
*
|
|
24
27
|
* @packageDocumentation
|
|
@@ -26,6 +29,5 @@
|
|
|
26
29
|
export * as identity from './identity/index.js';
|
|
27
30
|
export * as contracts from './contracts/index.js';
|
|
28
31
|
export * as markets from './markets/index.js';
|
|
29
|
-
export * as oracles from './oracles/index.js';
|
|
30
32
|
export * as governance from './governance/index.js';
|
|
31
33
|
export * as corporate from './corporate/index.js';
|