@lodestar/api 1.20.0-dev.c1532773c2 → 1.20.0-dev.f4460cd1d6
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/README.md +2 -2
- package/lib/beacon/client/beacon.d.ts +4 -3
- package/lib/beacon/client/beacon.js +3 -36
- package/lib/beacon/client/beacon.js.map +1 -1
- package/lib/beacon/client/config.d.ts +4 -3
- package/lib/beacon/client/config.js +3 -6
- package/lib/beacon/client/config.js.map +1 -1
- package/lib/beacon/client/debug.d.ts +4 -3
- package/lib/beacon/client/debug.js +4 -45
- package/lib/beacon/client/debug.js.map +1 -1
- package/lib/beacon/client/events.d.ts +5 -2
- package/lib/beacon/client/events.js +32 -35
- package/lib/beacon/client/events.js.map +1 -1
- package/lib/beacon/client/index.d.ts +6 -3
- package/lib/beacon/client/index.js +2 -2
- package/lib/beacon/client/index.js.map +1 -1
- package/lib/beacon/client/lightclient.d.ts +4 -3
- package/lib/beacon/client/lightclient.js +4 -7
- package/lib/beacon/client/lightclient.js.map +1 -1
- package/lib/beacon/client/lodestar.d.ts +4 -3
- package/lib/beacon/client/lodestar.js +4 -7
- package/lib/beacon/client/lodestar.js.map +1 -1
- package/lib/beacon/client/node.d.ts +4 -3
- package/lib/beacon/client/node.js +4 -7
- package/lib/beacon/client/node.js.map +1 -1
- package/lib/beacon/client/proof.d.ts +5 -4
- package/lib/beacon/client/proof.js +5 -61
- package/lib/beacon/client/proof.js.map +1 -1
- package/lib/beacon/client/validator.d.ts +4 -3
- package/lib/beacon/client/validator.js +4 -7
- package/lib/beacon/client/validator.js.map +1 -1
- package/lib/beacon/index.d.ts +5 -5
- package/lib/beacon/index.js.map +1 -1
- package/lib/beacon/routes/beacon/block.d.ts +282 -164
- package/lib/beacon/routes/beacon/block.js +324 -116
- package/lib/beacon/routes/beacon/block.js.map +1 -1
- package/lib/beacon/routes/beacon/index.d.ts +6 -588
- package/lib/beacon/routes/beacon/index.js +16 -26
- package/lib/beacon/routes/beacon/index.js.map +1 -1
- package/lib/beacon/routes/beacon/pool.d.ts +155 -117
- package/lib/beacon/routes/beacon/pool.js +146 -42
- package/lib/beacon/routes/beacon/pool.js.map +1 -1
- package/lib/beacon/routes/beacon/rewards.d.ts +113 -101
- package/lib/beacon/routes/beacon/rewards.js +98 -63
- package/lib/beacon/routes/beacon/rewards.js.map +1 -1
- package/lib/beacon/routes/beacon/state.d.ts +172 -226
- package/lib/beacon/routes/beacon/state.js +204 -126
- package/lib/beacon/routes/beacon/state.js.map +1 -1
- package/lib/beacon/routes/config.d.ts +21 -36
- package/lib/beacon/routes/config.js +45 -24
- package/lib/beacon/routes/config.js.map +1 -1
- package/lib/beacon/routes/debug.d.ts +32 -95
- package/lib/beacon/routes/debug.js +87 -45
- package/lib/beacon/routes/debug.js.map +1 -1
- package/lib/beacon/routes/events.d.ts +20 -16
- package/lib/beacon/routes/events.js +39 -17
- package/lib/beacon/routes/events.js.map +1 -1
- package/lib/beacon/routes/index.d.ts +19 -19
- package/lib/beacon/routes/index.js +1 -0
- package/lib/beacon/routes/index.js.map +1 -1
- package/lib/beacon/routes/lightclient.d.ts +33 -55
- package/lib/beacon/routes/lightclient.js +107 -47
- package/lib/beacon/routes/lightclient.js.map +1 -1
- package/lib/beacon/routes/lodestar.d.ts +74 -148
- package/lib/beacon/routes/lodestar.js +126 -77
- package/lib/beacon/routes/lodestar.js.map +1 -1
- package/lib/beacon/routes/node.d.ts +48 -82
- package/lib/beacon/routes/node.js +90 -57
- package/lib/beacon/routes/node.js.map +1 -1
- package/lib/beacon/routes/proof.d.ts +25 -31
- package/lib/beacon/routes/proof.js +44 -24
- package/lib/beacon/routes/proof.js.map +1 -1
- package/lib/beacon/routes/validator.d.ts +547 -320
- package/lib/beacon/routes/validator.js +494 -213
- package/lib/beacon/routes/validator.js.map +1 -1
- package/lib/beacon/server/beacon.d.ts +3 -4
- package/lib/beacon/server/beacon.js +4 -57
- package/lib/beacon/server/beacon.js.map +1 -1
- package/lib/beacon/server/config.d.ts +3 -4
- package/lib/beacon/server/config.js +4 -5
- package/lib/beacon/server/config.js.map +1 -1
- package/lib/beacon/server/debug.d.ts +3 -4
- package/lib/beacon/server/debug.js +4 -54
- package/lib/beacon/server/debug.js.map +1 -1
- package/lib/beacon/server/events.d.ts +4 -4
- package/lib/beacon/server/events.js +17 -23
- package/lib/beacon/server/events.js.map +1 -1
- package/lib/beacon/server/index.d.ts +7 -8
- package/lib/beacon/server/index.js +13 -14
- package/lib/beacon/server/index.js.map +1 -1
- package/lib/beacon/server/lightclient.d.ts +3 -4
- package/lib/beacon/server/lightclient.js +4 -5
- package/lib/beacon/server/lightclient.js.map +1 -1
- package/lib/beacon/server/lodestar.d.ts +3 -4
- package/lib/beacon/server/lodestar.js +4 -5
- package/lib/beacon/server/lodestar.js.map +1 -1
- package/lib/beacon/server/node.d.ts +3 -4
- package/lib/beacon/server/node.js +4 -18
- package/lib/beacon/server/node.js.map +1 -1
- package/lib/beacon/server/proof.d.ts +3 -4
- package/lib/beacon/server/proof.js +4 -36
- package/lib/beacon/server/proof.js.map +1 -1
- package/lib/beacon/server/validator.d.ts +3 -4
- package/lib/beacon/server/validator.js +4 -21
- package/lib/beacon/server/validator.js.map +1 -1
- package/lib/builder/client.d.ts +4 -6
- package/lib/builder/client.js +3 -9
- package/lib/builder/client.js.map +1 -1
- package/lib/builder/index.d.ts +8 -5
- package/lib/builder/index.js +4 -1
- package/lib/builder/index.js.map +1 -1
- package/lib/builder/routes.d.ts +24 -38
- package/lib/builder/routes.js +77 -33
- package/lib/builder/routes.js.map +1 -1
- package/lib/builder/server/index.d.ts +6 -6
- package/lib/builder/server/index.js +7 -8
- package/lib/builder/server/index.js.map +1 -1
- package/lib/index.d.ts +9 -6
- package/lib/index.js +5 -4
- package/lib/index.js.map +1 -1
- package/lib/keymanager/client.d.ts +4 -3
- package/lib/keymanager/client.js +4 -7
- package/lib/keymanager/client.js.map +1 -1
- package/lib/keymanager/index.d.ts +5 -4
- package/lib/keymanager/index.js +1 -1
- package/lib/keymanager/index.js.map +1 -1
- package/lib/keymanager/routes.d.ts +155 -177
- package/lib/keymanager/routes.js +236 -123
- package/lib/keymanager/routes.js.map +1 -1
- package/lib/keymanager/server/index.d.ts +6 -6
- package/lib/keymanager/server/index.js +7 -8
- package/lib/keymanager/server/index.js.map +1 -1
- package/lib/server/index.d.ts +2 -0
- package/lib/server/index.js +3 -0
- package/lib/server/index.js.map +1 -0
- package/lib/utils/client/error.d.ts +6 -0
- package/lib/utils/client/error.js +8 -0
- package/lib/utils/client/error.js.map +1 -0
- package/lib/utils/client/httpClient.d.ts +35 -75
- package/lib/utils/client/httpClient.js +201 -153
- package/lib/utils/client/httpClient.js.map +1 -1
- package/lib/utils/client/index.d.ts +6 -2
- package/lib/utils/client/index.js +6 -2
- package/lib/utils/client/index.js.map +1 -1
- package/lib/utils/client/method.d.ts +11 -0
- package/lib/utils/client/method.js +27 -0
- package/lib/utils/client/method.js.map +1 -0
- package/lib/utils/client/request.d.ts +33 -0
- package/lib/utils/client/request.js +66 -0
- package/lib/utils/client/request.js.map +1 -0
- package/lib/utils/client/response.d.ts +35 -0
- package/lib/utils/client/response.js +166 -0
- package/lib/utils/client/response.js.map +1 -0
- package/lib/utils/codecs.d.ts +28 -0
- package/lib/utils/codecs.js +105 -0
- package/lib/utils/codecs.js.map +1 -0
- package/lib/utils/fork.d.ts +8 -0
- package/lib/utils/fork.js +35 -0
- package/lib/utils/fork.js.map +1 -0
- package/lib/utils/headers.d.ts +37 -0
- package/lib/utils/headers.js +134 -0
- package/lib/utils/headers.js.map +1 -0
- package/lib/utils/httpStatusCode.js.map +1 -0
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/metadata.d.ts +88 -0
- package/lib/utils/metadata.js +126 -0
- package/lib/utils/metadata.js.map +1 -0
- package/lib/utils/schema.d.ts +31 -17
- package/lib/utils/schema.js +18 -6
- package/lib/utils/schema.js.map +1 -1
- package/lib/utils/serdes.d.ts +3 -0
- package/lib/utils/serdes.js +13 -0
- package/lib/utils/serdes.js.map +1 -1
- package/lib/utils/server/{errors.d.ts → error.d.ts} +2 -2
- package/lib/utils/server/{errors.js → error.js} +1 -1
- package/lib/utils/server/error.js.map +1 -0
- package/lib/utils/server/handler.d.ts +11 -0
- package/lib/utils/server/handler.js +109 -0
- package/lib/utils/server/handler.js.map +1 -0
- package/lib/utils/server/index.d.ts +5 -4
- package/lib/utils/server/index.js +5 -4
- package/lib/utils/server/index.js.map +1 -1
- package/lib/utils/server/method.d.ts +35 -0
- package/lib/utils/server/method.js +2 -0
- package/lib/utils/server/method.js.map +1 -0
- package/lib/utils/server/parser.d.ts +3 -0
- package/lib/utils/server/parser.js +20 -0
- package/lib/utils/server/parser.js.map +1 -0
- package/lib/utils/server/route.d.ts +20 -0
- package/lib/utils/server/route.js +19 -0
- package/lib/utils/server/route.js.map +1 -0
- package/lib/utils/types.d.ts +116 -104
- package/lib/utils/types.js +2 -155
- package/lib/utils/types.js.map +1 -1
- package/lib/utils/urlFormat.d.ts +2 -2
- package/lib/utils/urlFormat.js +3 -3
- package/lib/utils/urlFormat.js.map +1 -1
- package/lib/utils/wireFormat.d.ts +8 -0
- package/lib/utils/wireFormat.js +23 -0
- package/lib/utils/wireFormat.js.map +1 -0
- package/package.json +9 -6
- package/lib/interfaces.d.ts +0 -44
- package/lib/interfaces.js +0 -2
- package/lib/interfaces.js.map +0 -1
- package/lib/utils/acceptHeader.d.ts +0 -9
- package/lib/utils/acceptHeader.js +0 -62
- package/lib/utils/acceptHeader.js.map +0 -1
- package/lib/utils/client/client.d.ts +0 -29
- package/lib/utils/client/client.js +0 -88
- package/lib/utils/client/client.js.map +0 -1
- package/lib/utils/client/httpStatusCode.js.map +0 -1
- package/lib/utils/routes.d.ts +0 -6
- package/lib/utils/routes.js +0 -31
- package/lib/utils/routes.js.map +0 -1
- package/lib/utils/server/errors.js.map +0 -1
- package/lib/utils/server/genericJsonServer.d.ts +0 -13
- package/lib/utils/server/genericJsonServer.js +0 -32
- package/lib/utils/server/genericJsonServer.js.map +0 -1
- package/lib/utils/server/registerRoute.d.ts +0 -3
- package/lib/utils/server/registerRoute.js +0 -13
- package/lib/utils/server/registerRoute.js.map +0 -1
- package/lib/utils/server/types.d.ts +0 -22
- package/lib/utils/server/types.js +0 -2
- package/lib/utils/server/types.js.map +0 -1
- /package/lib/utils/{client/httpStatusCode.d.ts → httpStatusCode.d.ts} +0 -0
- /package/lib/utils/{client/httpStatusCode.js → httpStatusCode.js} +0 -0
|
@@ -1,289 +1,235 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { ContainerType, ValueOf } from "@chainsafe/ssz";
|
|
2
|
+
import { ChainForkConfig } from "@lodestar/config";
|
|
3
|
+
import { phase0, CommitteeIndex, Slot, Epoch, RootHex, StringType } from "@lodestar/types";
|
|
4
|
+
import { Endpoint, RouteDefinitions } from "../../../utils/index.js";
|
|
5
|
+
import { ExecutionOptimisticAndFinalizedMeta } from "../../../utils/metadata.js";
|
|
6
|
+
import { RootResponse } from "./block.js";
|
|
5
7
|
export type StateId = RootHex | Slot | "head" | "genesis" | "finalized" | "justified";
|
|
8
|
+
export type StateArgs = {
|
|
9
|
+
/**
|
|
10
|
+
* State identifier.
|
|
11
|
+
* Can be one of: "head" (canonical head in node's view), "genesis", "finalized", "justified", \<slot\>, \<hex encoded stateRoot with 0x prefix\>.
|
|
12
|
+
*/
|
|
13
|
+
stateId: StateId;
|
|
14
|
+
};
|
|
6
15
|
export type ValidatorId = string | number;
|
|
7
|
-
/**
|
|
8
|
-
* True if the response references an unverified execution payload. Optimistic information may be invalidated at
|
|
9
|
-
* a later time. If the field is not present, assume the False value.
|
|
10
|
-
*/
|
|
11
|
-
export type ExecutionOptimistic = boolean;
|
|
12
|
-
/**
|
|
13
|
-
* True if the response references the finalized history of the chain, as determined by fork choice.
|
|
14
|
-
*/
|
|
15
|
-
export type Finalized = boolean;
|
|
16
16
|
export type ValidatorStatus = "active" | "pending_initialized" | "pending_queued" | "active_ongoing" | "active_exiting" | "active_slashed" | "exited_unslashed" | "exited_slashed" | "withdrawal_possible" | "withdrawal_done";
|
|
17
|
-
export
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
finalized:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
17
|
+
export declare const RandaoResponseType: ContainerType<{
|
|
18
|
+
randao: import("@chainsafe/ssz").ByteVectorType;
|
|
19
|
+
}>;
|
|
20
|
+
export declare const FinalityCheckpointsType: ContainerType<{
|
|
21
|
+
previousJustified: ContainerType<{
|
|
22
|
+
epoch: import("@chainsafe/ssz").UintNumberType;
|
|
23
|
+
root: import("@chainsafe/ssz").ByteVectorType; /** All of the validator indices in the current sync committee */
|
|
24
|
+
}>;
|
|
25
|
+
currentJustified: ContainerType<{
|
|
26
|
+
epoch: import("@chainsafe/ssz").UintNumberType;
|
|
27
|
+
root: import("@chainsafe/ssz").ByteVectorType; /** All of the validator indices in the current sync committee */
|
|
28
|
+
}>;
|
|
29
|
+
finalized: ContainerType<{
|
|
30
|
+
epoch: import("@chainsafe/ssz").UintNumberType;
|
|
31
|
+
root: import("@chainsafe/ssz").ByteVectorType; /** All of the validator indices in the current sync committee */
|
|
32
|
+
}>;
|
|
33
|
+
}>;
|
|
34
|
+
export declare const ValidatorResponseType: ContainerType<{
|
|
35
|
+
index: import("@chainsafe/ssz").UintNumberType;
|
|
36
|
+
balance: import("@chainsafe/ssz").UintNumberType;
|
|
37
|
+
status: StringType<ValidatorStatus>;
|
|
38
|
+
validator: import("@lodestar/types/lib/phase0/validator.js").ValidatorNodeStructType;
|
|
39
|
+
}>;
|
|
40
|
+
export declare const EpochCommitteeResponseType: ContainerType<{
|
|
41
|
+
index: import("@chainsafe/ssz").UintNumberType;
|
|
42
|
+
slot: import("@chainsafe/ssz").UintNumberType;
|
|
43
|
+
validators: import("@chainsafe/ssz").ArrayType<import("@chainsafe/ssz").Type<number>, unknown, unknown>;
|
|
44
|
+
}>;
|
|
45
|
+
export declare const ValidatorBalanceType: ContainerType<{
|
|
46
|
+
index: import("@chainsafe/ssz").UintNumberType;
|
|
47
|
+
balance: import("@chainsafe/ssz").UintNumberType;
|
|
48
|
+
}>;
|
|
49
|
+
export declare const EpochSyncCommitteeResponseType: ContainerType<{
|
|
50
|
+
/** All of the validator indices in the current sync committee */
|
|
51
|
+
validators: import("@chainsafe/ssz").ArrayType<import("@chainsafe/ssz").Type<number>, unknown, unknown>;
|
|
49
52
|
/** Subcommittee slices of the current sync committee */
|
|
50
|
-
validatorAggregates:
|
|
51
|
-
}
|
|
52
|
-
export
|
|
53
|
+
validatorAggregates: import("@chainsafe/ssz").ArrayType<import("@chainsafe/ssz").Type<number[]>, unknown, unknown>;
|
|
54
|
+
}>;
|
|
55
|
+
export declare const ValidatorResponseListType: import("@chainsafe/ssz").ArrayType<import("@chainsafe/ssz").Type<import("@chainsafe/ssz").ValueOfFields<{
|
|
56
|
+
index: import("@chainsafe/ssz").UintNumberType;
|
|
57
|
+
balance: import("@chainsafe/ssz").UintNumberType;
|
|
58
|
+
status: StringType<ValidatorStatus>;
|
|
59
|
+
validator: import("@lodestar/types/lib/phase0/validator.js").ValidatorNodeStructType;
|
|
60
|
+
}>>, unknown, unknown>;
|
|
61
|
+
export declare const EpochCommitteeResponseListType: import("@chainsafe/ssz").ArrayType<import("@chainsafe/ssz").Type<import("@chainsafe/ssz").ValueOfFields<{
|
|
62
|
+
index: import("@chainsafe/ssz").UintNumberType;
|
|
63
|
+
slot: import("@chainsafe/ssz").UintNumberType;
|
|
64
|
+
validators: import("@chainsafe/ssz").ArrayType<import("@chainsafe/ssz").Type<number>, unknown, unknown>;
|
|
65
|
+
}>>, unknown, unknown>;
|
|
66
|
+
export declare const ValidatorBalanceListType: import("@chainsafe/ssz").ArrayType<import("@chainsafe/ssz").Type<import("@chainsafe/ssz").ValueOfFields<{
|
|
67
|
+
index: import("@chainsafe/ssz").UintNumberType;
|
|
68
|
+
balance: import("@chainsafe/ssz").UintNumberType;
|
|
69
|
+
}>>, unknown, unknown>;
|
|
70
|
+
export type RandaoResponse = ValueOf<typeof RandaoResponseType>;
|
|
71
|
+
export type FinalityCheckpoints = ValueOf<typeof FinalityCheckpointsType>;
|
|
72
|
+
export type ValidatorResponse = ValueOf<typeof ValidatorResponseType>;
|
|
73
|
+
export type EpochCommitteeResponse = ValueOf<typeof EpochCommitteeResponseType>;
|
|
74
|
+
export type ValidatorBalance = ValueOf<typeof ValidatorBalanceType>;
|
|
75
|
+
export type EpochSyncCommitteeResponse = ValueOf<typeof EpochSyncCommitteeResponseType>;
|
|
76
|
+
export type ValidatorResponseList = ValueOf<typeof ValidatorResponseListType>;
|
|
77
|
+
export type EpochCommitteeResponseList = ValueOf<typeof EpochCommitteeResponseListType>;
|
|
78
|
+
export type ValidatorBalanceList = ValueOf<typeof ValidatorBalanceListType>;
|
|
79
|
+
export type Endpoints = {
|
|
53
80
|
/**
|
|
54
81
|
* Get state SSZ HashTreeRoot
|
|
55
82
|
* Calculates HashTreeRoot for state with given 'stateId'. If stateId is root, same value will be returned.
|
|
56
|
-
*
|
|
57
|
-
* @param stateId State identifier.
|
|
58
|
-
* Can be one of: "head" (canonical head in node's view), "genesis", "finalized", "justified", \<slot\>, \<hex encoded stateRoot with 0x prefix\>.
|
|
59
83
|
*/
|
|
60
|
-
getStateRoot
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
root: Root;
|
|
64
|
-
};
|
|
65
|
-
executionOptimistic: ExecutionOptimistic;
|
|
66
|
-
finalized: Finalized;
|
|
84
|
+
getStateRoot: Endpoint<"GET", StateArgs, {
|
|
85
|
+
params: {
|
|
86
|
+
state_id: string;
|
|
67
87
|
};
|
|
68
|
-
},
|
|
88
|
+
}, RootResponse, ExecutionOptimisticAndFinalizedMeta>;
|
|
69
89
|
/**
|
|
70
90
|
* Get Fork object for requested state
|
|
71
91
|
* Returns [Fork](https://github.com/ethereum/consensus-specs/blob/v1.1.10/specs/phase0/beacon-chain.md#fork) object for state with given 'stateId'.
|
|
72
|
-
* @param stateId State identifier.
|
|
73
|
-
* Can be one of: "head" (canonical head in node's view), "genesis", "finalized", "justified", \<slot\>, \<hex encoded stateRoot with 0x prefix\>.
|
|
74
92
|
*/
|
|
75
|
-
getStateFork
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
executionOptimistic: ExecutionOptimistic;
|
|
79
|
-
finalized: Finalized;
|
|
93
|
+
getStateFork: Endpoint<"GET", StateArgs, {
|
|
94
|
+
params: {
|
|
95
|
+
state_id: string;
|
|
80
96
|
};
|
|
81
|
-
},
|
|
97
|
+
}, phase0.Fork, ExecutionOptimisticAndFinalizedMeta>;
|
|
82
98
|
/**
|
|
83
99
|
* Fetch the RANDAO mix for the requested epoch from the state identified by 'stateId'.
|
|
84
|
-
*
|
|
85
|
-
* @param stateId State identifier.
|
|
86
|
-
* Can be one of: "head" (canonical head in node's view), "genesis", "finalized", "justified", \<slot\>, \<hex encoded stateRoot with 0x prefix\>.
|
|
87
|
-
* @param epoch Fetch randao mix for the given epoch. If an epoch is not specified then the RANDAO mix for the state's current epoch will be returned.
|
|
88
100
|
*/
|
|
89
|
-
getStateRandao
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
101
|
+
getStateRandao: Endpoint<"GET", StateArgs & {
|
|
102
|
+
/**
|
|
103
|
+
* Fetch randao mix for the given epoch. If an epoch is not specified
|
|
104
|
+
* then the RANDAO mix for the state's current epoch will be returned.
|
|
105
|
+
*/
|
|
106
|
+
epoch?: Epoch;
|
|
107
|
+
}, {
|
|
108
|
+
params: {
|
|
109
|
+
state_id: string;
|
|
96
110
|
};
|
|
97
|
-
|
|
111
|
+
query: {
|
|
112
|
+
epoch?: number;
|
|
113
|
+
};
|
|
114
|
+
}, RandaoResponse, ExecutionOptimisticAndFinalizedMeta>;
|
|
98
115
|
/**
|
|
99
116
|
* Get state finality checkpoints
|
|
100
117
|
* Returns finality checkpoints for state with given 'stateId'.
|
|
101
118
|
* In case finality is not yet achieved, checkpoint should return epoch 0 and ZERO_HASH as root.
|
|
102
|
-
* @param stateId State identifier.
|
|
103
|
-
* Can be one of: "head" (canonical head in node's view), "genesis", "finalized", "justified", \<slot\>, \<hex encoded stateRoot with 0x prefix\>.
|
|
104
119
|
*/
|
|
105
|
-
getStateFinalityCheckpoints
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
executionOptimistic: ExecutionOptimistic;
|
|
109
|
-
finalized: Finalized;
|
|
120
|
+
getStateFinalityCheckpoints: Endpoint<"GET", StateArgs, {
|
|
121
|
+
params: {
|
|
122
|
+
state_id: string;
|
|
110
123
|
};
|
|
111
|
-
},
|
|
124
|
+
}, FinalityCheckpoints, ExecutionOptimisticAndFinalizedMeta>;
|
|
112
125
|
/**
|
|
113
|
-
* Get
|
|
114
|
-
* Returns
|
|
115
|
-
* @param stateId State identifier.
|
|
116
|
-
* Can be one of: "head" (canonical head in node's view), "genesis", "finalized", "justified", \<slot\>, \<hex encoded stateRoot with 0x prefix\>.
|
|
117
|
-
* @param id Either hex encoded public key (with 0x prefix) or validator index
|
|
118
|
-
* @param status [Validator status specification](https://hackmd.io/ofFJ5gOmQpu1jjHilHbdQQ)
|
|
126
|
+
* Get validator from state by id
|
|
127
|
+
* Returns validator specified by state and id or public key along with status and balance.
|
|
119
128
|
*/
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
129
|
+
getStateValidator: Endpoint<"GET", StateArgs & {
|
|
130
|
+
/** Either hex encoded public key (with 0x prefix) or validator index */
|
|
131
|
+
validatorId: ValidatorId;
|
|
132
|
+
}, {
|
|
133
|
+
params: {
|
|
134
|
+
state_id: string;
|
|
135
|
+
validator_id: ValidatorId;
|
|
125
136
|
};
|
|
126
|
-
},
|
|
137
|
+
}, ValidatorResponse, ExecutionOptimisticAndFinalizedMeta>;
|
|
127
138
|
/**
|
|
128
139
|
* Get validators from state
|
|
129
140
|
* Returns filterable list of validators with their balance, status and index.
|
|
130
|
-
* @param stateId State identifier.
|
|
131
|
-
* Can be one of: "head" (canonical head in node's view), "genesis", "finalized", "justified", \<slot\>, \<hex encoded stateRoot with 0x prefix\>.
|
|
132
|
-
* @param id Either hex encoded public key (with 0x prefix) or validator index
|
|
133
|
-
* @param status [Validator status specification](https://hackmd.io/ofFJ5gOmQpu1jjHilHbdQQ)
|
|
134
141
|
*/
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
142
|
+
getStateValidators: Endpoint<"GET", StateArgs & {
|
|
143
|
+
/** Either hex encoded public key (with 0x prefix) or validator index */
|
|
144
|
+
validatorIds?: ValidatorId[];
|
|
145
|
+
/** [Validator status specification](https://hackmd.io/ofFJ5gOmQpu1jjHilHbdQQ) */
|
|
146
|
+
statuses?: ValidatorStatus[];
|
|
147
|
+
}, {
|
|
148
|
+
params: {
|
|
149
|
+
state_id: string;
|
|
140
150
|
};
|
|
141
|
-
|
|
151
|
+
query: {
|
|
152
|
+
id?: ValidatorId[];
|
|
153
|
+
status?: ValidatorStatus[];
|
|
154
|
+
};
|
|
155
|
+
}, ValidatorResponseList, ExecutionOptimisticAndFinalizedMeta>;
|
|
142
156
|
/**
|
|
143
|
-
* Get
|
|
144
|
-
* Returns
|
|
145
|
-
* @param stateId State identifier.
|
|
146
|
-
* Can be one of: "head" (canonical head in node's view), "genesis", "finalized", "justified", \<slot\>, \<hex encoded stateRoot with 0x prefix\>.
|
|
147
|
-
* @param validatorId Either hex encoded public key (with 0x prefix) or validator index
|
|
157
|
+
* Get validators from state
|
|
158
|
+
* Returns filterable list of validators with their balance, status and index.
|
|
148
159
|
*/
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
160
|
+
postStateValidators: Endpoint<"POST", StateArgs & {
|
|
161
|
+
/** Either hex encoded public key (with 0x prefix) or validator index */
|
|
162
|
+
validatorIds?: ValidatorId[];
|
|
163
|
+
/** [Validator status specification](https://hackmd.io/ofFJ5gOmQpu1jjHilHbdQQ) */
|
|
164
|
+
statuses?: ValidatorStatus[];
|
|
165
|
+
}, {
|
|
166
|
+
params: {
|
|
167
|
+
state_id: string;
|
|
168
|
+
};
|
|
169
|
+
body: {
|
|
170
|
+
ids?: string[];
|
|
171
|
+
statuses?: ValidatorStatus[];
|
|
154
172
|
};
|
|
155
|
-
},
|
|
173
|
+
}, ValidatorResponseList, ExecutionOptimisticAndFinalizedMeta>;
|
|
156
174
|
/**
|
|
157
175
|
* Get validator balances from state
|
|
158
176
|
* Returns filterable list of validator balances.
|
|
159
|
-
* @param stateId State identifier.
|
|
160
|
-
* Can be one of: "head" (canonical head in node's view), "genesis", "finalized", "justified", \<slot\>, \<hex encoded stateRoot with 0x prefix\>.
|
|
161
|
-
* @param id Either hex encoded public key (with 0x prefix) or validator index
|
|
162
177
|
*/
|
|
163
|
-
getStateValidatorBalances
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
178
|
+
getStateValidatorBalances: Endpoint<"GET", StateArgs & {
|
|
179
|
+
/** Either hex encoded public key (with 0x prefix) or validator index */
|
|
180
|
+
validatorIds?: ValidatorId[];
|
|
181
|
+
}, {
|
|
182
|
+
params: {
|
|
183
|
+
state_id: string;
|
|
168
184
|
};
|
|
169
|
-
|
|
185
|
+
query: {
|
|
186
|
+
id?: ValidatorId[];
|
|
187
|
+
};
|
|
188
|
+
}, ValidatorBalanceList, ExecutionOptimisticAndFinalizedMeta>;
|
|
170
189
|
/**
|
|
171
190
|
* Get validator balances from state
|
|
172
191
|
* Returns filterable list of validator balances.
|
|
173
|
-
* @param stateId State identifier.
|
|
174
|
-
* Can be one of: "head" (canonical head in node's view), "genesis", "finalized", "justified", \<slot\>, \<hex encoded stateRoot with 0x prefix\>.
|
|
175
|
-
* @param id Either hex encoded public key (with 0x prefix) or validator index
|
|
176
192
|
*/
|
|
177
|
-
postStateValidatorBalances
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
193
|
+
postStateValidatorBalances: Endpoint<"POST", StateArgs & {
|
|
194
|
+
/** Either hex encoded public key (with 0x prefix) or validator index */
|
|
195
|
+
validatorIds?: ValidatorId[];
|
|
196
|
+
}, {
|
|
197
|
+
params: {
|
|
198
|
+
state_id: string;
|
|
182
199
|
};
|
|
183
|
-
|
|
200
|
+
body: string[];
|
|
201
|
+
}, ValidatorBalanceList, ExecutionOptimisticAndFinalizedMeta>;
|
|
184
202
|
/**
|
|
185
203
|
* Get all committees for a state.
|
|
186
204
|
* Retrieves the committees for the given state.
|
|
187
|
-
* @param stateId State identifier.
|
|
188
|
-
* Can be one of: "head" (canonical head in node's view), "genesis", "finalized", "justified", \<slot\>, \<hex encoded stateRoot with 0x prefix\>.
|
|
189
|
-
* @param epoch Fetch committees for the given epoch. If not present then the committees for the epoch of the state will be obtained.
|
|
190
|
-
* @param index Restrict returned values to those matching the supplied committee index.
|
|
191
|
-
* @param slot Restrict returned values to those matching the supplied slot.
|
|
192
205
|
*/
|
|
193
|
-
getEpochCommittees
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
[HttpStatusCode.OK]: {
|
|
202
|
-
data: EpochSyncCommitteeResponse;
|
|
203
|
-
executionOptimistic: ExecutionOptimistic;
|
|
204
|
-
finalized: Finalized;
|
|
205
|
-
};
|
|
206
|
-
}, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>;
|
|
207
|
-
};
|
|
208
|
-
/**
|
|
209
|
-
* Define javascript values for each route
|
|
210
|
-
*/
|
|
211
|
-
export declare const routesData: RoutesData<Api>;
|
|
212
|
-
type StateIdOnlyReq = {
|
|
213
|
-
params: {
|
|
214
|
-
state_id: string;
|
|
215
|
-
};
|
|
216
|
-
};
|
|
217
|
-
export type ReqTypes = {
|
|
218
|
-
getEpochCommittees: {
|
|
206
|
+
getEpochCommittees: Endpoint<"GET", StateArgs & {
|
|
207
|
+
/** Fetch committees for the given epoch. If not present then the committees for the epoch of the state will be obtained. */
|
|
208
|
+
epoch?: Epoch;
|
|
209
|
+
/** Restrict returned values to those matching the supplied committee index. */
|
|
210
|
+
index?: CommitteeIndex;
|
|
211
|
+
/** Restrict returned values to those matching the supplied slot. */
|
|
212
|
+
slot?: Slot;
|
|
213
|
+
}, {
|
|
219
214
|
params: {
|
|
220
|
-
state_id:
|
|
215
|
+
state_id: string;
|
|
221
216
|
};
|
|
222
217
|
query: {
|
|
223
218
|
slot?: number;
|
|
224
219
|
epoch?: number;
|
|
225
220
|
index?: number;
|
|
226
221
|
};
|
|
227
|
-
}
|
|
228
|
-
getEpochSyncCommittees: {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
};
|
|
232
|
-
query: {
|
|
233
|
-
epoch?: number;
|
|
234
|
-
};
|
|
235
|
-
};
|
|
236
|
-
getStateFinalityCheckpoints: StateIdOnlyReq;
|
|
237
|
-
getStateFork: StateIdOnlyReq;
|
|
238
|
-
getStateRoot: StateIdOnlyReq;
|
|
239
|
-
getStateRandao: {
|
|
222
|
+
}, EpochCommitteeResponseList, ExecutionOptimisticAndFinalizedMeta>;
|
|
223
|
+
getEpochSyncCommittees: Endpoint<"GET", StateArgs & {
|
|
224
|
+
epoch?: Epoch;
|
|
225
|
+
}, {
|
|
240
226
|
params: {
|
|
241
|
-
state_id:
|
|
227
|
+
state_id: string;
|
|
242
228
|
};
|
|
243
229
|
query: {
|
|
244
230
|
epoch?: number;
|
|
245
231
|
};
|
|
246
|
-
}
|
|
247
|
-
getStateValidator: {
|
|
248
|
-
params: {
|
|
249
|
-
state_id: StateId;
|
|
250
|
-
validator_id: ValidatorId;
|
|
251
|
-
};
|
|
252
|
-
};
|
|
253
|
-
getStateValidators: {
|
|
254
|
-
params: {
|
|
255
|
-
state_id: StateId;
|
|
256
|
-
};
|
|
257
|
-
query: {
|
|
258
|
-
id?: ValidatorId[];
|
|
259
|
-
status?: ValidatorStatus[];
|
|
260
|
-
};
|
|
261
|
-
};
|
|
262
|
-
postStateValidators: {
|
|
263
|
-
params: {
|
|
264
|
-
state_id: StateId;
|
|
265
|
-
};
|
|
266
|
-
body: {
|
|
267
|
-
ids?: string[];
|
|
268
|
-
statuses?: ValidatorStatus[];
|
|
269
|
-
};
|
|
270
|
-
};
|
|
271
|
-
getStateValidatorBalances: {
|
|
272
|
-
params: {
|
|
273
|
-
state_id: StateId;
|
|
274
|
-
};
|
|
275
|
-
query: {
|
|
276
|
-
id?: ValidatorId[];
|
|
277
|
-
};
|
|
278
|
-
};
|
|
279
|
-
postStateValidatorBalances: {
|
|
280
|
-
params: {
|
|
281
|
-
state_id: StateId;
|
|
282
|
-
};
|
|
283
|
-
body?: string[];
|
|
284
|
-
};
|
|
232
|
+
}, EpochSyncCommitteeResponse, ExecutionOptimisticAndFinalizedMeta>;
|
|
285
233
|
};
|
|
286
|
-
export declare function
|
|
287
|
-
export declare function getReturnTypes(): ReturnTypes<Api>;
|
|
288
|
-
export {};
|
|
234
|
+
export declare function getDefinitions(_config: ChainForkConfig): RouteDefinitions<Endpoints>;
|
|
289
235
|
//# sourceMappingURL=state.d.ts.map
|