)],
ClockSvg::new(Self::index_height(&index)?),
)
.into_response(),
)
}
async fn sat(
Extension(page_config): Extension<Arc<PageConfig>>,
Extension(index): Extension<Arc<Index>>,
Path(DeserializeFromStr(sat)): Path<DeserializeFromStr<Sat>>,
accept_json: AcceptJson,
) -> ServerResult<Response> {
let inscriptions = index.get_inscription_ids_by_sat(sat)?;
let satpoint = index.rare_sat_satpoint(sat)?.or_else(|| {
inscriptions.first().and_then(|&first_inscription_id| {
index
.get_inscription_satpoint_by_id(first_inscription_id)
.ok()
.flatten()
})
});
let blocktime = index.block_time(sat.height())?;
Ok(if accept_json.0 {
Json(SatJson {
number: sat.0,
decimal: sat.decimal().to_string(),
degree: sat.degree().to_string(),
name: sat.name(),
block: sat.height().0,
cycle: sat.cycle(),
epoch: sat.epoch().0,
period: sat.period(),