tempo_node/rpc/token/
role_history.rs

1use alloy_primitives::{Address, B256, BlockNumber, TxHash};
2use serde::{Deserialize, Serialize};
3use tempo_alloy::rpc::pagination::FilterRange;
4
5#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
6#[serde(rename_all = "camelCase")]
7pub struct RoleHistoryResponse {
8    /// Cursor for next page, null if no more results
9    pub next_cursor: Option<String>,
10    /// Array of items matching the input query
11    pub role_changes: Vec<RoleChange>,
12}
13
14#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
15#[serde(rename_all = "camelCase")]
16pub struct RoleHistoryFilters {
17    /// Filter by account address that received/lost role
18    pub account: Option<Address>,
19    /// Block number in range
20    pub block_number: Option<FilterRange<BlockNumber>>,
21    /// Filter by granted vs revoked (true = grants, false = revocations)
22    pub granted: Option<bool>,
23    /// Filter by specific role (32-byte hex)
24    pub role: Option<B256>,
25    /// Filter by address that made the change
26    pub sender: Option<Address>,
27    /// Timestamp (seconds) in range
28    pub timestamp: Option<FilterRange<u64>>,
29    /// Filter by token address
30    pub token: Option<Address>,
31}
32
33#[derive(Clone, Debug, Default, PartialEq, Eq, Hash, Serialize, Deserialize)]
34#[serde(rename_all = "camelCase")]
35pub struct RoleChange {
36    /// Account that received/lost the role
37    pub account: Address,
38    /// Block number where change occurred
39    pub block_number: BlockNumber,
40    /// Whether role was granted (true) or revoked (false)
41    pub granted: bool,
42    /// Role identifier (32-byte hex)
43    pub role: B256,
44    /// Address that made the change
45    pub sender: Address,
46    /// Timestamp of the change
47    pub timestamp: u64,
48    /// Token address
49    pub token: Address,
50    /// Transaction hash
51    pub transaction_hash: TxHash,
52}