Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

paginate_blocks

Fetch every record in the indexer's blocks connection, paginating forward.

Signature

pub async fn paginate_blocks(
    &self,
    page_size: i64,
    variables: blocks::Variables,
) -> Result<Vec<blocks::BlocksBlocksNodes>, anyhow::Error>;

Example

use {
    anyhow::Result,
    dango_sdk::{HttpClient, blocks},
};
 
#[tokio::main]
async fn main() -> Result<()> {
    let client = HttpClient::new("https://api-mainnet.dango.zone")?;
 
    let blocks = client
        .paginate_blocks(100, blocks::Variables::default())
        .await?;
 
    println!("{} blocks", blocks.len());
    Ok(())
}

Parameters

page_sizei64. Items per request. Indexer caps first at 100.

variablesblocks::Variables. Filters (height range, …); pagination fields are overwritten.

Returns

Vec<blocks::BlocksBlocksNodes> — every block matching the filter.

See also