@lodestar/api 1.20.0-dev.f6d3bce802 → 1.20.0-dev.fe23f68998

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (228) hide show
  1. package/README.md +2 -2
  2. package/lib/beacon/client/beacon.d.ts +4 -3
  3. package/lib/beacon/client/beacon.js +3 -36
  4. package/lib/beacon/client/beacon.js.map +1 -1
  5. package/lib/beacon/client/config.d.ts +4 -3
  6. package/lib/beacon/client/config.js +3 -6
  7. package/lib/beacon/client/config.js.map +1 -1
  8. package/lib/beacon/client/debug.d.ts +4 -3
  9. package/lib/beacon/client/debug.js +4 -45
  10. package/lib/beacon/client/debug.js.map +1 -1
  11. package/lib/beacon/client/events.d.ts +5 -2
  12. package/lib/beacon/client/events.js +33 -35
  13. package/lib/beacon/client/events.js.map +1 -1
  14. package/lib/beacon/client/index.d.ts +6 -3
  15. package/lib/beacon/client/index.js +2 -2
  16. package/lib/beacon/client/index.js.map +1 -1
  17. package/lib/beacon/client/lightclient.d.ts +4 -3
  18. package/lib/beacon/client/lightclient.js +4 -7
  19. package/lib/beacon/client/lightclient.js.map +1 -1
  20. package/lib/beacon/client/lodestar.d.ts +4 -3
  21. package/lib/beacon/client/lodestar.js +4 -7
  22. package/lib/beacon/client/lodestar.js.map +1 -1
  23. package/lib/beacon/client/node.d.ts +4 -3
  24. package/lib/beacon/client/node.js +4 -7
  25. package/lib/beacon/client/node.js.map +1 -1
  26. package/lib/beacon/client/proof.d.ts +5 -4
  27. package/lib/beacon/client/proof.js +5 -61
  28. package/lib/beacon/client/proof.js.map +1 -1
  29. package/lib/beacon/client/validator.d.ts +4 -3
  30. package/lib/beacon/client/validator.js +4 -7
  31. package/lib/beacon/client/validator.js.map +1 -1
  32. package/lib/beacon/index.d.ts +5 -5
  33. package/lib/beacon/index.js.map +1 -1
  34. package/lib/beacon/routes/beacon/block.d.ts +286 -167
  35. package/lib/beacon/routes/beacon/block.js +317 -117
  36. package/lib/beacon/routes/beacon/block.js.map +1 -1
  37. package/lib/beacon/routes/beacon/index.d.ts +6 -588
  38. package/lib/beacon/routes/beacon/index.js +16 -26
  39. package/lib/beacon/routes/beacon/index.js.map +1 -1
  40. package/lib/beacon/routes/beacon/pool.d.ts +155 -117
  41. package/lib/beacon/routes/beacon/pool.js +146 -42
  42. package/lib/beacon/routes/beacon/pool.js.map +1 -1
  43. package/lib/beacon/routes/beacon/rewards.d.ts +113 -101
  44. package/lib/beacon/routes/beacon/rewards.js +98 -63
  45. package/lib/beacon/routes/beacon/rewards.js.map +1 -1
  46. package/lib/beacon/routes/beacon/state.d.ts +172 -226
  47. package/lib/beacon/routes/beacon/state.js +204 -126
  48. package/lib/beacon/routes/beacon/state.js.map +1 -1
  49. package/lib/beacon/routes/config.d.ts +21 -36
  50. package/lib/beacon/routes/config.js +45 -24
  51. package/lib/beacon/routes/config.js.map +1 -1
  52. package/lib/beacon/routes/debug.d.ts +22 -104
  53. package/lib/beacon/routes/debug.js +53 -45
  54. package/lib/beacon/routes/debug.js.map +1 -1
  55. package/lib/beacon/routes/events.d.ts +24 -20
  56. package/lib/beacon/routes/events.js +40 -18
  57. package/lib/beacon/routes/events.js.map +1 -1
  58. package/lib/beacon/routes/index.d.ts +19 -19
  59. package/lib/beacon/routes/index.js +1 -0
  60. package/lib/beacon/routes/index.js.map +1 -1
  61. package/lib/beacon/routes/lightclient.d.ts +34 -56
  62. package/lib/beacon/routes/lightclient.js +108 -48
  63. package/lib/beacon/routes/lightclient.js.map +1 -1
  64. package/lib/beacon/routes/lodestar.d.ts +74 -148
  65. package/lib/beacon/routes/lodestar.js +126 -77
  66. package/lib/beacon/routes/lodestar.js.map +1 -1
  67. package/lib/beacon/routes/node.d.ts +48 -82
  68. package/lib/beacon/routes/node.js +90 -57
  69. package/lib/beacon/routes/node.js.map +1 -1
  70. package/lib/beacon/routes/proof.d.ts +25 -31
  71. package/lib/beacon/routes/proof.js +44 -24
  72. package/lib/beacon/routes/proof.js.map +1 -1
  73. package/lib/beacon/routes/validator.d.ts +524 -325
  74. package/lib/beacon/routes/validator.js +468 -213
  75. package/lib/beacon/routes/validator.js.map +1 -1
  76. package/lib/beacon/server/beacon.d.ts +3 -4
  77. package/lib/beacon/server/beacon.js +4 -57
  78. package/lib/beacon/server/beacon.js.map +1 -1
  79. package/lib/beacon/server/config.d.ts +3 -4
  80. package/lib/beacon/server/config.js +4 -5
  81. package/lib/beacon/server/config.js.map +1 -1
  82. package/lib/beacon/server/debug.d.ts +3 -4
  83. package/lib/beacon/server/debug.js +4 -54
  84. package/lib/beacon/server/debug.js.map +1 -1
  85. package/lib/beacon/server/events.d.ts +4 -4
  86. package/lib/beacon/server/events.js +17 -23
  87. package/lib/beacon/server/events.js.map +1 -1
  88. package/lib/beacon/server/index.d.ts +7 -8
  89. package/lib/beacon/server/index.js +13 -14
  90. package/lib/beacon/server/index.js.map +1 -1
  91. package/lib/beacon/server/lightclient.d.ts +3 -4
  92. package/lib/beacon/server/lightclient.js +4 -5
  93. package/lib/beacon/server/lightclient.js.map +1 -1
  94. package/lib/beacon/server/lodestar.d.ts +3 -4
  95. package/lib/beacon/server/lodestar.js +4 -5
  96. package/lib/beacon/server/lodestar.js.map +1 -1
  97. package/lib/beacon/server/node.d.ts +3 -4
  98. package/lib/beacon/server/node.js +4 -18
  99. package/lib/beacon/server/node.js.map +1 -1
  100. package/lib/beacon/server/proof.d.ts +3 -4
  101. package/lib/beacon/server/proof.js +4 -36
  102. package/lib/beacon/server/proof.js.map +1 -1
  103. package/lib/beacon/server/validator.d.ts +3 -4
  104. package/lib/beacon/server/validator.js +4 -21
  105. package/lib/beacon/server/validator.js.map +1 -1
  106. package/lib/builder/client.d.ts +4 -6
  107. package/lib/builder/client.js +3 -9
  108. package/lib/builder/client.js.map +1 -1
  109. package/lib/builder/index.d.ts +8 -5
  110. package/lib/builder/index.js +4 -1
  111. package/lib/builder/index.js.map +1 -1
  112. package/lib/builder/routes.d.ts +25 -39
  113. package/lib/builder/routes.js +78 -34
  114. package/lib/builder/routes.js.map +1 -1
  115. package/lib/builder/server/index.d.ts +6 -6
  116. package/lib/builder/server/index.js +7 -8
  117. package/lib/builder/server/index.js.map +1 -1
  118. package/lib/index.d.ts +9 -6
  119. package/lib/index.js +5 -4
  120. package/lib/index.js.map +1 -1
  121. package/lib/keymanager/client.d.ts +4 -3
  122. package/lib/keymanager/client.js +4 -7
  123. package/lib/keymanager/client.js.map +1 -1
  124. package/lib/keymanager/index.d.ts +5 -4
  125. package/lib/keymanager/index.js +1 -1
  126. package/lib/keymanager/index.js.map +1 -1
  127. package/lib/keymanager/routes.d.ts +155 -177
  128. package/lib/keymanager/routes.js +236 -123
  129. package/lib/keymanager/routes.js.map +1 -1
  130. package/lib/keymanager/server/index.d.ts +6 -6
  131. package/lib/keymanager/server/index.js +7 -8
  132. package/lib/keymanager/server/index.js.map +1 -1
  133. package/lib/server/index.d.ts +2 -0
  134. package/lib/server/index.js +3 -0
  135. package/lib/server/index.js.map +1 -0
  136. package/lib/utils/client/error.d.ts +6 -0
  137. package/lib/utils/client/error.js +8 -0
  138. package/lib/utils/client/error.js.map +1 -0
  139. package/lib/utils/client/httpClient.d.ts +35 -75
  140. package/lib/utils/client/httpClient.js +201 -153
  141. package/lib/utils/client/httpClient.js.map +1 -1
  142. package/lib/utils/client/index.d.ts +6 -2
  143. package/lib/utils/client/index.js +6 -2
  144. package/lib/utils/client/index.js.map +1 -1
  145. package/lib/utils/client/method.d.ts +11 -0
  146. package/lib/utils/client/method.js +27 -0
  147. package/lib/utils/client/method.js.map +1 -0
  148. package/lib/utils/client/request.d.ts +33 -0
  149. package/lib/utils/client/request.js +66 -0
  150. package/lib/utils/client/request.js.map +1 -0
  151. package/lib/utils/client/response.d.ts +36 -0
  152. package/lib/utils/client/response.js +167 -0
  153. package/lib/utils/client/response.js.map +1 -0
  154. package/lib/utils/codecs.d.ts +28 -0
  155. package/lib/utils/codecs.js +105 -0
  156. package/lib/utils/codecs.js.map +1 -0
  157. package/lib/utils/fork.d.ts +7 -0
  158. package/lib/utils/fork.js +29 -0
  159. package/lib/utils/fork.js.map +1 -0
  160. package/lib/utils/headers.d.ts +37 -0
  161. package/lib/utils/headers.js +134 -0
  162. package/lib/utils/headers.js.map +1 -0
  163. package/lib/utils/httpStatusCode.js.map +1 -0
  164. package/lib/utils/index.d.ts +1 -1
  165. package/lib/utils/index.js +1 -1
  166. package/lib/utils/index.js.map +1 -1
  167. package/lib/utils/metadata.d.ts +88 -0
  168. package/lib/utils/metadata.js +126 -0
  169. package/lib/utils/metadata.js.map +1 -0
  170. package/lib/utils/schema.d.ts +31 -17
  171. package/lib/utils/schema.js +18 -6
  172. package/lib/utils/schema.js.map +1 -1
  173. package/lib/utils/serdes.d.ts +3 -0
  174. package/lib/utils/serdes.js +13 -0
  175. package/lib/utils/serdes.js.map +1 -1
  176. package/lib/utils/server/{errors.d.ts → error.d.ts} +2 -2
  177. package/lib/utils/server/{errors.js → error.js} +1 -1
  178. package/lib/utils/server/error.js.map +1 -0
  179. package/lib/utils/server/handler.d.ts +11 -0
  180. package/lib/utils/server/handler.js +115 -0
  181. package/lib/utils/server/handler.js.map +1 -0
  182. package/lib/utils/server/index.d.ts +5 -4
  183. package/lib/utils/server/index.js +5 -4
  184. package/lib/utils/server/index.js.map +1 -1
  185. package/lib/utils/server/method.d.ts +35 -0
  186. package/lib/utils/server/method.js +2 -0
  187. package/lib/utils/server/method.js.map +1 -0
  188. package/lib/utils/server/parser.d.ts +3 -0
  189. package/lib/utils/server/parser.js +20 -0
  190. package/lib/utils/server/parser.js.map +1 -0
  191. package/lib/utils/server/route.d.ts +20 -0
  192. package/lib/utils/server/route.js +19 -0
  193. package/lib/utils/server/route.js.map +1 -0
  194. package/lib/utils/types.d.ts +116 -104
  195. package/lib/utils/types.js +2 -155
  196. package/lib/utils/types.js.map +1 -1
  197. package/lib/utils/urlFormat.d.ts +2 -2
  198. package/lib/utils/urlFormat.js +3 -3
  199. package/lib/utils/urlFormat.js.map +1 -1
  200. package/lib/utils/wireFormat.d.ts +8 -0
  201. package/lib/utils/wireFormat.js +23 -0
  202. package/lib/utils/wireFormat.js.map +1 -0
  203. package/package.json +9 -6
  204. package/lib/interfaces.d.ts +0 -44
  205. package/lib/interfaces.js +0 -2
  206. package/lib/interfaces.js.map +0 -1
  207. package/lib/utils/acceptHeader.d.ts +0 -9
  208. package/lib/utils/acceptHeader.js +0 -62
  209. package/lib/utils/acceptHeader.js.map +0 -1
  210. package/lib/utils/client/client.d.ts +0 -29
  211. package/lib/utils/client/client.js +0 -88
  212. package/lib/utils/client/client.js.map +0 -1
  213. package/lib/utils/client/httpStatusCode.js.map +0 -1
  214. package/lib/utils/routes.d.ts +0 -6
  215. package/lib/utils/routes.js +0 -31
  216. package/lib/utils/routes.js.map +0 -1
  217. package/lib/utils/server/errors.js.map +0 -1
  218. package/lib/utils/server/genericJsonServer.d.ts +0 -13
  219. package/lib/utils/server/genericJsonServer.js +0 -32
  220. package/lib/utils/server/genericJsonServer.js.map +0 -1
  221. package/lib/utils/server/registerRoute.d.ts +0 -3
  222. package/lib/utils/server/registerRoute.js +0 -13
  223. package/lib/utils/server/registerRoute.js.map +0 -1
  224. package/lib/utils/server/types.d.ts +0 -22
  225. package/lib/utils/server/types.js +0 -2
  226. package/lib/utils/server/types.js.map +0 -1
  227. /package/lib/utils/{client/httpStatusCode.d.ts → httpStatusCode.d.ts} +0 -0
  228. /package/lib/utils/{client/httpStatusCode.js → httpStatusCode.js} +0 -0
