Skip to main content

surfpool_types/
verified_tokens.rs

1use std::collections::HashMap;
2
3use once_cell::sync::Lazy;
4use serde::Deserialize;
5
6#[derive(Debug, Clone, Deserialize)]
7pub struct TokenInfo {
8    pub address: String,
9    pub name: String,
10    pub symbol: String,
11    pub decimals: u8,
12    #[serde(rename = "logoURI")]
13    pub logo_uri: Option<String>,
14}
15
16pub static VERIFIED_TOKENS_BY_SYMBOL: Lazy<HashMap<String, TokenInfo>> = Lazy::new(|| {
17    let json = include_str!("verified_tokens.json");
18    let tokens: Vec<TokenInfo> = serde_json::from_str(json).expect("invalid verified_tokens.json");
19    tokens.into_iter().map(|t| (t.symbol.clone(), t)).collect()
20});