2023-06-01 11:22:49 +00:00
|
|
|
package beacon
|
|
|
|
|
|
|
|
import (
|
2023-10-18 15:09:38 +00:00
|
|
|
"encoding/json"
|
|
|
|
|
2023-08-18 14:29:40 +00:00
|
|
|
"github.com/prysmaticlabs/prysm/v4/beacon-chain/rpc/eth/shared"
|
2023-06-01 11:22:49 +00:00
|
|
|
)
|
|
|
|
|
2023-08-22 06:18:02 +00:00
|
|
|
type BlockRootResponse struct {
|
2023-12-04 11:55:21 +00:00
|
|
|
Data *BlockRoot `json:"data"`
|
|
|
|
ExecutionOptimistic bool `json:"execution_optimistic"`
|
|
|
|
Finalized bool `json:"finalized"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type BlockRoot struct {
|
|
|
|
Root string `json:"root"`
|
2023-08-22 06:18:02 +00:00
|
|
|
}
|
|
|
|
|
2023-09-13 17:29:32 +00:00
|
|
|
type GetCommitteesResponse struct {
|
|
|
|
Data []*shared.Committee `json:"data"`
|
|
|
|
ExecutionOptimistic bool `json:"execution_optimistic"`
|
|
|
|
Finalized bool `json:"finalized"`
|
|
|
|
}
|
|
|
|
|
2023-08-18 14:29:40 +00:00
|
|
|
type ListAttestationsResponse struct {
|
|
|
|
Data []*shared.Attestation `json:"data"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type SubmitAttestationsRequest struct {
|
2023-09-01 17:58:50 +00:00
|
|
|
Data []*shared.Attestation `json:"data"`
|
2023-08-18 14:29:40 +00:00
|
|
|
}
|
|
|
|
|
2023-08-23 07:51:03 +00:00
|
|
|
type ListVoluntaryExitsResponse struct {
|
2023-09-01 17:58:50 +00:00
|
|
|
Data []*shared.SignedVoluntaryExit `json:"data"`
|
2023-06-01 11:22:49 +00:00
|
|
|
}
|
|
|
|
|
2023-09-01 17:58:50 +00:00
|
|
|
type SubmitSyncCommitteeSignaturesRequest struct {
|
|
|
|
Data []*shared.SyncCommitteeMessage `json:"data"`
|
2023-06-01 11:22:49 +00:00
|
|
|
}
|
2023-09-11 18:57:17 +00:00
|
|
|
|
|
|
|
type GetStateForkResponse struct {
|
|
|
|
Data *shared.Fork `json:"data"`
|
|
|
|
ExecutionOptimistic bool `json:"execution_optimistic"`
|
|
|
|
Finalized bool `json:"finalized"`
|
|
|
|
}
|
2023-09-15 10:05:35 +00:00
|
|
|
|
2023-09-19 17:53:45 +00:00
|
|
|
type GetFinalityCheckpointsResponse struct {
|
|
|
|
ExecutionOptimistic bool `json:"execution_optimistic"`
|
|
|
|
Finalized bool `json:"finalized"`
|
|
|
|
Data *FinalityCheckpoints `json:"data"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type FinalityCheckpoints struct {
|
|
|
|
PreviousJustified *shared.Checkpoint `json:"previous_justified"`
|
|
|
|
CurrentJustified *shared.Checkpoint `json:"current_justified"`
|
|
|
|
Finalized *shared.Checkpoint `json:"finalized"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type GetGenesisResponse struct {
|
|
|
|
Data *Genesis `json:"data"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type Genesis struct {
|
|
|
|
GenesisTime string `json:"genesis_time"`
|
|
|
|
GenesisValidatorsRoot string `json:"genesis_validators_root"`
|
|
|
|
GenesisForkVersion string `json:"genesis_fork_version"`
|
|
|
|
}
|
|
|
|
|
2023-09-15 10:05:35 +00:00
|
|
|
type GetBlockHeadersResponse struct {
|
|
|
|
Data []*shared.SignedBeaconBlockHeaderContainer `json:"data"`
|
|
|
|
ExecutionOptimistic bool `json:"execution_optimistic"`
|
|
|
|
Finalized bool `json:"finalized"`
|
|
|
|
}
|
2023-09-20 19:06:11 +00:00
|
|
|
|
|
|
|
type GetBlockHeaderResponse struct {
|
|
|
|
ExecutionOptimistic bool `json:"execution_optimistic"`
|
|
|
|
Finalized bool `json:"finalized"`
|
|
|
|
Data *shared.SignedBeaconBlockHeaderContainer `json:"data"`
|
|
|
|
}
|
2023-09-21 18:16:59 +00:00
|
|
|
|
2023-11-22 17:30:52 +00:00
|
|
|
type GetValidatorsRequest struct {
|
|
|
|
Ids []string `json:"ids"`
|
|
|
|
Statuses []string `json:"statuses"`
|
|
|
|
}
|
|
|
|
|
2023-09-21 18:16:59 +00:00
|
|
|
type GetValidatorsResponse struct {
|
|
|
|
ExecutionOptimistic bool `json:"execution_optimistic"`
|
|
|
|
Finalized bool `json:"finalized"`
|
|
|
|
Data []*ValidatorContainer `json:"data"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type GetValidatorResponse struct {
|
|
|
|
ExecutionOptimistic bool `json:"execution_optimistic"`
|
|
|
|
Finalized bool `json:"finalized"`
|
|
|
|
Data *ValidatorContainer `json:"data"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type GetValidatorBalancesResponse struct {
|
|
|
|
ExecutionOptimistic bool `json:"execution_optimistic"`
|
|
|
|
Finalized bool `json:"finalized"`
|
|
|
|
Data []*ValidatorBalance `json:"data"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type ValidatorContainer struct {
|
|
|
|
Index string `json:"index"`
|
|
|
|
Balance string `json:"balance"`
|
|
|
|
Status string `json:"status"`
|
|
|
|
Validator *Validator `json:"validator"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type Validator struct {
|
|
|
|
Pubkey string `json:"pubkey"`
|
|
|
|
WithdrawalCredentials string `json:"withdrawal_credentials"`
|
|
|
|
EffectiveBalance string `json:"effective_balance"`
|
|
|
|
Slashed bool `json:"slashed"`
|
|
|
|
ActivationEligibilityEpoch string `json:"activation_eligibility_epoch"`
|
|
|
|
ActivationEpoch string `json:"activation_epoch"`
|
|
|
|
ExitEpoch string `json:"exit_epoch"`
|
|
|
|
WithdrawableEpoch string `json:"withdrawable_epoch"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type ValidatorBalance struct {
|
|
|
|
Index string `json:"index"`
|
|
|
|
Balance string `json:"balance"`
|
|
|
|
}
|
2023-10-11 14:08:06 +00:00
|
|
|
|
2023-10-18 15:09:38 +00:00
|
|
|
type GetBlockResponse struct {
|
|
|
|
Data *SignedBlock `json:"data"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type GetBlockV2Response struct {
|
|
|
|
Version string `json:"version"`
|
|
|
|
ExecutionOptimistic bool `json:"execution_optimistic"`
|
|
|
|
Finalized bool `json:"finalized"`
|
|
|
|
Data *SignedBlock `json:"data"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type SignedBlock struct {
|
|
|
|
Message json.RawMessage `json:"message"` // represents the block values based on the version
|
|
|
|
Signature string `json:"signature"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type GetBlockAttestationsResponse struct {
|
|
|
|
ExecutionOptimistic bool `json:"execution_optimistic"`
|
|
|
|
Finalized bool `json:"finalized"`
|
|
|
|
Data []*shared.Attestation `json:"data"`
|
|
|
|
}
|
|
|
|
|
2023-10-12 17:53:33 +00:00
|
|
|
type GetStateRootResponse struct {
|
|
|
|
ExecutionOptimistic bool `json:"execution_optimistic"`
|
|
|
|
Finalized bool `json:"finalized"`
|
|
|
|
Data *StateRoot `json:"data"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type StateRoot struct {
|
|
|
|
Root string `json:"root"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type GetRandaoResponse struct {
|
|
|
|
ExecutionOptimistic bool `json:"execution_optimistic"`
|
|
|
|
Finalized bool `json:"finalized"`
|
|
|
|
Data *Randao `json:"data"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type Randao struct {
|
|
|
|
Randao string `json:"randao"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type GetSyncCommitteeResponse struct {
|
|
|
|
ExecutionOptimistic bool `json:"execution_optimistic"`
|
|
|
|
Finalized bool `json:"finalized"`
|
|
|
|
Data *SyncCommitteeValidators `json:"data"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type SyncCommitteeValidators struct {
|
|
|
|
Validators []string `json:"validators"`
|
|
|
|
ValidatorAggregates [][]string `json:"validator_aggregates"`
|
|
|
|
}
|
|
|
|
|
2023-10-11 14:08:06 +00:00
|
|
|
type BLSToExecutionChangesPoolResponse struct {
|
|
|
|
Data []*shared.SignedBLSToExecutionChange `json:"data"`
|
|
|
|
}
|
2023-11-13 17:22:39 +00:00
|
|
|
|
|
|
|
type GetAttesterSlashingsResponse struct {
|
|
|
|
Data []*shared.AttesterSlashing `json:"data"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type GetProposerSlashingsResponse struct {
|
|
|
|
Data []*shared.ProposerSlashing `json:"data"`
|
|
|
|
}
|