static ref RUNE_ID: Regex = Regex::new(r"^[0-9]+/[0-9]+$").unwrap(); } let query = query.trim(); if HASH.is_match(query) { if index.block_header(query.parse().unwrap())?.is_some() { Ok(Redirect::to(&format!("/block/{query}"))) } else { Ok(Redirect::to(&format!("/tx/{query}"))) } } else if OUTPOINT.is_match(query) { Ok(Redirect::to(&format!("/output/{query}"))) } else if INSCRIPTION_ID.is_match(query) { Ok(Redirect::to(&format!("/inscription/{query}"))) } else if RUNE.is_match(query) { Ok(Redirect::to(&format!("/rune/{query}"))) } else if RUNE_ID.is_match(query) { let id = query .parse::<RuneId>() .map_err(|err| ServerError::BadRequest(err.to_string()))?; let rune = index.get_rune_by_id(id)?.ok_or_not_found(|| "rune ID")?; Ok(Redirect::to(&format!("/rune/{rune}"))) } else { Ok(Redirect::to(&format!("/sat/{query}"))) } } async fn favicon(user_agent: Option<TypedHeader<UserAgent>>) -> ServerResult<Response> {
Inscription number 44,975,859
Genesis block 819,047
File type text
File size 1.04 KB
Creation date Nov 29,2023 11:36 pm