titan_types/
subscription.rs

1use {
2    super::EventType,
3    borsh::{BorshDeserialize, BorshSerialize},
4    serde::{Deserialize, Serialize},
5    uuid::Uuid,
6};
7
8#[derive(Debug, Clone, Serialize, Deserialize, BorshSerialize, BorshDeserialize)]
9pub struct Subscription {
10    pub id: Uuid,
11    pub endpoint: String,
12    pub event_types: Vec<EventType>,
13    pub last_success_epoch_secs: u64,
14}
15
16/// The expected subscription request from the TCP client.
17/// For example, the client should send:
18///   {"subscribe": ["RuneEtched", "RuneMinted"]}
19#[derive(Debug, Serialize, Deserialize)]
20pub struct TcpSubscriptionRequest {
21    pub subscribe: Vec<EventType>,
22}