Skip to main content

kora_rpc/method/
get_config.rs

1use kora_lib::{config::ValidationConfig, get_signer, KoraError};
2use serde::Serialize;
3use utoipa::ToSchema;
4
5#[derive(Debug, Clone, Serialize, ToSchema)]
6pub struct GetConfigResponse {
7    pub fee_payer: String,
8    pub validation_config: ValidationConfig,
9}
10
11pub async fn get_config(validation: &ValidationConfig) -> Result<GetConfigResponse, KoraError> {
12    let signer = get_signer()
13        .map_err(|e| KoraError::SigningError(format!("Failed to get signer: {}", e)))?;
14
15    Ok(GetConfigResponse {
16        fee_payer: signer.solana_pubkey().to_string(),
17        validation_config: validation.clone(),
18    })
19}