@@ -1,146 +1,158 @@
1
- import { Epoch, ValidatorIndex } from "@lodestar/types";
2
- import { RoutesData, ReturnTypes, ReqSerializers } from "../../../utils/index.js";
3
- import { HttpStatusCode } from "../../../utils/client/httpStatusCode.js";
4
- import { ApiClientResponse } from "../../../interfaces.js";
5
- import { BlockId } from "./block.js";
1
+ import { ContainerType, ValueOf } from "@chainsafe/ssz";
2
+ import { ChainForkConfig } from "@lodestar/config";
3
+ import { Epoch } from "@lodestar/types";
4
+ import { Endpoint, RouteDefinitions } from "../../../utils/index.js";
5
+ import { ExecutionOptimisticAndFinalizedMeta } from "../../../utils/metadata.js";
6
+ import { BlockArgs } from "./block.js";
6
7
  import { ValidatorId } from "./state.js";
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
- /**
17
- * Rewards info for a single block. Every reward value is in Gwei.
18
- */
19
- export type BlockRewards = {
8
+ declare const BlockRewardsType: ContainerType<{
20
9
  /** Proposer of the block, the proposer index who receives these rewards */
21
- proposerIndex: ValidatorIndex;
10
+ proposerIndex: import("@chainsafe/ssz").UintNumberType;
22
11
  /** Total block reward, equal to attestations + sync_aggregate + proposer_slashings + attester_slashings */
23
- total: number;
12
+ total: import("@chainsafe/ssz").UintNumberType;
24
13
  /** Block reward component due to included attestations */
25
- attestations: number;
14
+ attestations: import("@chainsafe/ssz").UintNumberType;
26
15
  /** Block reward component due to included sync_aggregate */
27
- syncAggregate: number;
16
+ syncAggregate: import("@chainsafe/ssz").UintNumberType;
28
17
  /** Block reward component due to included proposer_slashings */
29
- proposerSlashings: number;
18
+ proposerSlashings: import("@chainsafe/ssz").UintNumberType;
30
19
  /** Block reward component due to included attester_slashings */
31
- attesterSlashings: number;
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 = {
20
+ attesterSlashings: import("@chainsafe/ssz").UintNumberType;
21
+ }>;
22
+ declare const AttestationsRewardType: ContainerType<{
37
23
  /** Reward for head vote. Could be negative to indicate penalty */
38
- head: number;
24
+ head: import("@chainsafe/ssz").UintNumberType;
39
25
  /** Reward for target vote. Could be negative to indicate penalty */
40
- target: number;
26
+ target: import("@chainsafe/ssz").UintNumberType;
41
27
  /** Reward for source vote. Could be negative to indicate penalty */
42
- source: number;
28
+ source: import("@chainsafe/ssz").UintNumberType;
43
29
  /** Inclusion delay reward (phase0 only) */
44
- inclusionDelay: number;
30
+ inclusionDelay: import("@chainsafe/ssz").UintNumberType;
45
31
  /** Inactivity penalty. Should be a negative number to indicate penalty */
46
- inactivity: number;
47
- };
32
+ inactivity: import("@chainsafe/ssz").UintNumberType;
33
+ }>;
34
+ declare const IdealAttestationsRewardsType: ContainerType<{
35
+ effectiveBalance: import("@chainsafe/ssz").UintNumberType;
36
+ /** Reward for head vote. Could be negative to indicate penalty */
37
+ head: import("@chainsafe/ssz").UintNumberType;
38
+ /** Reward for target vote. Could be negative to indicate penalty */
39
+ target: import("@chainsafe/ssz").UintNumberType;
40
+ /** Reward for source vote. Could be negative to indicate penalty */
41
+ source: import("@chainsafe/ssz").UintNumberType;
42
+ /** Inclusion delay reward (phase0 only) */
43
+ inclusionDelay: import("@chainsafe/ssz").UintNumberType;
44
+ /** Inactivity penalty. Should be a negative number to indicate penalty */
45
+ inactivity: import("@chainsafe/ssz").UintNumberType;
46
+ }>;
47
+ declare const TotalAttestationsRewardsType: ContainerType<{
48
+ validatorIndex: import("@chainsafe/ssz").UintNumberType;
49
+ /** Reward for head vote. Could be negative to indicate penalty */
50
+ head: import("@chainsafe/ssz").UintNumberType;
51
+ /** Reward for target vote. Could be negative to indicate penalty */
52
+ target: import("@chainsafe/ssz").UintNumberType;
53
+ /** Reward for source vote. Could be negative to indicate penalty */
54
+ source: import("@chainsafe/ssz").UintNumberType;
55
+ /** Inclusion delay reward (phase0 only) */
56
+ inclusionDelay: import("@chainsafe/ssz").UintNumberType;
57
+ /** Inactivity penalty. Should be a negative number to indicate penalty */
58
+ inactivity: import("@chainsafe/ssz").UintNumberType;
59
+ }>;
60
+ declare const AttestationsRewardsType: ContainerType<{
61
+ idealRewards: import("@chainsafe/ssz").ArrayType<import("@chainsafe/ssz").Type<import("@chainsafe/ssz").ValueOfFields<{
62
+ effectiveBalance: import("@chainsafe/ssz").UintNumberType;
63
+ /** Reward for head vote. Could be negative to indicate penalty */
64
+ head: import("@chainsafe/ssz").UintNumberType;
65
+ /** Reward for target vote. Could be negative to indicate penalty */
66
+ target: import("@chainsafe/ssz").UintNumberType;
67
+ /** Reward for source vote. Could be negative to indicate penalty */
68
+ source: import("@chainsafe/ssz").UintNumberType;
69
+ /** Inclusion delay reward (phase0 only) */
70
+ inclusionDelay: import("@chainsafe/ssz").UintNumberType;
71
+ /** Inactivity penalty. Should be a negative number to indicate penalty */
72
+ inactivity: import("@chainsafe/ssz").UintNumberType;
73
+ }>>, unknown, unknown>;
74
+ totalRewards: import("@chainsafe/ssz").ArrayType<import("@chainsafe/ssz").Type<import("@chainsafe/ssz").ValueOfFields<{
75
+ validatorIndex: import("@chainsafe/ssz").UintNumberType;
76
+ /** Reward for head vote. Could be negative to indicate penalty */
77
+ head: import("@chainsafe/ssz").UintNumberType;
78
+ /** Reward for target vote. Could be negative to indicate penalty */
79
+ target: import("@chainsafe/ssz").UintNumberType;
80
+ /** Reward for source vote. Could be negative to indicate penalty */
81
+ source: import("@chainsafe/ssz").UintNumberType;
82
+ /** Inclusion delay reward (phase0 only) */
83
+ inclusionDelay: import("@chainsafe/ssz").UintNumberType;
84
+ /** Inactivity penalty. Should be a negative number to indicate penalty */
85
+ inactivity: import("@chainsafe/ssz").UintNumberType;
86
+ }>>, unknown, unknown>;
87
+ }>;
88
+ declare const SyncCommitteeRewardsType: import("@chainsafe/ssz").ArrayType<import("@chainsafe/ssz").Type<import("@chainsafe/ssz").ValueOfFields<{
89
+ validatorIndex: import("@chainsafe/ssz").UintNumberType;
90
+ reward: import("@chainsafe/ssz").UintNumberType;
91
+ }>>, unknown, unknown>;
92
+ /**
93
+ * Rewards info for a single block. Every reward value is in Gwei.
94
+ */
95
+ export type BlockRewards = ValueOf<typeof BlockRewardsType>;
96
+ /**
97
+ * Rewards for a single set of (ideal or actual depending on usage) attestations. Reward value is in Gwei
98
+ */
99
+ export type AttestationsReward = ValueOf<typeof AttestationsRewardType>;
48
100
  /**
49
101
  * Rewards info for ideal attestations ie. Maximum rewards could be earned by making timely head, target and source vote.
50
102
  * `effectiveBalance` is in Gwei
51
103
  */
52
- export type IdealAttestationsReward = AttestationsReward & {
53
- effectiveBalance: number;
54
- };
104
+ export type IdealAttestationsReward = ValueOf<typeof IdealAttestationsRewardsType>;
55
105
  /**
56
106
  * Rewards info for actual attestations
57
107
  */
58
- export type TotalAttestationsReward = AttestationsReward & {
59
- validatorIndex: ValidatorIndex;
60
- };
61
- export type AttestationsRewards = {
62
- idealRewards: IdealAttestationsReward[];
63
- totalRewards: TotalAttestationsReward[];
64
- };
108
+ export type TotalAttestationsReward = ValueOf<typeof TotalAttestationsRewardsType>;
109
+ export type AttestationsRewards = ValueOf<typeof AttestationsRewardsType>;
65
110
  /**
66
111
  * Rewards info for sync committee participation. Every reward value is in Gwei.
67
112
  * Note: In the case that block proposer is present in `SyncCommitteeRewards`, the reward value only reflects rewards for
68
113
  * participating in sync committee. Please refer to `BlockRewards.syncAggregate` for rewards of proposer including sync committee
69
114
  * outputs into their block
70
115
  */
71
- export type SyncCommitteeRewards = {
72
- validatorIndex: ValidatorIndex;
73
- reward: number;
74
- }[];
75
- export type Api = {
116
+ export type SyncCommitteeRewards = ValueOf<typeof SyncCommitteeRewardsType>;
117
+ export type Endpoints = {
76
118
  /**
77
119
  * Get block rewards
78
120
  * Returns the info of rewards received by the block proposer
79
- *
80
- * @param blockId Block identifier.
81
- * Can be one of: "head" (canonical head in node's view), "genesis", "finalized", \<slot\>, \<hex encoded blockRoot with 0x prefix\>.
82
121
  */
83
- getBlockRewards(blockId: BlockId): Promise<ApiClientResponse<{
84
- [HttpStatusCode.OK]: {
85
- data: BlockRewards;
86
- executionOptimistic: ExecutionOptimistic;
87
- finalized: Finalized;
122
+ getBlockRewards: Endpoint<"GET", BlockArgs, {
123
+ params: {
124
+ block_id: string;
88
125
  };
89
- }, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>;
126
+ }, BlockRewards, ExecutionOptimisticAndFinalizedMeta>;
90
127
  /**
91
128
  * Get attestations rewards
92
129
  * 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
130
  */
97
- getAttestationsRewards(epoch: Epoch, validatorIds?: ValidatorId[]): Promise<ApiClientResponse<{
98
- [HttpStatusCode.OK]: {
99
- data: AttestationsRewards;
100
- executionOptimistic: ExecutionOptimistic;
101
- finalized: Finalized;
131
+ getAttestationsRewards: Endpoint<"POST", {
132
+ /** The epoch to get rewards info from */
133
+ epoch: Epoch;
134
+ /** List of validator indices or pubkeys to filter in */
135
+ validatorIds?: ValidatorId[];
136
+ }, {
137
+ params: {
138
+ epoch: number;
102
139
  };
103
- }, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>;
140
+ body: string[];
141
+ }, AttestationsRewards, ExecutionOptimisticAndFinalizedMeta>;
104
142
  /**
105
143
  * Get sync committee rewards
106
144
  * Returns participant reward value for each sync committee member at the given block.
107
- *
108
- * @param blockId Block identifier.
109
- * Can be one of: "head" (canonical head in node's view), "genesis", "finalized", \<slot\>, \<hex encoded blockRoot with 0x prefix\>.
110
- * @param validatorIds List of validator indices or pubkeys to filter in
111
145
  */
112
- getSyncCommitteeRewards(blockId: BlockId, validatorIds?: ValidatorId[]): Promise<ApiClientResponse<{
113
- [HttpStatusCode.OK]: {
114
- data: SyncCommitteeRewards;
115
- executionOptimistic: ExecutionOptimistic;
116
- finalized: Finalized;
117
- };
118
- }, HttpStatusCode.BAD_REQUEST | HttpStatusCode.NOT_FOUND>>;
119
- };
120
- /**
121
- * Define javascript values for each route
122
- */
123
- export declare const routesData: RoutesData<Api>;
124
- export type ReqTypes = {
125
- getBlockRewards: {
126
- params: {
127
- block_id: string;
128
- };
129
- };
130
- getAttestationsRewards: {
131
- params: {
132
- epoch: number;
133
- };
134
- body: ValidatorId[];
135
- };
136
- getSyncCommitteeRewards: {
146
+ getSyncCommitteeRewards: Endpoint<"POST", BlockArgs & {
147
+ /** List of validator indices or pubkeys to filter in */
148
+ validatorIds?: ValidatorId[];
149
+ }, {
137
150
  params: {
138
151
  block_id: string;
139
152
  };
140
- body: ValidatorId[];
141
- };
153
+ body: string[];
154
+ }, SyncCommitteeRewards, ExecutionOptimisticAndFinalizedMeta>;
142
155
  };
143
- export declare function getReqSerializers(): ReqSerializers<Api, ReqTypes>;
144
- export declare function getReturnTypes(): ReturnTypes<Api>;
156
+ export declare function getDefinitions(_config: ChainForkConfig): RouteDefinitions<Endpoints>;
145
157
  export {};
146
158
  //# sourceMappingURL=rewards.d.ts.map
@@ -1,77 +1,112 @@
1
+ /* eslint-disable @typescript-eslint/naming-convention */
1
2
  import { ContainerType } from "@chainsafe/ssz";
2
3
  import { ssz } from "@lodestar/types";
3
- import { Schema, ContainerDataExecutionOptimistic, ArrayOf, WithFinalized, } from "../../../utils/index.js";
4
- import { HttpStatusCode } from "../../../utils/client/httpStatusCode.js";
5
- /**
6
- * Define javascript values for each route
7
- */
8
- export const routesData = {
9
- getBlockRewards: { url: "/eth/v1/beacon/rewards/blocks/{block_id}", method: "GET" },
10
- getAttestationsRewards: { url: "/eth/v1/beacon/rewards/attestations/{epoch}", method: "POST" },
11
- getSyncCommitteeRewards: { url: "/eth/v1/beacon/rewards/sync_committee/{block_id}", method: "POST" },
12
- };
13
- export function getReqSerializers() {
4
+ import { Schema } from "../../../utils/index.js";
5
+ import { fromValidatorIdsStr, toValidatorIdsStr } from "../../../utils/serdes.js";
6
+ import { ArrayOf, JsonOnlyReq } from "../../../utils/codecs.js";
7
+ import { ExecutionOptimisticAndFinalizedCodec } from "../../../utils/metadata.js";
8
+ // See /packages/api/src/routes/index.ts for reasoning and instructions to add new routes
9
+ const BlockRewardsType = new ContainerType({
10
+ /** Proposer of the block, the proposer index who receives these rewards */
11
+ proposerIndex: ssz.ValidatorIndex,
12
+ /** Total block reward, equal to attestations + sync_aggregate + proposer_slashings + attester_slashings */
13
+ total: ssz.UintNum64,
14
+ /** Block reward component due to included attestations */
15
+ attestations: ssz.UintNum64,
16
+ /** Block reward component due to included sync_aggregate */
17
+ syncAggregate: ssz.UintNum64,
18
+ /** Block reward component due to included proposer_slashings */
19
+ proposerSlashings: ssz.UintNum64,
20
+ /** Block reward component due to included attester_slashings */
21
+ attesterSlashings: ssz.UintNum64,
22
+ }, { jsonCase: "eth2" });
23
+ const AttestationsRewardType = new ContainerType({
24
+ /** Reward for head vote. Could be negative to indicate penalty */
25
+ head: ssz.UintNum64,
26
+ /** Reward for target vote. Could be negative to indicate penalty */
27
+ target: ssz.UintNum64,
28
+ /** Reward for source vote. Could be negative to indicate penalty */
29
+ source: ssz.UintNum64,
30
+ /** Inclusion delay reward (phase0 only) */
31
+ inclusionDelay: ssz.UintNum64,
32
+ /** Inactivity penalty. Should be a negative number to indicate penalty */
33
+ inactivity: ssz.UintNum64,
34
+ }, { jsonCase: "eth2" });
35
+ const IdealAttestationsRewardsType = new ContainerType({
36
+ ...AttestationsRewardType.fields,
37
+ effectiveBalance: ssz.UintNum64,
38
+ }, { jsonCase: "eth2" });
39
+ const TotalAttestationsRewardsType = new ContainerType({
40
+ ...AttestationsRewardType.fields,
41
+ validatorIndex: ssz.ValidatorIndex,
42
+ }, { jsonCase: "eth2" });
43
+ const AttestationsRewardsType = new ContainerType({
44
+ idealRewards: ArrayOf(IdealAttestationsRewardsType),
45
+ totalRewards: ArrayOf(TotalAttestationsRewardsType),
46
+ }, { jsonCase: "eth2" });
47
+ const SyncCommitteeRewardsType = ArrayOf(new ContainerType({
48
+ validatorIndex: ssz.ValidatorIndex,
49
+ reward: ssz.UintNum64,
50
+ }, { jsonCase: "eth2" }));
51
+ export function getDefinitions(_config) {
14
52
  return {
15
53
  getBlockRewards: {
16
- writeReq: (block_id) => ({ params: { block_id: String(block_id) } }),
17
- parseReq: ({ params }) => [params.block_id],
18
- schema: { params: { block_id: Schema.StringRequired } },
54
+ url: "/eth/v1/beacon/rewards/blocks/{block_id}",
55
+ method: "GET",
56
+ req: {
57
+ writeReq: ({ blockId }) => ({ params: { block_id: blockId.toString() } }),
58
+ parseReq: ({ params }) => ({ blockId: params.block_id }),
59
+ schema: { params: { block_id: Schema.StringRequired } },
60
+ },
61
+ resp: {
62
+ data: BlockRewardsType,
63
+ meta: ExecutionOptimisticAndFinalizedCodec,
64
+ },
19
65
  },
20
66
  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,
67
+ url: "/eth/v1/beacon/rewards/attestations/{epoch}",
68
+ method: "POST",
69
+ req: JsonOnlyReq({
70
+ writeReqJson: ({ epoch, validatorIds }) => ({
71
+ params: { epoch },
72
+ body: toValidatorIdsStr(validatorIds) || [],
73
+ }),
74
+ parseReqJson: ({ params, body }) => ({
75
+ epoch: params.epoch,
76
+ validatorIds: fromValidatorIdsStr(body),
77
+ }),
78
+ schema: {
79
+ params: { epoch: Schema.UintRequired },
80
+ body: Schema.UintOrStringArray,
81
+ },
82
+ }),
83
+ resp: {
84
+ data: AttestationsRewardsType,
85
+ meta: ExecutionOptimisticAndFinalizedCodec,
26
86
  },
27
87
  },
28
88
  getSyncCommitteeRewards: {
29
- writeReq: (block_id, validatorIds) => ({ params: { block_id: String(block_id) }, body: validatorIds || [] }),
30
- parseReq: ({ params, body }) => [params.block_id, body],
31
- schema: {
32
- params: { block_id: Schema.StringRequired },
33
- body: Schema.UintOrStringArray,
89
+ url: "/eth/v1/beacon/rewards/sync_committee/{block_id}",
90
+ method: "POST",
91
+ req: JsonOnlyReq({
92
+ writeReqJson: ({ blockId, validatorIds }) => ({
93
+ params: { block_id: blockId.toString() },
94
+ body: toValidatorIdsStr(validatorIds) || [],
95
+ }),
96
+ parseReqJson: ({ params, body }) => ({
97
+ blockId: params.block_id,
98
+ validatorIds: fromValidatorIdsStr(body),
99
+ }),
100
+ schema: {
101
+ params: { block_id: Schema.StringRequired },
102
+ body: Schema.UintOrStringArray,
103
+ },
104
+ }),
105
+ resp: {
106
+ data: SyncCommitteeRewardsType,
107
+ meta: ExecutionOptimisticAndFinalizedCodec,
34
108
  },
35
109
  },
36
110
  };
37
111
  }
38
- export function getReturnTypes() {
39
- const BlockRewardsResponse = new ContainerType({
40
- proposerIndex: ssz.ValidatorIndex,
41
- total: ssz.UintNum64,
42
- attestations: ssz.UintNum64,
43
- syncAggregate: ssz.UintNum64,
44
- proposerSlashings: ssz.UintNum64,
45
- attesterSlashings: ssz.UintNum64,
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" });
67
- const SyncCommitteeRewardsResponse = new ContainerType({
68
- validatorIndex: ssz.ValidatorIndex,
69
- reward: ssz.UintNum64,
70
- }, { jsonCase: "eth2" });
71
- return {
72
- getBlockRewards: WithFinalized(ContainerDataExecutionOptimistic(BlockRewardsResponse)),
73
- getAttestationsRewards: WithFinalized(ContainerDataExecutionOptimistic(AttestationsRewardsResponse)),
74
- getSyncCommitteeRewards: WithFinalized(ContainerDataExecutionOptimistic(ArrayOf(SyncCommitteeRewardsResponse))),
75
- };
76
- }
77
112
  //# 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,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,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,CAAC,EAAC,MAAM,EAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;YACzC,MAAM,EAAE,EAAC,MAAM,EAAE,EAAC,QAAQ,EAAE,MAAM,CAAC,cAAc,EAAC,EAAC;SACpD;QACD,sBAAsB,EAAE;YACtB,QAAQ,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,CAAC,CAAC,EAAC,MAAM,EAAE,EAAC,KAAK,EAAE,KAAK,EAAC,EAAE,IAAI,EAAE,YAAY,IAAI,E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