use reqwest::Client; use solana_program::pubkey::Pubkey; use crate::dto::TokenSocials; pub fn sanitize_string(s: &str) -> String { s.trim_end_matches('\0').to_string() } pub fn base58_to_pubkey(address: &str) -> anyhow::Result> { let decoded = bs58::decode(address).into_vec()?; if decoded.len() != 32 { return Err("Address must be 32 bytes long".into()); } let mut bytes = [0u8; 32]; bytes.copy_from_slice(&decoded); Ok(Pubkey::new_from_array(bytes)) } pub async fn get_token_socials(uri: &str) -> Result> { let client = Client::new(); let response = client.get(uri) .send() .await?; let json: TokenSocials = response.json().await?; Ok(json) }