sat: entry.sat,
satpoint,
timestamp: timestamp(entry.timestamp),
}
.page(page_config)
.into_response()
})
}
async fn collections(
Extension(page_config): Extension<Arc<PageConfig>>,
Extension(index): Extension<Arc<Index>>,
) -> ServerResult<Response> {
Self::collections_paginated(Extension(page_config), Extension(index), Path(0)).await
}
async fn collections_paginated(
Extension(page_config): Extension<Arc<PageConfig>>,
Extension(index): Extension<Arc<Index>>,
Path(page_index): Path<usize>,
) -> ServerResult<Response> {
let (collections, more_collections) = index.get_collections_paginated(100, page_index)?;
let prev = page_index.checked_sub(1);
let next = more_collections.then_some(page_index + 1);
Ok(
CollectionsHtml {
inscriptions: collections,
prev,
next,
}
.page(page_config)
.into_response(),
)
}
async fn children(
Extension(page_config): Extension<Arc<PageConfig>>,