#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash, Deserialize)]
pub enum AssetClass {
Commodity,
Cryptocurrency,
Cryptoindex,
Etf,
Metal,
Stock,
}
impl ToString for AssetClass {
fn to_string(&self) -> String {
match self {
Self::Commodity => "etc",
Self::Cryptocurrency => "cryptocoin",
Self::Cryptoindex => "cryptocoin",
Self::Etf => "etf",
Self::Metal => "metal",
Self::Stock => "stock",
}
.to_string()
}
}
#[derive(Debug, Clone, Hash, Deserialize, PartialEq, Eq)]
pub struct Asset {
pub id: String,
pub pid: String,
pub name: String,
pub symbol: String,
pub r#type: AssetClass,
}