@lodestar/api 1.18.0-dev.6fe93c1557 → 1.18.0-dev.79d39f73a2
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/lib/beacon/routes/beacon/block.d.ts +11 -1
- package/lib/beacon/routes/beacon/block.js +14 -7
- package/lib/beacon/routes/beacon/block.js.map +1 -1
- package/lib/beacon/routes/beacon/index.d.ts +71 -16
- package/lib/beacon/routes/beacon/index.js.map +1 -1
- package/lib/beacon/routes/beacon/rewards.d.ts +60 -1
- package/lib/beacon/routes/beacon/rewards.js +33 -3
- package/lib/beacon/routes/beacon/rewards.js.map +1 -1
- package/lib/beacon/routes/beacon/state.d.ts +57 -0
- package/lib/beacon/routes/beacon/state.js +49 -10
- package/lib/beacon/routes/beacon/state.js.map +1 -1
- package/lib/beacon/routes/debug.d.ts +6 -1
- package/lib/beacon/routes/debug.js +5 -4
- package/lib/beacon/routes/debug.js.map +1 -1
- package/lib/beacon/routes/validator.d.ts +2 -1
- package/lib/beacon/routes/validator.js +7 -3
- package/lib/beacon/routes/validator.js.map +1 -1
- package/lib/beacon/server/debug.js +1 -1
- package/lib/beacon/server/debug.js.map +1 -1
- package/lib/utils/client/httpClient.js +1 -1
- package/lib/utils/client/httpClient.js.map +1 -1
- package/lib/utils/types.d.ts +8 -0
- package/lib/utils/types.js +15 -0
- package/lib/utils/types.js.map +1 -1
- package/package.json +9 -9
|
@@ -10,6 +10,10 @@ export type BlockId = RootHex | Slot | "head" | "genesis" | "finalized";
|
|
|
10
10
|
* a later time. If the field is not present, assume the False value.
|
|
11
11
|
*/
|
|
12
12
|
export type ExecutionOptimistic = boolean;
|
|
13
|
+
/**
|
|
14
|
+
* True if the response references the finalized history of the chain, as determined by fork choice.
|
|
15
|
+
*/
|
|
16
|
+
export type Finalized = boolean;
|
|
13
17
|
export type BlockHeaderResponse = {
|
|
14
18
|
root: Root;
|
|
15
19
|
canonical: boolean;
|
|
@@ -34,6 +38,7 @@ export type BlockV2Response<T extends ResponseFormat = "json"> = T extends "ssz"
|
|
|
34
38
|
[HttpStatusCode.OK]: {
|
|
35
39
|
data: allForks.SignedBeaconBlock;
|
|
36
40
|
executionOptimistic: ExecutionOptimistic;
|
|
41
|
+
finalized: Finalized;
|
|
37
42
|
version: ForkName;
|
|
38
43
|
};
|
|
39
44
|
}, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>;
|
|
@@ -64,6 +69,7 @@ export type Api = {
|
|
|
64
69
|
[HttpStatusCode.OK]: {
|
|
65
70
|
data: phase0.Attestation[];
|
|
66
71
|
executionOptimistic: ExecutionOptimistic;
|
|
72
|
+
finalized: Finalized;
|
|
67
73
|
};
|
|
68
74
|
}, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>;
|
|
69
75
|
/**
|
|
@@ -76,6 +82,7 @@ export type Api = {
|
|
|
76
82
|
[HttpStatusCode.OK]: {
|
|
77
83
|
data: BlockHeaderResponse;
|
|
78
84
|
executionOptimistic: ExecutionOptimistic;
|
|
85
|
+
finalized: Finalized;
|
|
79
86
|
};
|
|
80
87
|
}, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>;
|
|
81
88
|
/**
|
|
@@ -91,6 +98,7 @@ export type Api = {
|
|
|
91
98
|
[HttpStatusCode.OK]: {
|
|
92
99
|
data: BlockHeaderResponse[];
|
|
93
100
|
executionOptimistic: ExecutionOptimistic;
|
|
101
|
+
finalized: Finalized;
|
|
94
102
|
};
|
|
95
103
|
}, HttpStatusCode.BAD_REQUEST>>;
|
|
96
104
|
/**
|
|
@@ -105,6 +113,7 @@ export type Api = {
|
|
|
105
113
|
root: Root;
|
|
106
114
|
};
|
|
107
115
|
executionOptimistic: ExecutionOptimistic;
|
|
116
|
+
finalized: Finalized;
|
|
108
117
|
};
|
|
109
118
|
}, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>;
|
|
110
119
|
/**
|
|
@@ -152,8 +161,9 @@ export type Api = {
|
|
|
152
161
|
*/
|
|
153
162
|
getBlobSidecars(blockId: BlockId, indices?: number[]): Promise<ApiClientResponse<{
|
|
154
163
|
[HttpStatusCode.OK]: {
|
|
155
|
-
executionOptimistic: ExecutionOptimistic;
|
|
156
164
|
data: deneb.BlobSidecars;
|
|
165
|
+
executionOptimistic: ExecutionOptimistic;
|
|
166
|
+
finalized: Finalized;
|
|
157
167
|
};
|
|
158
168
|
}>>;
|
|
159
169
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ContainerType } from "@chainsafe/ssz";
|
|
2
2
|
import { ssz, isSignedBlockContents } from "@lodestar/types";
|
|
3
|
-
import { ArrayOf, Schema, WithVersion, reqOnlyBody, ContainerDataExecutionOptimistic, WithExecutionOptimistic, ContainerData, } from "../../../utils/index.js";
|
|
3
|
+
import { ArrayOf, Schema, WithVersion, reqOnlyBody, ContainerDataExecutionOptimistic, WithExecutionOptimistic, ContainerData, WithFinalized, } from "../../../utils/index.js";
|
|
4
4
|
import { HttpStatusCode } from "../../../utils/client/httpStatusCode.js";
|
|
5
5
|
import { parseAcceptHeader, writeAcceptHeader } from "../../../utils/acceptHeader.js";
|
|
6
6
|
import { allForksSignedBlockContentsReqSerializer } from "../../../utils/routes.js";
|
|
@@ -63,6 +63,11 @@ export function getReqSerializers(config) {
|
|
|
63
63
|
toJson: (data) => getSignedBlindedBeaconBlockType(data).toJson(data),
|
|
64
64
|
fromJson: (data) => getSignedBlindedBeaconBlockType(data).fromJson(data),
|
|
65
65
|
};
|
|
66
|
+
function extractSlot(signedBlockOrContents) {
|
|
67
|
+
return isSignedBlockContents(signedBlockOrContents)
|
|
68
|
+
? signedBlockOrContents.signedBlock.message.slot
|
|
69
|
+
: signedBlockOrContents.message.slot;
|
|
70
|
+
}
|
|
66
71
|
return {
|
|
67
72
|
getBlock: getBlockReq,
|
|
68
73
|
getBlockV2: getBlockReq,
|
|
@@ -79,6 +84,7 @@ export function getReqSerializers(config) {
|
|
|
79
84
|
writeReq: (item, { broadcastValidation } = {}) => ({
|
|
80
85
|
body: AllForksSignedBlockOrContents.toJson(item),
|
|
81
86
|
query: { broadcast_validation: broadcastValidation },
|
|
87
|
+
headers: { "Eth-Consensus-Version": config.getForkName(extractSlot(item)) },
|
|
82
88
|
}),
|
|
83
89
|
parseReq: ({ body, query }) => [
|
|
84
90
|
AllForksSignedBlockOrContents.fromJson(body),
|
|
@@ -94,6 +100,7 @@ export function getReqSerializers(config) {
|
|
|
94
100
|
writeReq: (item, { broadcastValidation }) => ({
|
|
95
101
|
body: AllForksSignedBlindedBlock.toJson(item),
|
|
96
102
|
query: { broadcast_validation: broadcastValidation },
|
|
103
|
+
headers: { "Eth-Consensus-Version": config.getForkName(item.message.slot) },
|
|
97
104
|
}),
|
|
98
105
|
parseReq: ({ body, query }) => [
|
|
99
106
|
AllForksSignedBlindedBlock.fromJson(body),
|
|
@@ -128,12 +135,12 @@ export function getReturnTypes() {
|
|
|
128
135
|
});
|
|
129
136
|
return {
|
|
130
137
|
getBlock: ContainerData(ssz.phase0.SignedBeaconBlock),
|
|
131
|
-
getBlockV2: WithExecutionOptimistic(WithVersion((fork) => ssz[fork].SignedBeaconBlock)),
|
|
132
|
-
getBlockAttestations: ContainerDataExecutionOptimistic(ArrayOf(ssz.phase0.Attestation)),
|
|
133
|
-
getBlockHeader: ContainerDataExecutionOptimistic(BeaconHeaderResType),
|
|
134
|
-
getBlockHeaders: ContainerDataExecutionOptimistic(ArrayOf(BeaconHeaderResType)),
|
|
135
|
-
getBlockRoot: ContainerDataExecutionOptimistic(RootContainer),
|
|
136
|
-
getBlobSidecars: ContainerDataExecutionOptimistic(ssz.deneb.BlobSidecars),
|
|
138
|
+
getBlockV2: WithFinalized(WithExecutionOptimistic(WithVersion((fork) => ssz[fork].SignedBeaconBlock))),
|
|
139
|
+
getBlockAttestations: WithFinalized(ContainerDataExecutionOptimistic(ArrayOf(ssz.phase0.Attestation))),
|
|
140
|
+
getBlockHeader: WithFinalized(ContainerDataExecutionOptimistic(BeaconHeaderResType)),
|
|
141
|
+
getBlockHeaders: WithFinalized(ContainerDataExecutionOptimistic(ArrayOf(BeaconHeaderResType))),
|
|
142
|
+
getBlockRoot: WithFinalized(ContainerDataExecutionOptimistic(RootContainer)),
|
|
143
|
+
getBlobSidecars: WithFinalized(ContainerDataExecutionOptimistic(ssz.deneb.BlobSidecars)),
|
|
137
144
|
};
|
|
138
145
|
}
|
|
139
146
|
//# sourceMappingURL=block.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block.js","sourceRoot":"","sources":["../../../../src/beacon/routes/beacon/block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAG7C,OAAO,EAA+B,GAAG,EAAkB,qBAAqB,EAAC,MAAM,iBAAiB,CAAC;AAEzG,OAAO,EAGL,OAAO,EACP,MAAM,EACN,WAAW,EACX,WAAW,EAIX,gCAAgC,EAChC,uBAAuB,EACvB,aAAa,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,cAAc,EAAC,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAC,iBAAiB,EAAE,iBAAiB,EAAC,MAAM,gCAAgC,CAAC;AAEpF,OAAO,EAAC,wCAAwC,EAAC,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"block.js","sourceRoot":"","sources":["../../../../src/beacon/routes/beacon/block.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAG7C,OAAO,EAA+B,GAAG,EAAkB,qBAAqB,EAAC,MAAM,iBAAiB,CAAC;AAEzG,OAAO,EAGL,OAAO,EACP,MAAM,EACN,WAAW,EACX,WAAW,EAIX,gCAAgC,EAChC,uBAAuB,EACvB,aAAa,EACb,aAAa,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,cAAc,EAAC,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAAC,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CAAC,IAAI;KACf,CAAC,CAAC;IAEH,OAAO;QACL,QAAQ,EAAE,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,iBAAiB,CAAC;QACrD,UAAU,EAAE,aAAa,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAC;QACtG,oBAAoB,EAAE,aAAa,CAAC,gCAAgC,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;QACtG,cAAc,EAAE,aAAa,CAAC,gCAAgC,CAAC,mBAAmB,CAAC,CAAC;QACpF,eAAe,EAAE,aAAa,CAAC,gCAAgC,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC,CAAC;QAC9F,YAAY,EAAE,aAAa,CAAC,gCAAgC,CAAC,aAAa,CAAC,CAAC;QAC5E,eAAe,EAAE,aAAa,CAAC,gCAAgC,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;KACzF,CAAC;AACJ,CAAC"}
|
|
@@ -14,7 +14,7 @@ export * as rewards from "./rewards.js";
|
|
|
14
14
|
export { BroadcastValidation } from "./block.js";
|
|
15
15
|
export type { BlockId, BlockHeaderResponse } from "./block.js";
|
|
16
16
|
export type { AttestationFilters } from "./pool.js";
|
|
17
|
-
export type { BlockRewards, SyncCommitteeRewards } from "./rewards.js";
|
|
17
|
+
export type { BlockRewards, AttestationsRewards, IdealAttestationsReward, TotalAttestationsReward, SyncCommitteeRewards, } from "./rewards.js";
|
|
18
18
|
export type { StateId, ValidatorId, ValidatorStatus, ValidatorFilters, CommitteesFilters, FinalityCheckpoints, ValidatorResponse, ValidatorBalance, EpochCommitteeResponse, EpochSyncCommitteeResponse, } from "./state.js";
|
|
19
19
|
export type Api = block.Api & pool.Api & state.Api & rewards.Api & {
|
|
20
20
|
getGenesis(): Promise<ApiClientResponse<{
|
|
@@ -32,16 +32,30 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
32
32
|
200: {
|
|
33
33
|
data: rewards.BlockRewards;
|
|
34
34
|
executionOptimistic: boolean;
|
|
35
|
+
finalized: boolean;
|
|
35
36
|
};
|
|
36
37
|
}, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>, {
|
|
37
38
|
params: {
|
|
38
39
|
block_id: string;
|
|
39
40
|
};
|
|
40
41
|
}>;
|
|
42
|
+
getAttestationsRewards: import("../../../utils/types.js").ReqSerializer<(epoch: number, validatorIds?: state.ValidatorId[] | undefined) => Promise<ApiClientResponse<{
|
|
43
|
+
200: {
|
|
44
|
+
data: rewards.AttestationsRewards;
|
|
45
|
+
executionOptimistic: boolean;
|
|
46
|
+
finalized: boolean;
|
|
47
|
+
};
|
|
48
|
+
}, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>, {
|
|
49
|
+
params: {
|
|
50
|
+
epoch: number;
|
|
51
|
+
};
|
|
52
|
+
body: state.ValidatorId[];
|
|
53
|
+
}>;
|
|
41
54
|
getSyncCommitteeRewards: import("../../../utils/types.js").ReqSerializer<(blockId: block.BlockId, validatorIds?: state.ValidatorId[] | undefined) => Promise<ApiClientResponse<{
|
|
42
55
|
200: {
|
|
43
56
|
data: rewards.SyncCommitteeRewards;
|
|
44
57
|
executionOptimistic: boolean;
|
|
58
|
+
finalized: boolean;
|
|
45
59
|
};
|
|
46
60
|
}, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>, {
|
|
47
61
|
params: {
|
|
@@ -55,6 +69,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
55
69
|
root: Uint8Array;
|
|
56
70
|
};
|
|
57
71
|
executionOptimistic: boolean;
|
|
72
|
+
finalized: boolean;
|
|
58
73
|
};
|
|
59
74
|
}, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>, {
|
|
60
75
|
params: {
|
|
@@ -63,12 +78,13 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
63
78
|
}>;
|
|
64
79
|
getStateFork: import("../../../utils/types.js").ReqSerializer<(stateId: state.StateId) => Promise<ApiClientResponse<{
|
|
65
80
|
200: {
|
|
66
|
-
data: import("@chainsafe/ssz
|
|
81
|
+
data: import("@chainsafe/ssz").ValueOfFields<{
|
|
67
82
|
previousVersion: import("@chainsafe/ssz").ByteVectorType;
|
|
68
83
|
currentVersion: import("@chainsafe/ssz").ByteVectorType;
|
|
69
84
|
epoch: import("@chainsafe/ssz").UintNumberType;
|
|
70
85
|
}>;
|
|
71
86
|
executionOptimistic: boolean;
|
|
87
|
+
finalized: boolean;
|
|
72
88
|
};
|
|
73
89
|
}, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>, {
|
|
74
90
|
params: {
|
|
@@ -81,6 +97,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
81
97
|
randao: Uint8Array;
|
|
82
98
|
};
|
|
83
99
|
executionOptimistic: boolean;
|
|
100
|
+
finalized: boolean;
|
|
84
101
|
};
|
|
85
102
|
}, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>, {
|
|
86
103
|
params: {
|
|
@@ -94,6 +111,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
94
111
|
200: {
|
|
95
112
|
data: state.FinalityCheckpoints;
|
|
96
113
|
executionOptimistic: boolean;
|
|
114
|
+
finalized: boolean;
|
|
97
115
|
};
|
|
98
116
|
}, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>, {
|
|
99
117
|
params: {
|
|
@@ -104,6 +122,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
104
122
|
200: {
|
|
105
123
|
data: state.ValidatorResponse[];
|
|
106
124
|
executionOptimistic: boolean;
|
|
125
|
+
finalized: boolean;
|
|
107
126
|
};
|
|
108
127
|
}, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>, {
|
|
109
128
|
params: {
|
|
@@ -114,10 +133,26 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
114
133
|
status?: state.ValidatorStatus[] | undefined;
|
|
115
134
|
};
|
|
116
135
|
}>;
|
|
136
|
+
postStateValidators: import("../../../utils/types.js").ReqSerializer<(stateId: state.StateId, filters?: state.ValidatorFilters | undefined) => Promise<ApiClientResponse<{
|
|
137
|
+
200: {
|
|
138
|
+
data: state.ValidatorResponse[];
|
|
139
|
+
executionOptimistic: boolean;
|
|
140
|
+
finalized: boolean;
|
|
141
|
+
};
|
|
142
|
+
}, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>, {
|
|
143
|
+
params: {
|
|
144
|
+
state_id: state.StateId;
|
|
145
|
+
};
|
|
146
|
+
body: {
|
|
147
|
+
ids?: string[] | undefined;
|
|
148
|
+
statuses?: state.ValidatorStatus[] | undefined;
|
|
149
|
+
};
|
|
150
|
+
}>;
|
|
117
151
|
getStateValidator: import("../../../utils/types.js").ReqSerializer<(stateId: state.StateId, validatorId: state.ValidatorId) => Promise<ApiClientResponse<{
|
|
118
152
|
200: {
|
|
119
153
|
data: state.ValidatorResponse;
|
|
120
154
|
executionOptimistic: boolean;
|
|
155
|
+
finalized: boolean;
|
|
121
156
|
};
|
|
122
157
|
}, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>, {
|
|
123
158
|
params: {
|
|
@@ -129,6 +164,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
129
164
|
200: {
|
|
130
165
|
data: state.ValidatorBalance[];
|
|
131
166
|
executionOptimistic: boolean;
|
|
167
|
+
finalized: boolean;
|
|
132
168
|
};
|
|
133
169
|
}, HttpStatusCode.BAD_REQUEST>>, {
|
|
134
170
|
params: {
|
|
@@ -138,10 +174,23 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
138
174
|
id?: state.ValidatorId[] | undefined;
|
|
139
175
|
};
|
|
140
176
|
}>;
|
|
177
|
+
postStateValidatorBalances: import("../../../utils/types.js").ReqSerializer<(stateId: state.StateId, indices?: state.ValidatorId[] | undefined) => Promise<ApiClientResponse<{
|
|
178
|
+
200: {
|
|
179
|
+
data: state.ValidatorBalance[];
|
|
180
|
+
executionOptimistic: boolean;
|
|
181
|
+
finalized: boolean;
|
|
182
|
+
};
|
|
183
|
+
}, HttpStatusCode.BAD_REQUEST>>, {
|
|
184
|
+
params: {
|
|
185
|
+
state_id: state.StateId;
|
|
186
|
+
};
|
|
187
|
+
body?: string[] | undefined;
|
|
188
|
+
}>;
|
|
141
189
|
getEpochCommittees: import("../../../utils/types.js").ReqSerializer<(stateId: state.StateId, filters?: state.CommitteesFilters | undefined) => Promise<ApiClientResponse<{
|
|
142
190
|
200: {
|
|
143
191
|
data: state.EpochCommitteeResponse[];
|
|
144
192
|
executionOptimistic: boolean;
|
|
193
|
+
finalized: boolean;
|
|
145
194
|
};
|
|
146
195
|
}, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>, {
|
|
147
196
|
params: {
|
|
@@ -157,6 +206,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
157
206
|
200: {
|
|
158
207
|
data: state.EpochSyncCommitteeResponse;
|
|
159
208
|
executionOptimistic: boolean;
|
|
209
|
+
finalized: boolean;
|
|
160
210
|
};
|
|
161
211
|
}, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>, {
|
|
162
212
|
params: {
|
|
@@ -168,7 +218,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
168
218
|
}>;
|
|
169
219
|
getPoolAttestations: import("../../../utils/types.js").ReqSerializer<(filters?: Partial<pool.AttestationFilters> | undefined) => Promise<ApiClientResponse<{
|
|
170
220
|
200: {
|
|
171
|
-
data: import("@chainsafe/ssz
|
|
221
|
+
data: import("@chainsafe/ssz").ValueOfFields<{
|
|
172
222
|
aggregationBits: import("@chainsafe/ssz").BitListType;
|
|
173
223
|
data: import("@chainsafe/ssz").ContainerType<{
|
|
174
224
|
slot: import("@chainsafe/ssz").UintNumberType;
|
|
@@ -194,7 +244,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
194
244
|
}>;
|
|
195
245
|
getPoolAttesterSlashings: import("../../../utils/types.js").ReqSerializer<() => Promise<ApiClientResponse<{
|
|
196
246
|
200: {
|
|
197
|
-
data: import("@chainsafe/ssz
|
|
247
|
+
data: import("@chainsafe/ssz").ValueOfFields<{
|
|
198
248
|
attestation1: import("@chainsafe/ssz").ContainerType<{
|
|
199
249
|
attestingIndices: import("@chainsafe/ssz").ListBasicType<import("@chainsafe/ssz").UintNumberType>;
|
|
200
250
|
data: import("@chainsafe/ssz").ContainerType<{
|
|
@@ -234,7 +284,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
234
284
|
}>>, import("../../../utils/types.js").ReqGeneric>;
|
|
235
285
|
getPoolProposerSlashings: import("../../../utils/types.js").ReqSerializer<() => Promise<ApiClientResponse<{
|
|
236
286
|
200: {
|
|
237
|
-
data: import("@chainsafe/ssz
|
|
287
|
+
data: import("@chainsafe/ssz").ValueOfFields<{
|
|
238
288
|
signedHeader1: import("@chainsafe/ssz").ContainerType<{
|
|
239
289
|
message: import("@chainsafe/ssz").ContainerType<{
|
|
240
290
|
slot: import("@chainsafe/ssz").UintBigintType;
|
|
@@ -260,7 +310,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
260
310
|
}>>, import("../../../utils/types.js").ReqGeneric>;
|
|
261
311
|
getPoolVoluntaryExits: import("../../../utils/types.js").ReqSerializer<() => Promise<ApiClientResponse<{
|
|
262
312
|
200: {
|
|
263
|
-
data: import("@chainsafe/ssz
|
|
313
|
+
data: import("@chainsafe/ssz").ValueOfFields<{
|
|
264
314
|
message: import("@chainsafe/ssz").ContainerType<{
|
|
265
315
|
epoch: import("@chainsafe/ssz").UintNumberType;
|
|
266
316
|
validatorIndex: import("@chainsafe/ssz").UintNumberType;
|
|
@@ -271,7 +321,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
271
321
|
}>>, import("../../../utils/types.js").ReqGeneric>;
|
|
272
322
|
getPoolBlsToExecutionChanges: import("../../../utils/types.js").ReqSerializer<() => Promise<ApiClientResponse<{
|
|
273
323
|
200: {
|
|
274
|
-
data: import("@chainsafe/ssz
|
|
324
|
+
data: import("@chainsafe/ssz").ValueOfFields<{
|
|
275
325
|
message: import("@chainsafe/ssz").ContainerType<{
|
|
276
326
|
validatorIndex: import("@chainsafe/ssz").UintNumberType;
|
|
277
327
|
fromBlsPubkey: import("@chainsafe/ssz").ByteVectorType;
|
|
@@ -281,7 +331,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
281
331
|
}>[];
|
|
282
332
|
};
|
|
283
333
|
}>>, import("../../../utils/types.js").ReqGeneric>;
|
|
284
|
-
submitPoolAttestations: import("../../../utils/types.js").ReqSerializer<(attestations: import("@chainsafe/ssz
|
|
334
|
+
submitPoolAttestations: import("../../../utils/types.js").ReqSerializer<(attestations: import("@chainsafe/ssz").ValueOfFields<{
|
|
285
335
|
aggregationBits: import("@chainsafe/ssz").BitListType;
|
|
286
336
|
data: import("@chainsafe/ssz").ContainerType<{
|
|
287
337
|
slot: import("@chainsafe/ssz").UintNumberType;
|
|
@@ -302,7 +352,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
302
352
|
}, HttpStatusCode.BAD_REQUEST>>, {
|
|
303
353
|
body: unknown;
|
|
304
354
|
}>;
|
|
305
|
-
submitPoolAttesterSlashings: import("../../../utils/types.js").ReqSerializer<(slashing: import("@chainsafe/ssz
|
|
355
|
+
submitPoolAttesterSlashings: import("../../../utils/types.js").ReqSerializer<(slashing: import("@chainsafe/ssz").ValueOfFields<{
|
|
306
356
|
attestation1: import("@chainsafe/ssz").ContainerType<{
|
|
307
357
|
attestingIndices: import("@chainsafe/ssz").ListBasicType<import("@chainsafe/ssz").UintNumberType>;
|
|
308
358
|
data: import("@chainsafe/ssz").ContainerType<{
|
|
@@ -342,7 +392,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
342
392
|
}, HttpStatusCode.BAD_REQUEST>>, {
|
|
343
393
|
body: unknown;
|
|
344
394
|
}>;
|
|
345
|
-
submitPoolProposerSlashings: import("../../../utils/types.js").ReqSerializer<(slashing: import("@chainsafe/ssz
|
|
395
|
+
submitPoolProposerSlashings: import("../../../utils/types.js").ReqSerializer<(slashing: import("@chainsafe/ssz").ValueOfFields<{
|
|
346
396
|
signedHeader1: import("@chainsafe/ssz").ContainerType<{
|
|
347
397
|
message: import("@chainsafe/ssz").ContainerType<{
|
|
348
398
|
slot: import("@chainsafe/ssz").UintBigintType;
|
|
@@ -368,7 +418,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
368
418
|
}, HttpStatusCode.BAD_REQUEST>>, {
|
|
369
419
|
body: unknown;
|
|
370
420
|
}>;
|
|
371
|
-
submitPoolVoluntaryExit: import("../../../utils/types.js").ReqSerializer<(exit: import("@chainsafe/ssz
|
|
421
|
+
submitPoolVoluntaryExit: import("../../../utils/types.js").ReqSerializer<(exit: import("@chainsafe/ssz").ValueOfFields<{
|
|
372
422
|
message: import("@chainsafe/ssz").ContainerType<{
|
|
373
423
|
epoch: import("@chainsafe/ssz").UintNumberType;
|
|
374
424
|
validatorIndex: import("@chainsafe/ssz").UintNumberType;
|
|
@@ -379,7 +429,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
379
429
|
}, HttpStatusCode.BAD_REQUEST>>, {
|
|
380
430
|
body: unknown;
|
|
381
431
|
}>;
|
|
382
|
-
submitPoolBlsToExecutionChange: import("../../../utils/types.js").ReqSerializer<(blsToExecutionChange: import("@chainsafe/ssz
|
|
432
|
+
submitPoolBlsToExecutionChange: import("../../../utils/types.js").ReqSerializer<(blsToExecutionChange: import("@chainsafe/ssz").ValueOfFields<{
|
|
383
433
|
message: import("@chainsafe/ssz").ContainerType<{
|
|
384
434
|
validatorIndex: import("@chainsafe/ssz").UintNumberType;
|
|
385
435
|
fromBlsPubkey: import("@chainsafe/ssz").ByteVectorType;
|
|
@@ -391,7 +441,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
391
441
|
}, HttpStatusCode.BAD_REQUEST>>, {
|
|
392
442
|
body: unknown;
|
|
393
443
|
}>;
|
|
394
|
-
submitPoolSyncCommitteeSignatures: import("../../../utils/types.js").ReqSerializer<(signatures: import("@chainsafe/ssz
|
|
444
|
+
submitPoolSyncCommitteeSignatures: import("../../../utils/types.js").ReqSerializer<(signatures: import("@chainsafe/ssz").ValueOfFields<{
|
|
395
445
|
slot: import("@chainsafe/ssz").UintNumberType;
|
|
396
446
|
beaconBlockRoot: import("@chainsafe/ssz").ByteVectorType;
|
|
397
447
|
validatorIndex: import("@chainsafe/ssz").UintNumberType;
|
|
@@ -419,7 +469,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
419
469
|
}>;
|
|
420
470
|
getBlockAttestations: import("../../../utils/types.js").ReqSerializer<(blockId: block.BlockId) => Promise<ApiClientResponse<{
|
|
421
471
|
200: {
|
|
422
|
-
data: import("@chainsafe/ssz
|
|
472
|
+
data: import("@chainsafe/ssz").ValueOfFields<{
|
|
423
473
|
aggregationBits: import("@chainsafe/ssz").BitListType;
|
|
424
474
|
data: import("@chainsafe/ssz").ContainerType<{
|
|
425
475
|
slot: import("@chainsafe/ssz").UintNumberType;
|
|
@@ -437,6 +487,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
437
487
|
signature: import("@chainsafe/ssz").ByteVectorType;
|
|
438
488
|
}>[];
|
|
439
489
|
executionOptimistic: boolean;
|
|
490
|
+
finalized: boolean;
|
|
440
491
|
};
|
|
441
492
|
}, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>, {
|
|
442
493
|
params: {
|
|
@@ -447,6 +498,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
447
498
|
200: {
|
|
448
499
|
data: block.BlockHeaderResponse;
|
|
449
500
|
executionOptimistic: boolean;
|
|
501
|
+
finalized: boolean;
|
|
450
502
|
};
|
|
451
503
|
}, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>, {
|
|
452
504
|
params: {
|
|
@@ -460,6 +512,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
460
512
|
200: {
|
|
461
513
|
data: block.BlockHeaderResponse[];
|
|
462
514
|
executionOptimistic: boolean;
|
|
515
|
+
finalized: boolean;
|
|
463
516
|
};
|
|
464
517
|
}, HttpStatusCode.BAD_REQUEST>>, {
|
|
465
518
|
query: {
|
|
@@ -473,6 +526,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
473
526
|
root: Uint8Array;
|
|
474
527
|
};
|
|
475
528
|
executionOptimistic: boolean;
|
|
529
|
+
finalized: boolean;
|
|
476
530
|
};
|
|
477
531
|
}, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>, {
|
|
478
532
|
params: {
|
|
@@ -515,8 +569,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
515
569
|
}>;
|
|
516
570
|
getBlobSidecars: import("../../../utils/types.js").ReqSerializer<(blockId: block.BlockId, indices?: number[] | undefined) => Promise<ApiClientResponse<{
|
|
517
571
|
200: {
|
|
518
|
-
|
|
519
|
-
data: import("@chainsafe/ssz/lib/view/container.js").ValueOfFields<{
|
|
572
|
+
data: import("@chainsafe/ssz").ValueOfFields<{
|
|
520
573
|
index: import("@chainsafe/ssz").UintNumberType;
|
|
521
574
|
blob: import("@chainsafe/ssz").ByteVectorType;
|
|
522
575
|
kzgCommitment: import("@chainsafe/ssz").ByteVectorType;
|
|
@@ -533,6 +586,8 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
533
586
|
}>;
|
|
534
587
|
kzgCommitmentInclusionProof: import("@chainsafe/ssz").VectorCompositeType<import("@chainsafe/ssz").ByteVectorType>;
|
|
535
588
|
}>[];
|
|
589
|
+
executionOptimistic: boolean;
|
|
590
|
+
finalized: boolean;
|
|
536
591
|
};
|
|
537
592
|
}>>, {
|
|
538
593
|
params: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/beacon/routes/beacon/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAC,cAAc,EAAC,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAA0B,QAAQ,EAAE,aAAa,EAAC,MAAM,yBAAyB,CAAC;AACzF,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAExC,yFAAyF;AAEzF,+FAA+F;AAC/F,iFAAiF;AAEjF,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,mBAAmB,EAAC,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/beacon/routes/beacon/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAS,GAAG,EAAC,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAC,cAAc,EAAC,MAAM,yCAAyC,CAAC;AACvE,OAAO,EAA0B,QAAQ,EAAE,aAAa,EAAC,MAAM,yBAAyB,CAAC;AACzF,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AAExC,yFAAyF;AAEzF,+FAA+F;AAC/F,iFAAiF;AAEjF,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,mBAAmB,EAAC,MAAM,YAAY,CAAC;AA+B/C,MAAM,CAAC,MAAM,UAAU,GAAoB;IACzC,UAAU,EAAE,EAAC,GAAG,EAAE,wBAAwB,EAAE,MAAM,EAAE,KAAK,EAAC;IAC1D,GAAG,KAAK,CAAC,UAAU;IACnB,GAAG,IAAI,CAAC,UAAU;IAClB,GAAG,KAAK,CAAC,UAAU;IACnB,GAAG,OAAO,CAAC,UAAU;CACtB,CAAC;AAMF,4EAA4E;AAC5E,MAAM,UAAU,iBAAiB,CAAC,MAAuB;IACvD,OAAO;QACL,UAAU,EAAE,QAAQ;QACpB,GAAG,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC;QAClC,GAAG,IAAI,CAAC,iBAAiB,EAAE;QAC3B,GAAG,KAAK,CAAC,iBAAiB,EAAE;QAC5B,GAAG,OAAO,CAAC,iBAAiB,EAAE;KAC/B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,cAAc;IAC5B,OAAO;QACL,UAAU,EAAE,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC;QAC7C,GAAG,KAAK,CAAC,cAAc,EAAE;QACzB,GAAG,IAAI,CAAC,cAAc,EAAE;QACxB,GAAG,KAAK,CAAC,cAAc,EAAE;QACzB,GAAG,OAAO,CAAC,cAAc,EAAE;KAC5B,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ValidatorIndex } from "@lodestar/types";
|
|
1
|
+
import { Epoch, ValidatorIndex } from "@lodestar/types";
|
|
2
2
|
import { RoutesData, ReturnTypes, ReqSerializers } from "../../../utils/index.js";
|
|
3
3
|
import { HttpStatusCode } from "../../../utils/client/httpStatusCode.js";
|
|
4
4
|
import { ApiClientResponse } from "../../../interfaces.js";
|
|
@@ -9,6 +9,10 @@ import { ValidatorId } from "./state.js";
|
|
|
9
9
|
* a later time. If the field is not present, assume the False value.
|
|
10
10
|
*/
|
|
11
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;
|
|
12
16
|
/**
|
|
13
17
|
* Rewards info for a single block. Every reward value is in Gwei.
|
|
14
18
|
*/
|
|
@@ -26,6 +30,38 @@ export type BlockRewards = {
|
|
|
26
30
|
/** Block reward component due to included attester_slashings */
|
|
27
31
|
attesterSlashings: number;
|
|
28
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* Rewards for a single set of (ideal or actual depending on usage) attestations. Reward value is in Gwei
|
|
35
|
+
*/
|
|
36
|
+
type AttestationsReward = {
|
|
37
|
+
/** Reward for head vote. Could be negative to indicate penalty */
|
|
38
|
+
head: number;
|
|
39
|
+
/** Reward for target vote. Could be negative to indicate penalty */
|
|
40
|
+
target: number;
|
|
41
|
+
/** Reward for source vote. Could be negative to indicate penalty */
|
|
42
|
+
source: number;
|
|
43
|
+
/** Inclusion delay reward (phase0 only) */
|
|
44
|
+
inclusionDelay: number;
|
|
45
|
+
/** Inactivity penalty. Should be a negative number to indicate penalty */
|
|
46
|
+
inactivity: number;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Rewards info for ideal attestations ie. Maximum rewards could be earned by making timely head, target and source vote.
|
|
50
|
+
* `effectiveBalance` is in Gwei
|
|
51
|
+
*/
|
|
52
|
+
export type IdealAttestationsReward = AttestationsReward & {
|
|
53
|
+
effectiveBalance: number;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Rewards info for actual attestations
|
|
57
|
+
*/
|
|
58
|
+
export type TotalAttestationsReward = AttestationsReward & {
|
|
59
|
+
validatorIndex: ValidatorIndex;
|
|
60
|
+
};
|
|
61
|
+
export type AttestationsRewards = {
|
|
62
|
+
idealRewards: IdealAttestationsReward[];
|
|
63
|
+
totalRewards: TotalAttestationsReward[];
|
|
64
|
+
};
|
|
29
65
|
/**
|
|
30
66
|
* Rewards info for sync committee participation. Every reward value is in Gwei.
|
|
31
67
|
* Note: In the case that block proposer is present in `SyncCommitteeRewards`, the reward value only reflects rewards for
|
|
@@ -48,6 +84,21 @@ export type Api = {
|
|
|
48
84
|
[HttpStatusCode.OK]: {
|
|
49
85
|
data: BlockRewards;
|
|
50
86
|
executionOptimistic: ExecutionOptimistic;
|
|
87
|
+
finalized: Finalized;
|
|
88
|
+
};
|
|
89
|
+
}, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>;
|
|
90
|
+
/**
|
|
91
|
+
* Get attestations rewards
|
|
92
|
+
* Negative values indicate penalties. `inactivity` can only be either 0 or negative number since it is penalty only
|
|
93
|
+
*
|
|
94
|
+
* @param epoch The epoch to get rewards info from
|
|
95
|
+
* @param validatorIds List of validator indices or pubkeys to filter in
|
|
96
|
+
*/
|
|
97
|
+
getAttestationsRewards(epoch: Epoch, validatorIds?: ValidatorId[]): Promise<ApiClientResponse<{
|
|
98
|
+
[HttpStatusCode.OK]: {
|
|
99
|
+
data: AttestationsRewards;
|
|
100
|
+
executionOptimistic: ExecutionOptimistic;
|
|
101
|
+
finalized: Finalized;
|
|
51
102
|
};
|
|
52
103
|
}, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>;
|
|
53
104
|
/**
|
|
@@ -62,6 +113,7 @@ export type Api = {
|
|
|
62
113
|
[HttpStatusCode.OK]: {
|
|
63
114
|
data: SyncCommitteeRewards;
|
|
64
115
|
executionOptimistic: ExecutionOptimistic;
|
|
116
|
+
finalized: Finalized;
|
|
65
117
|
};
|
|
66
118
|
}, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>;
|
|
67
119
|
};
|
|
@@ -75,6 +127,12 @@ export type ReqTypes = {
|
|
|
75
127
|
block_id: string;
|
|
76
128
|
};
|
|
77
129
|
};
|
|
130
|
+
getAttestationsRewards: {
|
|
131
|
+
params: {
|
|
132
|
+
epoch: number;
|
|
133
|
+
};
|
|
134
|
+
body: ValidatorId[];
|
|
135
|
+
};
|
|
78
136
|
getSyncCommitteeRewards: {
|
|
79
137
|
params: {
|
|
80
138
|
block_id: string;
|
|
@@ -84,4 +142,5 @@ export type ReqTypes = {
|
|
|
84
142
|
};
|
|
85
143
|
export declare function getReqSerializers(): ReqSerializers<Api, ReqTypes>;
|
|
86
144
|
export declare function getReturnTypes(): ReturnTypes<Api>;
|
|
145
|
+
export {};
|
|
87
146
|
//# sourceMappingURL=rewards.d.ts.map
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { ContainerType } from "@chainsafe/ssz";
|
|
2
2
|
import { ssz } from "@lodestar/types";
|
|
3
|
-
import { Schema, ContainerDataExecutionOptimistic, ArrayOf, } from "../../../utils/index.js";
|
|
3
|
+
import { Schema, ContainerDataExecutionOptimistic, ArrayOf, WithFinalized, } from "../../../utils/index.js";
|
|
4
4
|
import { HttpStatusCode } from "../../../utils/client/httpStatusCode.js";
|
|
5
5
|
/**
|
|
6
6
|
* Define javascript values for each route
|
|
7
7
|
*/
|
|
8
8
|
export const routesData = {
|
|
9
9
|
getBlockRewards: { url: "/eth/v1/beacon/rewards/blocks/{block_id}", method: "GET" },
|
|
10
|
+
getAttestationsRewards: { url: "/eth/v1/beacon/rewards/attestations/{epoch}", method: "POST" },
|
|
10
11
|
getSyncCommitteeRewards: { url: "/eth/v1/beacon/rewards/sync_committee/{block_id}", method: "POST" },
|
|
11
12
|
};
|
|
12
13
|
export function getReqSerializers() {
|
|
@@ -16,6 +17,14 @@ export function getReqSerializers() {
|
|
|
16
17
|
parseReq: ({ params }) => [params.block_id],
|
|
17
18
|
schema: { params: { block_id: Schema.StringRequired } },
|
|
18
19
|
},
|
|
20
|
+
getAttestationsRewards: {
|
|
21
|
+
writeReq: (epoch, validatorIds) => ({ params: { epoch: epoch }, body: validatorIds || [] }),
|
|
22
|
+
parseReq: ({ params, body }) => [params.epoch, body],
|
|
23
|
+
schema: {
|
|
24
|
+
params: { epoch: Schema.UintRequired },
|
|
25
|
+
body: Schema.UintOrStringArray,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
19
28
|
getSyncCommitteeRewards: {
|
|
20
29
|
writeReq: (block_id, validatorIds) => ({ params: { block_id: String(block_id) }, body: validatorIds || [] }),
|
|
21
30
|
parseReq: ({ params, body }) => [params.block_id, body],
|
|
@@ -35,13 +44,34 @@ export function getReturnTypes() {
|
|
|
35
44
|
proposerSlashings: ssz.UintNum64,
|
|
36
45
|
attesterSlashings: ssz.UintNum64,
|
|
37
46
|
}, { jsonCase: "eth2" });
|
|
47
|
+
const IdealAttestationsRewardsResponse = new ContainerType({
|
|
48
|
+
head: ssz.UintNum64,
|
|
49
|
+
target: ssz.UintNum64,
|
|
50
|
+
source: ssz.UintNum64,
|
|
51
|
+
inclusionDelay: ssz.UintNum64,
|
|
52
|
+
inactivity: ssz.UintNum64,
|
|
53
|
+
effectiveBalance: ssz.UintNum64,
|
|
54
|
+
}, { jsonCase: "eth2" });
|
|
55
|
+
const TotalAttestationsRewardsResponse = new ContainerType({
|
|
56
|
+
head: ssz.UintNum64,
|
|
57
|
+
target: ssz.UintNum64,
|
|
58
|
+
source: ssz.UintNum64,
|
|
59
|
+
inclusionDelay: ssz.UintNum64,
|
|
60
|
+
inactivity: ssz.UintNum64,
|
|
61
|
+
validatorIndex: ssz.ValidatorIndex,
|
|
62
|
+
}, { jsonCase: "eth2" });
|
|
63
|
+
const AttestationsRewardsResponse = new ContainerType({
|
|
64
|
+
idealRewards: ArrayOf(IdealAttestationsRewardsResponse),
|
|
65
|
+
totalRewards: ArrayOf(TotalAttestationsRewardsResponse),
|
|
66
|
+
}, { jsonCase: "eth2" });
|
|
38
67
|
const SyncCommitteeRewardsResponse = new ContainerType({
|
|
39
68
|
validatorIndex: ssz.ValidatorIndex,
|
|
40
69
|
reward: ssz.UintNum64,
|
|
41
70
|
}, { jsonCase: "eth2" });
|
|
42
71
|
return {
|
|
43
|
-
getBlockRewards: ContainerDataExecutionOptimistic(BlockRewardsResponse),
|
|
44
|
-
|
|
72
|
+
getBlockRewards: WithFinalized(ContainerDataExecutionOptimistic(BlockRewardsResponse)),
|
|
73
|
+
getAttestationsRewards: WithFinalized(ContainerDataExecutionOptimistic(AttestationsRewardsResponse)),
|
|
74
|
+
getSyncCommitteeRewards: WithFinalized(ContainerDataExecutionOptimistic(ArrayOf(SyncCommitteeRewardsResponse))),
|
|
45
75
|
};
|
|
46
76
|
}
|
|
47
77
|
//# sourceMappingURL=rewards.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rewards.js","sourceRoot":"","sources":["../../../../src/beacon/routes/beacon/rewards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAC7C,OAAO,
|
|
1
|
+
{"version":3,"file":"rewards.js","sourceRoot":"","sources":["../../../../src/beacon/routes/beacon/rewards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAQ,GAAG,EAAiB,MAAM,iBAAiB,CAAC;AAE3D,OAAO,EAGL,MAAM,EAEN,gCAAgC,EAChC,OAAO,EACP,aAAa,GACd,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,cAAc,EAAC,MAAM,yCAAyC,CAAC;AAgJvE;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAoB;IACzC,eAAe,EAAE,EAAC,GAAG,EAAE,0CAA0C,EAAE,MAAM,EAAE,KAAK,EAAC;IACjF,sBAAsB,EAAE,EAAC,GAAG,EAAE,6CAA6C,EAAE,MAAM,EAAE,MAAM,EAAC;IAC5F,uB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