Expand description
API endpoint implementations
This module contains implementations for all Koios API endpoints, organized by category. These implementations work across all supported networks (Mainnet, Preprod, Preview, Guild).
account- Stake account related endpointsaddress- Address related endpointsasset- Asset and token related endpointsblock- Block related endpointsepoch- Epoch related endpointsgovernance- Governance related endpointsnetwork- Network related endpointsogmios- Ogmios v6 integration endpointspool- Stake pool related endpointsscript- Script related endpointstransaction- Transaction related endpoints
§Examples
Fetching account info on Mainnet:
use koios_sdk::Client;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new()?;
let stake_addresses = vec![
"stake1ux3g2c9dx2nhhehyrezyxpkstartcqmu9hk63qgfkccw5rqttygt7".to_string()
];
let account_info = client.get_account_info(&stake_addresses).await?;
println!("Account info: {:?}", account_info);
Ok(())
}Fetching account info on Preprod network:
use koios_sdk::{Client, Network};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::builder()
.network(Network::Preprod)
.build()?;
let stake_addresses = vec![
"stake_test1ux3g2c9dx2nhhehyrezyxpkstartcqmu9hk63qgfkccw5rqttygt7".to_string()
];
let account_info = client.get_account_info(&stake_addresses).await?;
println!("Account info: {:?}", account_info);
Ok(())
}