alloy_rpc_types_beacon/lib.rs
1#![doc = include_str!("../README.md")]
2#![doc(
3 html_logo_url = "https://raw.githubusercontent.com/alloy-rs/core/main/assets/alloy.jpg",
4 html_favicon_url = "https://raw.githubusercontent.com/alloy-rs/core/main/assets/favicon.ico"
5)]
6#![cfg_attr(not(test), warn(unused_crate_dependencies))]
7#![cfg_attr(docsrs, feature(doc_cfg))]
8
9use alloy_primitives::FixedBytes;
10use constants::{BLS_PUBLIC_KEY_BYTES_LEN, BLS_SIGNATURE_BYTES_LEN};
11
12/// Constants used in the Beacon API.
13pub mod constants;
14
15// -- Beacon endpoint types --
16
17/// Types for the [`/eth/v2/beacon/blocks`](https://ethereum.github.io/beacon-APIs/#/Beacon) endpoints.
18pub mod block;
19
20/// Types for the [`/eth/v1/beacon/headers`](https://ethereum.github.io/beacon-APIs/#/Beacon) endpoints.
21pub mod header;
22
23/// Types for the [`/eth/v1/beacon/states`](https://ethereum.github.io/beacon-APIs/#/Beacon) endpoints.
24pub mod state;
25
26/// Types for the [`/eth/v1/beacon/states/{state_id}/fork`](https://ethereum.github.io/beacon-APIs/#/Beacon/getStateFork) endpoint.
27pub mod fork;
28
29/// Types for the [`/eth/v1/beacon/states/{state_id}/validators`](https://ethereum.github.io/beacon-APIs/#/Beacon) endpoints.
30pub mod validator;
31
32/// Types for the [`/eth/v1/beacon/genesis`](https://ethereum.github.io/beacon-APIs/#/Beacon/getGenesis) endpoint.
33pub mod genesis;
34
35/// Types for the beacon block payload and builder API.
36pub mod payload;
37
38/// Types for the [`/eth/v1/beacon/blob_sidecars`](https://ethereum.github.io/beacon-APIs/#/Beacon/getBlobSidecars) endpoint.
39pub mod sidecar;
40
41// -- Config endpoint types --
42
43/// Types for the [`/eth/v1/config`](https://ethereum.github.io/beacon-APIs/#/Config) endpoints.
44pub mod config;
45
46// -- Events --
47
48/// Types for the [`/eth/v1/events`](https://ethereum.github.io/beacon-APIs/#/Events/eventstream) endpoint.
49pub mod events;
50
51// -- Node endpoint types --
52
53/// Types for the [`/eth/v1/node`](https://ethereum.github.io/beacon-APIs/#/Node) endpoints.
54pub mod node;
55
56// -- Validator endpoint types --
57
58/// Types for the [`/eth/v1/validator/duties`](https://ethereum.github.io/beacon-APIs/#/Validator) endpoints.
59pub mod duties;
60
61/// Types for the [`/eth/v1/validator/duties/proposer`](https://ethereum.github.io/beacon-APIs/#/Validator/getProposerDuties) endpoint.
62pub mod proposer;
63
64// -- Relay / builder types --
65
66/// Types for the relay and builder API.
67///
68/// See also <https://flashbots.github.io/relay-specs/>
69pub mod relay;
70
71/// Types for execution requests (Electra+).
72pub mod requests;
73
74// -- Rewards endpoint types --
75
76/// Types for the [`/eth/v1/beacon/rewards`](https://ethereum.github.io/beacon-APIs/#/Rewards) endpoints.
77pub mod rewards;
78
79// -- Internal helpers --
80
81/// Withdrawal serde helpers for the beacon API format.
82pub mod withdrawals;
83
84/// BLS signature type
85pub type BlsSignature = FixedBytes<BLS_SIGNATURE_BYTES_LEN>;
86
87/// BLS public key type
88pub type BlsPublicKey = FixedBytes<BLS_PUBLIC_KEY_BYTES_LEN>;