Skip to content

Status

Get status and latest block height for all services on an endpoint.

Code

Rust
use futures::StreamExt;
use pangea_client::{ClientBuilder, WsProvider};
use std::sync::Arc;
 
#[tokio::main]
async fn main() {
    dotenvy::dotenv_override().ok();
 
    let client = match ClientBuilder::default()
        .endpoint("app.pangea.foundation")
        .build::<WsProvider>()
        .await
    {
        Ok(client) => Arc::new(client),
        Err(e) => {
            eprintln!("Client failed to initialize:\n{e}");
            return;
        }
    };
 
    let status = client.get_status().await.unwrap(); 
 
    futures::pin_mut!(status);
 
    while let Some(chunk) = status.next().await {
        println!("{:?}", chunk.unwrap());
    }
}

Response

[
  ...
  {
    "type": "Toolbox",
    "chain": 1,
    "chain_code": "ETH",
    "chain_name": "Ethereum",
    "service": "curve-tokens",
    "entity": "curve-tokens",
    "latest_block_height": 22945756,
    "timestamp": 1752837748,
    "status": "Ok"
  }
]