home.rs
1 use crate::{market::MarketDataResponseWithItemGlances, unit::Currency}; 2 use candid::{CandidType, Principal}; 3 use serde::{Deserialize, Serialize}; 4 5 #[derive(thiserror::Error, Debug, CandidType, Clone, Serialize, Deserialize, PartialEq)] 6 pub enum HomePageError { 7 #[error("account (key: {0}) not found (AccontPageError::AccountNotFound)")] 8 AccountNotFound(Principal), 9 } 10 11 #[derive(CandidType, Clone, Serialize, Deserialize, Debug, Hash, Eq, PartialEq)] 12 pub struct HomePageRequest { 13 pub currency: Currency, 14 } 15 16 #[derive(CandidType, Clone, Serialize, Deserialize, Debug)] 17 pub struct HomePageResponse { 18 pub markets: Vec<MarketDataResponseWithItemGlances>, 19 }