use crate::pattern::Pattern;
#[derive(Debug, Clone)]
pub struct KeyExport {
pub label: String,
pub value: String,
pub hint: Option<String>,
}
#[derive(Debug, Clone)]
pub struct KeypairResult {
pub address: String,
pub exports: Vec<KeyExport>,
}
pub enum GrindAttempt {
Solana(solana_sdk::signature::Keypair),
Secret32([u8; 32]),
}
pub trait ChainGrinder: Send + Sync + Clone {
fn id(&self) -> &'static str;
fn display_name(&self) -> &'static str;
fn grind_attempt(&self) -> (String, GrindAttempt);
fn finalize(&self, attempt: GrindAttempt) -> KeypairResult;
fn build_pattern(
&self,
prefix: Option<&str>,
suffix: Option<&str>,
exact: bool,
) -> Result<Pattern, String>;
fn expected_attempts(&self, pattern: &Pattern) -> f64;
fn matches(&self, address: &str, pattern: &Pattern) -> bool;
fn supports_exact_case(&self) -> bool;
fn pattern_hint(&self) -> &'static str;
}