@ocap/resolver 1.31.8 → 1.32.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/esm/_virtual/rolldown_runtime.mjs +7 -0
- package/esm/api.d.mts +33 -5
- package/esm/api.mjs +939 -53
- package/esm/dashboard.d.mts +199 -0
- package/esm/dashboard.mjs +2481 -0
- package/esm/explorer.d.mts +29 -0
- package/esm/explorer.mjs +227 -0
- package/esm/follower.d.mts +277 -0
- package/esm/follower.mjs +2428 -0
- package/esm/hooks.mjs +1 -1
- package/esm/hotstuff-runtime.d.mts +271 -0
- package/esm/hotstuff-runtime.mjs +2668 -0
- package/esm/index.d.mts +87 -4
- package/esm/index.mjs +937 -177
- package/esm/node-preferences.d.mts +203 -0
- package/esm/node-preferences.mjs +1021 -0
- package/esm/replayer.d.mts +74 -0
- package/esm/replayer.mjs +394 -0
- package/esm/token-distribution.mjs +2 -2
- package/esm/token-flow.mjs +1 -1
- package/esm/types.d.mts +25 -2
- package/lib/api.cjs +941 -52
- package/lib/api.d.cts +33 -5
- package/lib/dashboard.cjs +2491 -0
- package/lib/dashboard.d.cts +199 -0
- package/lib/explorer.cjs +227 -0
- package/lib/explorer.d.cts +29 -0
- package/lib/follower.cjs +2434 -0
- package/lib/follower.d.cts +277 -0
- package/lib/hooks.cjs +1 -1
- package/lib/hotstuff-runtime.cjs +2671 -0
- package/lib/hotstuff-runtime.d.cts +271 -0
- package/lib/index.cjs +972 -177
- package/lib/index.d.cts +87 -4
- package/lib/node-preferences.cjs +1043 -0
- package/lib/node-preferences.d.cts +203 -0
- package/lib/replayer.cjs +395 -0
- package/lib/replayer.d.cts +74 -0
- package/lib/token-distribution.cjs +2 -2
- package/lib/token-flow.cjs +1 -1
- package/lib/types.d.cts +25 -2
- 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 };
|