add REST call signatures for getStateRandao and getNextWithdrawals (#5033)

This commit is contained in:
tersec 2023-06-06 10:01:05 +00:00 committed by GitHub
parent fc833d40f6
commit 58e3de3bf2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 30 additions and 2 deletions

View File

@ -86,6 +86,12 @@ proc getStateValidatorBalances*(state_id: StateIdent
meth: MethodGet.}
## https://ethereum.github.io/beacon-APIs/#/Beacon/getStateValidators
proc getStateRandao*(state_id: StateIdent
): RestResponse[GetStateRandaoResponse] {.
rest, endpoint: "/eth/v1/beacon/states/{state_id}/randao",
meth: MethodGet.}
## https://ethereum.github.io/beacon-APIs/#/Beacon/getStateRandao
proc getEpochCommittees*(state_id: StateIdent, epoch: Option[Epoch],
): RestResponse[GetEpochCommitteesResponse] {.
rest, endpoint: "/eth/v1/beacon/states/{state_id}/committees",

View File

@ -9,7 +9,7 @@
import
chronos, presto/client,
"."/[
rest_beacon_calls, rest_config_calls, rest_debug_calls,
rest_beacon_calls, rest_builder_calls, rest_config_calls, rest_debug_calls,
rest_keymanager_calls, rest_light_client_calls,
rest_node_calls, rest_validator_calls,
rest_nimbus_calls, rest_common
@ -17,7 +17,7 @@ import
export
chronos, client,
rest_beacon_calls, rest_config_calls, rest_debug_calls,
rest_beacon_calls, rest_builder_calls, rest_config_calls, rest_debug_calls,
rest_keymanager_calls, rest_light_client_calls,
rest_node_calls, rest_validator_calls,
rest_nimbus_calls, rest_common

View File

@ -0,0 +1,20 @@
# Copyright (c) 2023 Status Research & Development GmbH
# Licensed and distributed under either of
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
# at your option. This file may not be copied, modified, or distributed except according to those terms.
{.push raises: [].}
import
chronos, presto/client, chronicles,
".."/[helpers, forks, eth2_ssz_serialization],
"."/[rest_types, rest_common, eth2_rest_serialization]
export chronos, client, rest_types, eth2_rest_serialization
proc getNextWithdrawals*(state_id: StateIdent
): RestResponse[GetNextWithdrawalsResponse] {.
rest, endpoint: "/eth/v1/builder/states/{state_id}/expected_withdrawals",
meth: MethodGet.}
## https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.4.0#/Builder/getNextWithdrawals

View File

@ -672,6 +672,8 @@ type
GetStateValidatorBalancesResponse* = DataEnclosedObject[seq[RestValidatorBalance]]
GetStateValidatorResponse* = DataEnclosedObject[RestValidator]
GetStateValidatorsResponse* = DataOptimisticObject[seq[RestValidator]]
GetStateRandaoResponse* = DataOptimisticObject[RestEpochRandao]
GetNextWithdrawalsResponse* = DataOptimisticObject[seq[Withdrawal]]
GetSyncCommitteeDutiesResponse* = DataOptimisticObject[seq[RestSyncCommitteeDuty]]
GetSyncingStatusResponse* = DataEnclosedObject[RestSyncInfo]
GetVersionResponse* = DataEnclosedObject[RestNodeVersion]