@ocap/resolver 1.31.9 → 1.32.1

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 (42) hide show
  1. package/esm/_virtual/rolldown_runtime.mjs +7 -0
  2. package/esm/api.d.mts +33 -5
  3. package/esm/api.mjs +939 -53
  4. package/esm/dashboard.d.mts +199 -0
  5. package/esm/dashboard.mjs +2481 -0
  6. package/esm/explorer.d.mts +29 -0
  7. package/esm/explorer.mjs +227 -0
  8. package/esm/follower.d.mts +294 -0
  9. package/esm/follower.mjs +2452 -0
  10. package/esm/hooks.mjs +1 -1
  11. package/esm/hotstuff-runtime.d.mts +271 -0
  12. package/esm/hotstuff-runtime.mjs +2668 -0
  13. package/esm/index.d.mts +79 -4
  14. package/esm/index.mjs +911 -174
  15. package/esm/node-preferences.d.mts +203 -0
  16. package/esm/node-preferences.mjs +1021 -0
  17. package/esm/replayer.d.mts +114 -0
  18. package/esm/replayer.mjs +430 -0
  19. package/esm/token-distribution.mjs +2 -2
  20. package/esm/token-flow.mjs +1 -1
  21. package/esm/types.d.mts +25 -2
  22. package/lib/api.cjs +941 -52
  23. package/lib/api.d.cts +33 -5
  24. package/lib/dashboard.cjs +2491 -0
  25. package/lib/dashboard.d.cts +199 -0
  26. package/lib/explorer.cjs +227 -0
  27. package/lib/explorer.d.cts +29 -0
  28. package/lib/follower.cjs +2458 -0
  29. package/lib/follower.d.cts +294 -0
  30. package/lib/hooks.cjs +1 -1
  31. package/lib/hotstuff-runtime.cjs +2671 -0
  32. package/lib/hotstuff-runtime.d.cts +271 -0
  33. package/lib/index.cjs +946 -174
  34. package/lib/index.d.cts +79 -4
  35. package/lib/node-preferences.cjs +1043 -0
  36. package/lib/node-preferences.d.cts +203 -0
  37. package/lib/replayer.cjs +432 -0
  38. package/lib/replayer.d.cts +114 -0
  39. package/lib/token-distribution.cjs +2 -2
  40. package/lib/token-flow.cjs +1 -1
  41. package/lib/types.d.cts +25 -2
  42. package/package.json +20 -14
package/lib/api.d.cts CHANGED
@@ -1,9 +1,13 @@
1
+ import { IAdminAuthGuard, NodePreferencesManager } from "./node-preferences.cjs";
2
+ import { CreateNodeDashboardRouterOptions } from "./dashboard.cjs";
1
3
  import { TIndexedTokenState as TIndexedTokenState$1 } from "./types.cjs";
2
- import { ILedger } from "@ocap/types";
3
- import { Router } from "express";
4
+ import { IFollowerStatusResponse, ILedger, INodeRuntimeAdapter, IStateDB, TNodeRetentionMode } from "@ocap/types";
5
+ import { RequestHandler, Router } from "express";
4
6
 
5
7
  //#region src/api.d.ts
6
-
8
+ declare const MAX_HOT_TAIL_LIMIT = 100;
9
+ declare const MAX_HOT_TAIL_RESPONSE_BYTES: number;
10
+ declare const MAX_WITNESS_ATTESTATION_BODY_BYTES: number;
7
11
  /**
8
12
  * Resolver interface for API handler
9
13
  */
@@ -11,16 +15,40 @@ interface IAPIResolver {
11
15
  getTokenState(params: {
12
16
  address: string;
13
17
  }): Promise<TIndexedTokenState$1 | null>;
18
+ getFollowerStatus?(): Promise<IFollowerStatusResponse | null>;
19
+ getNodeRuntime?(): INodeRuntimeAdapter | undefined;
20
+ readonly?: boolean;
14
21
  ledger: ILedger;
22
+ statedb?: IStateDB;
23
+ config?: {
24
+ chainId?: string;
25
+ };
15
26
  }
16
27
  /**
17
28
  * Parameters for createAPIHandler
18
29
  */
19
30
  interface ICreateAPIHandlerParams {
20
31
  resolver: IAPIResolver;
32
+ maxResponseBytes?: number;
33
+ retentionMode?: TNodeRetentionMode;
34
+ snapshotBaseUrl?: string | null;
35
+ nodeId?: string;
36
+ preferencesManager?: NodePreferencesManager;
37
+ authGuard?: IAdminAuthGuard;
38
+ nodeDashboardRouter?: RequestHandler;
39
+ nodeDashboardOptions?: Omit<CreateNodeDashboardRouterOptions, 'resolver'>;
21
40
  }
41
+ type CreateAPIHandlerOptions = ICreateAPIHandlerParams;
22
42
  declare function createAPIHandler({
23
- resolver
43
+ resolver,
44
+ maxResponseBytes,
45
+ retentionMode: configuredRetentionMode,
46
+ snapshotBaseUrl: configuredSnapshotBaseUrl,
47
+ nodeId,
48
+ preferencesManager,
49
+ authGuard,
50
+ nodeDashboardRouter,
51
+ nodeDashboardOptions
24
52
  }: ICreateAPIHandlerParams): Router;
25
53
  //#endregion
26
- export { createAPIHandler };
54
+ export { CreateAPIHandlerOptions, ICreateAPIHandlerParams, MAX_HOT_TAIL_LIMIT, MAX_HOT_TAIL_RESPONSE_BYTES, MAX_WITNESS_ATTESTATION_BODY_BYTES, createAPIHandler };