@lodestar/api 1.18.0-dev.f672c10bcb → 1.18.0-dev.f9676f1ea0
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.
|
@@ -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<{
|
|
@@ -38,6 +38,17 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
38
38
|
block_id: string;
|
|
39
39
|
};
|
|
40
40
|
}>;
|
|
41
|
+
getAttestationsRewards: import("../../../utils/types.js").ReqSerializer<(epoch: number, validatorIds?: state.ValidatorId[] | undefined) => Promise<ApiClientResponse<{
|
|
42
|
+
200: {
|
|
43
|
+
data: rewards.AttestationsRewards;
|
|
44
|
+
executionOptimistic: boolean;
|
|
45
|
+
};
|
|
46
|
+
}, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>, {
|
|
47
|
+
params: {
|
|
48
|
+
epoch: number;
|
|
49
|
+
};
|
|
50
|
+
body: state.ValidatorId[];
|
|
51
|
+
}>;
|
|
41
52
|
getSyncCommitteeRewards: import("../../../utils/types.js").ReqSerializer<(blockId: block.BlockId, validatorIds?: state.ValidatorId[] | undefined) => Promise<ApiClientResponse<{
|
|
42
53
|
200: {
|
|
43
54
|
data: rewards.SyncCommitteeRewards;
|
|
@@ -63,7 +74,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
63
74
|
}>;
|
|
64
75
|
getStateFork: import("../../../utils/types.js").ReqSerializer<(stateId: state.StateId) => Promise<ApiClientResponse<{
|
|
65
76
|
200: {
|
|
66
|
-
data: import("@chainsafe/ssz
|
|
77
|
+
data: import("@chainsafe/ssz").ValueOfFields<{
|
|
67
78
|
previousVersion: import("@chainsafe/ssz").ByteVectorType;
|
|
68
79
|
currentVersion: import("@chainsafe/ssz").ByteVectorType;
|
|
69
80
|
epoch: import("@chainsafe/ssz").UintNumberType;
|
|
@@ -168,7 +179,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
168
179
|
}>;
|
|
169
180
|
getPoolAttestations: import("../../../utils/types.js").ReqSerializer<(filters?: Partial<pool.AttestationFilters> | undefined) => Promise<ApiClientResponse<{
|
|
170
181
|
200: {
|
|
171
|
-
data: import("@chainsafe/ssz
|
|
182
|
+
data: import("@chainsafe/ssz").ValueOfFields<{
|
|
172
183
|
aggregationBits: import("@chainsafe/ssz").BitListType;
|
|
173
184
|
data: import("@chainsafe/ssz").ContainerType<{
|
|
174
185
|
slot: import("@chainsafe/ssz").UintNumberType;
|
|
@@ -194,7 +205,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
194
205
|
}>;
|
|
195
206
|
getPoolAttesterSlashings: import("../../../utils/types.js").ReqSerializer<() => Promise<ApiClientResponse<{
|
|
196
207
|
200: {
|
|
197
|
-
data: import("@chainsafe/ssz
|
|
208
|
+
data: import("@chainsafe/ssz").ValueOfFields<{
|
|
198
209
|
attestation1: import("@chainsafe/ssz").ContainerType<{
|
|
199
210
|
attestingIndices: import("@chainsafe/ssz").ListBasicType<import("@chainsafe/ssz").UintNumberType>;
|
|
200
211
|
data: import("@chainsafe/ssz").ContainerType<{
|
|
@@ -234,7 +245,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
234
245
|
}>>, import("../../../utils/types.js").ReqGeneric>;
|
|
235
246
|
getPoolProposerSlashings: import("../../../utils/types.js").ReqSerializer<() => Promise<ApiClientResponse<{
|
|
236
247
|
200: {
|
|
237
|
-
data: import("@chainsafe/ssz
|
|
248
|
+
data: import("@chainsafe/ssz").ValueOfFields<{
|
|
238
249
|
signedHeader1: import("@chainsafe/ssz").ContainerType<{
|
|
239
250
|
message: import("@chainsafe/ssz").ContainerType<{
|
|
240
251
|
slot: import("@chainsafe/ssz").UintBigintType;
|
|
@@ -260,7 +271,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
260
271
|
}>>, import("../../../utils/types.js").ReqGeneric>;
|
|
261
272
|
getPoolVoluntaryExits: import("../../../utils/types.js").ReqSerializer<() => Promise<ApiClientResponse<{
|
|
262
273
|
200: {
|
|
263
|
-
data: import("@chainsafe/ssz
|
|
274
|
+
data: import("@chainsafe/ssz").ValueOfFields<{
|
|
264
275
|
message: import("@chainsafe/ssz").ContainerType<{
|
|
265
276
|
epoch: import("@chainsafe/ssz").UintNumberType;
|
|
266
277
|
validatorIndex: import("@chainsafe/ssz").UintNumberType;
|
|
@@ -271,7 +282,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
271
282
|
}>>, import("../../../utils/types.js").ReqGeneric>;
|
|
272
283
|
getPoolBlsToExecutionChanges: import("../../../utils/types.js").ReqSerializer<() => Promise<ApiClientResponse<{
|
|
273
284
|
200: {
|
|
274
|
-
data: import("@chainsafe/ssz
|
|
285
|
+
data: import("@chainsafe/ssz").ValueOfFields<{
|
|
275
286
|
message: import("@chainsafe/ssz").ContainerType<{
|
|
276
287
|
validatorIndex: import("@chainsafe/ssz").UintNumberType;
|
|
277
288
|
fromBlsPubkey: import("@chainsafe/ssz").ByteVectorType;
|
|
@@ -281,7 +292,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
281
292
|
}>[];
|
|
282
293
|
};
|
|
283
294
|
}>>, import("../../../utils/types.js").ReqGeneric>;
|
|
284
|
-
submitPoolAttestations: import("../../../utils/types.js").ReqSerializer<(attestations: import("@chainsafe/ssz
|
|
295
|
+
submitPoolAttestations: import("../../../utils/types.js").ReqSerializer<(attestations: import("@chainsafe/ssz").ValueOfFields<{
|
|
285
296
|
aggregationBits: import("@chainsafe/ssz").BitListType;
|
|
286
297
|
data: import("@chainsafe/ssz").ContainerType<{
|
|
287
298
|
slot: import("@chainsafe/ssz").UintNumberType;
|
|
@@ -302,7 +313,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
302
313
|
}, HttpStatusCode.BAD_REQUEST>>, {
|
|
303
314
|
body: unknown;
|
|
304
315
|
}>;
|
|
305
|
-
submitPoolAttesterSlashings: import("../../../utils/types.js").ReqSerializer<(slashing: import("@chainsafe/ssz
|
|
316
|
+
submitPoolAttesterSlashings: import("../../../utils/types.js").ReqSerializer<(slashing: import("@chainsafe/ssz").ValueOfFields<{
|
|
306
317
|
attestation1: import("@chainsafe/ssz").ContainerType<{
|
|
307
318
|
attestingIndices: import("@chainsafe/ssz").ListBasicType<import("@chainsafe/ssz").UintNumberType>;
|
|
308
319
|
data: import("@chainsafe/ssz").ContainerType<{
|
|
@@ -342,7 +353,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
342
353
|
}, HttpStatusCode.BAD_REQUEST>>, {
|
|
343
354
|
body: unknown;
|
|
344
355
|
}>;
|
|
345
|
-
submitPoolProposerSlashings: import("../../../utils/types.js").ReqSerializer<(slashing: import("@chainsafe/ssz
|
|
356
|
+
submitPoolProposerSlashings: import("../../../utils/types.js").ReqSerializer<(slashing: import("@chainsafe/ssz").ValueOfFields<{
|
|
346
357
|
signedHeader1: import("@chainsafe/ssz").ContainerType<{
|
|
347
358
|
message: import("@chainsafe/ssz").ContainerType<{
|
|
348
359
|
slot: import("@chainsafe/ssz").UintBigintType;
|
|
@@ -368,7 +379,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
368
379
|
}, HttpStatusCode.BAD_REQUEST>>, {
|
|
369
380
|
body: unknown;
|
|
370
381
|
}>;
|
|
371
|
-
submitPoolVoluntaryExit: import("../../../utils/types.js").ReqSerializer<(exit: import("@chainsafe/ssz
|
|
382
|
+
submitPoolVoluntaryExit: import("../../../utils/types.js").ReqSerializer<(exit: import("@chainsafe/ssz").ValueOfFields<{
|
|
372
383
|
message: import("@chainsafe/ssz").ContainerType<{
|
|
373
384
|
epoch: import("@chainsafe/ssz").UintNumberType;
|
|
374
385
|
validatorIndex: import("@chainsafe/ssz").UintNumberType;
|
|
@@ -379,7 +390,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
379
390
|
}, HttpStatusCode.BAD_REQUEST>>, {
|
|
380
391
|
body: unknown;
|
|
381
392
|
}>;
|
|
382
|
-
submitPoolBlsToExecutionChange: import("../../../utils/types.js").ReqSerializer<(blsToExecutionChange: import("@chainsafe/ssz
|
|
393
|
+
submitPoolBlsToExecutionChange: import("../../../utils/types.js").ReqSerializer<(blsToExecutionChange: import("@chainsafe/ssz").ValueOfFields<{
|
|
383
394
|
message: import("@chainsafe/ssz").ContainerType<{
|
|
384
395
|
validatorIndex: import("@chainsafe/ssz").UintNumberType;
|
|
385
396
|
fromBlsPubkey: import("@chainsafe/ssz").ByteVectorType;
|
|
@@ -391,7 +402,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
391
402
|
}, HttpStatusCode.BAD_REQUEST>>, {
|
|
392
403
|
body: unknown;
|
|
393
404
|
}>;
|
|
394
|
-
submitPoolSyncCommitteeSignatures: import("../../../utils/types.js").ReqSerializer<(signatures: import("@chainsafe/ssz
|
|
405
|
+
submitPoolSyncCommitteeSignatures: import("../../../utils/types.js").ReqSerializer<(signatures: import("@chainsafe/ssz").ValueOfFields<{
|
|
395
406
|
slot: import("@chainsafe/ssz").UintNumberType;
|
|
396
407
|
beaconBlockRoot: import("@chainsafe/ssz").ByteVectorType;
|
|
397
408
|
validatorIndex: import("@chainsafe/ssz").UintNumberType;
|
|
@@ -419,7 +430,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
419
430
|
}>;
|
|
420
431
|
getBlockAttestations: import("../../../utils/types.js").ReqSerializer<(blockId: block.BlockId) => Promise<ApiClientResponse<{
|
|
421
432
|
200: {
|
|
422
|
-
data: import("@chainsafe/ssz
|
|
433
|
+
data: import("@chainsafe/ssz").ValueOfFields<{
|
|
423
434
|
aggregationBits: import("@chainsafe/ssz").BitListType;
|
|
424
435
|
data: import("@chainsafe/ssz").ContainerType<{
|
|
425
436
|
slot: import("@chainsafe/ssz").UintNumberType;
|
|
@@ -516,7 +527,7 @@ export declare function getReqSerializers(config: ChainForkConfig): {
|
|
|
516
527
|
getBlobSidecars: import("../../../utils/types.js").ReqSerializer<(blockId: block.BlockId, indices?: number[] | undefined) => Promise<ApiClientResponse<{
|
|
517
528
|
200: {
|
|
518
529
|
executionOptimistic: boolean;
|
|
519
|
-
data: import("@chainsafe/ssz
|
|
530
|
+
data: import("@chainsafe/ssz").ValueOfFields<{
|
|
520
531
|
index: import("@chainsafe/ssz").UintNumberType;
|
|
521
532
|
blob: import("@chainsafe/ssz").ByteVectorType;
|
|
522
533
|
kzgCommitment: import("@chainsafe/ssz").ByteVectorType;
|
|
@@ -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,M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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";
|
|
@@ -26,6 +26,38 @@ export type BlockRewards = {
|
|
|
26
26
|
/** Block reward component due to included attester_slashings */
|
|
27
27
|
attesterSlashings: number;
|
|
28
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* Rewards for a single set of (ideal or actual depending on usage) attestations. Reward value is in Gwei
|
|
31
|
+
*/
|
|
32
|
+
type AttestationsReward = {
|
|
33
|
+
/** Reward for head vote. Could be negative to indicate penalty */
|
|
34
|
+
head: number;
|
|
35
|
+
/** Reward for target vote. Could be negative to indicate penalty */
|
|
36
|
+
target: number;
|
|
37
|
+
/** Reward for source vote. Could be negative to indicate penalty */
|
|
38
|
+
source: number;
|
|
39
|
+
/** Inclusion delay reward (phase0 only) */
|
|
40
|
+
inclusionDelay: number;
|
|
41
|
+
/** Inactivity penalty. Should be a negative number to indicate penalty */
|
|
42
|
+
inactivity: number;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Rewards info for ideal attestations ie. Maximum rewards could be earned by making timely head, target and source vote.
|
|
46
|
+
* `effectiveBalance` is in Gwei
|
|
47
|
+
*/
|
|
48
|
+
export type IdealAttestationsReward = AttestationsReward & {
|
|
49
|
+
effectiveBalance: number;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Rewards info for actual attestations
|
|
53
|
+
*/
|
|
54
|
+
export type TotalAttestationsReward = AttestationsReward & {
|
|
55
|
+
validatorIndex: ValidatorIndex;
|
|
56
|
+
};
|
|
57
|
+
export type AttestationsRewards = {
|
|
58
|
+
idealRewards: IdealAttestationsReward[];
|
|
59
|
+
totalRewards: TotalAttestationsReward[];
|
|
60
|
+
};
|
|
29
61
|
/**
|
|
30
62
|
* Rewards info for sync committee participation. Every reward value is in Gwei.
|
|
31
63
|
* Note: In the case that block proposer is present in `SyncCommitteeRewards`, the reward value only reflects rewards for
|
|
@@ -50,6 +82,19 @@ export type Api = {
|
|
|
50
82
|
executionOptimistic: ExecutionOptimistic;
|
|
51
83
|
};
|
|
52
84
|
}, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>;
|
|
85
|
+
/**
|
|
86
|
+
* Get attestations rewards
|
|
87
|
+
* Negative values indicate penalties. `inactivity` can only be either 0 or negative number since it is penalty only
|
|
88
|
+
*
|
|
89
|
+
* @param epoch The epoch to get rewards info from
|
|
90
|
+
* @param validatorIds List of validator indices or pubkeys to filter in
|
|
91
|
+
*/
|
|
92
|
+
getAttestationsRewards(epoch: Epoch, validatorIds?: ValidatorId[]): Promise<ApiClientResponse<{
|
|
93
|
+
[HttpStatusCode.OK]: {
|
|
94
|
+
data: AttestationsRewards;
|
|
95
|
+
executionOptimistic: ExecutionOptimistic;
|
|
96
|
+
};
|
|
97
|
+
}, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>;
|
|
53
98
|
/**
|
|
54
99
|
* Get sync committee rewards
|
|
55
100
|
* Returns participant reward value for each sync committee member at the given block.
|
|
@@ -75,6 +120,12 @@ export type ReqTypes = {
|
|
|
75
120
|
block_id: string;
|
|
76
121
|
};
|
|
77
122
|
};
|
|
123
|
+
getAttestationsRewards: {
|
|
124
|
+
params: {
|
|
125
|
+
epoch: number;
|
|
126
|
+
};
|
|
127
|
+
body: ValidatorId[];
|
|
128
|
+
};
|
|
78
129
|
getSyncCommitteeRewards: {
|
|
79
130
|
params: {
|
|
80
131
|
block_id: string;
|
|
@@ -84,4 +135,5 @@ export type ReqTypes = {
|
|
|
84
135
|
};
|
|
85
136
|
export declare function getReqSerializers(): ReqSerializers<Api, ReqTypes>;
|
|
86
137
|
export declare function getReturnTypes(): ReturnTypes<Api>;
|
|
138
|
+
export {};
|
|
87
139
|
//# sourceMappingURL=rewards.d.ts.map
|
|
@@ -7,6 +7,7 @@ import { HttpStatusCode } from "../../../utils/client/httpStatusCode.js";
|
|
|
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,12 +44,33 @@ 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
72
|
getBlockRewards: ContainerDataExecutionOptimistic(BlockRewardsResponse),
|
|
73
|
+
getAttestationsRewards: ContainerDataExecutionOptimistic(AttestationsRewardsResponse),
|
|
44
74
|
getSyncCommitteeRewards: ContainerDataExecutionOptimistic(ArrayOf(SyncCommitteeRewardsResponse)),
|
|
45
75
|
};
|
|
46
76
|
}
|
|
@@ -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,GACR,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAC,cAAc,EAAC,MAAM,yCAAyC,CAAC;AA2HvE;;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,uBAAuB,EAAE,EAAC,GAAG,EAAE,kDAAkD,EAAE,MAAM,EAAE,MAAM,EAAC;CACnG,CAAC;AASF,MAAM,UAAU,iBAAiB;IAC/B,OAAO;QACL,eAAe,EAAE;YACf,QAAQ,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,EAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,EAAC,EAAC,CAAC;YAChE,QAAQ,EAAE,C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E,sBAAsB,EAAE,gCAAgC,CAAC,2BAA2B,CAAC;QACrF,uBAAuB,EAAE,gCAAgC,CAAC,OAAO,CAAC,4BAA4B,CAAC,CAAC;KACjG,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/ChainSafe/lodestar/issues"
|
|
13
13
|
},
|
|
14
|
-
"version": "1.18.0-dev.
|
|
14
|
+
"version": "1.18.0-dev.f9676f1ea0",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -67,12 +67,12 @@
|
|
|
67
67
|
"check-readme": "typescript-docs-verifier"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@chainsafe/persistent-merkle-tree": "^0.
|
|
71
|
-
"@chainsafe/ssz": "^0.
|
|
72
|
-
"@lodestar/config": "1.18.0-dev.
|
|
73
|
-
"@lodestar/params": "1.18.0-dev.
|
|
74
|
-
"@lodestar/types": "1.18.0-dev.
|
|
75
|
-
"@lodestar/utils": "1.18.0-dev.
|
|
70
|
+
"@chainsafe/persistent-merkle-tree": "^0.7.1",
|
|
71
|
+
"@chainsafe/ssz": "^0.15.1",
|
|
72
|
+
"@lodestar/config": "1.18.0-dev.f9676f1ea0",
|
|
73
|
+
"@lodestar/params": "1.18.0-dev.f9676f1ea0",
|
|
74
|
+
"@lodestar/types": "1.18.0-dev.f9676f1ea0",
|
|
75
|
+
"@lodestar/utils": "1.18.0-dev.f9676f1ea0",
|
|
76
76
|
"eventsource": "^2.0.2",
|
|
77
77
|
"qs": "^6.11.1"
|
|
78
78
|
},
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"api",
|
|
90
90
|
"blockchain"
|
|
91
91
|
],
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "17a57581d93b7d9b997a11701e0feb6fab0f5c30"
|
|
93
93
|
}
|