pump-dump 0.1.0

A CLI tool for inspecting Pump.fun pools, events, and transactions on Solana
use yansi::hyperlink::HyperlinkExt;
use yansi::hyperlink::PaintedLink;

#[allow(dead_code)]
pub trait SolanaLinks {
    fn tx(&self) -> PaintedLink<&Self>;
    fn acc(&self) -> PaintedLink<&Self>;
    fn link_to(&self, name: impl ToString) -> String;
}

impl<T: std::fmt::Display> SolanaLinks for T {
    fn tx(&self) -> PaintedLink<&Self> {
        self.link(format!("https://solscan.io/account/{}", self))
    }
    fn acc(&self) -> PaintedLink<&Self> {
        self.link(format!("https://solscan.io/account/{}", self))
    }
    fn link_to(&self, name: impl ToString) -> String {
        name.to_string().link(self).to_string()
    }
}