Skip to content
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
### Added

- Gateway: per-relay `blockfrost_gateway_relay_healthy`, `blockfrost_gateway_relay_data_node_up`, and `blockfrost_gateway_relay_info` metrics in `GET /metrics` (and the same data points in `GET /stats`)
- New endpoints proxied to the data node: `/accounts/{stake_address}/utxos`, `/addresses/{address}`, and `/blocks/slot/{slot_number}`
- New endpoints proxied to the data node: `/accounts/{stake_address}/utxos`, `/addresses/{address}`, `/blocks/slot/{slot_number}`, and `/pools/retiring`
- `--max-response-body-bytes` to configure the maximum proxied response body size (default 10 MiB)

### Fixed
Expand Down
9 changes: 8 additions & 1 deletion crates/data_node/src/api/pools.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::client::DataNode;
use bf_api_provider::types::{
PoolsDelegatorsResponse, PoolsHistoryResponse, PoolsListExtendedResponse,
PoolsMetadataResponse, PoolsSingleResponse,
PoolsMetadataResponse, PoolsRetiresResponse, PoolsSingleResponse,
};
use bf_common::{pagination::Pagination, types::ApiResult};

Expand All @@ -23,6 +23,13 @@ impl DataNodePools<'_> {
.await
}

pub async fn retiring(&self, pagination: &Pagination) -> ApiResult<PoolsRetiresResponse> {
self.inner
.client
.get("pools/retiring", Some(pagination))
.await
}

pub async fn delegators(
&self,
pool_id: &str,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"/accounts/{stake_address}",
"/assets/{asset}",
"/pools/extended",
"/pools/retiring",
"/pools/{pool_id}",
"/pools/{pool_id}/metadata",
"/pools/{pool_id}/delegators",
Expand Down
14 changes: 11 additions & 3 deletions crates/platform/src/api/pools/retiring.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
use crate::{BlockfrostError, api::ApiResult};
use crate::{api::ApiResult, server::state::AppState};
use axum::extract::{Query, State};
use bf_api_provider::types::PoolsRetiresResponse;
use bf_common::pagination::{Pagination, PaginationQuery};

pub async fn route() -> ApiResult<PoolsRetiresResponse> {
Err(BlockfrostError::not_found())
pub async fn route(
State(state): State<AppState>,
Query(pagination_query): Query<PaginationQuery>,
) -> ApiResult<PoolsRetiresResponse> {
let data_node = state.data_node()?;
Comment thread
michalrus marked this conversation as resolved.
let pagination = Pagination::from_query(pagination_query)?;

data_node.pools().retiring(&pagination).await
}
Loading