#substreams #cosmos #firehose #thegraph #pinax #api-bindings

substreams-cosmos-core

Substreams development kit for Cosmos chains, contains Firehose Block model and helpers

4 releases

0.2.1 Oct 29, 2024
0.2.0 Oct 29, 2024
0.1.1 Sep 23, 2024
0.1.0 Sep 23, 2024

#985 in WebAssembly

Download history 301/week @ 2024-09-21 81/week @ 2024-09-28 3/week @ 2024-10-05 1/week @ 2024-10-19 247/week @ 2024-10-26 20/week @ 2024-11-02

268 downloads per month
Used in substreams-cosmos

MIT license

18KB
289 lines

Substreams for Cosmos

github crates.io docs.rs GitHub Workflow Status

This library contains the generated Rust protobuf bindings for Cosmos Block as well as helper methods to extract and parse block data.

📖 Documentation

https://docs.rs/substreams-cosmos

Further resources

Install

cargo add substreams-cosmos

Usage

Refer to Docs.rs for helper methods on Block that extract action and transaction iterators from the Cosmos block.

Cargo.toml

[dependencies]
substreams = "0.5"
substreams-cosmos = "0.1"

src/lib.rs

use substreams::errors::Error;
use substreams_cosmos::pb::{Block, Events};

#[substreams::handlers::map]
fn map_events(block: Block) -> Result<Events, Error> {
    let mut events = vec![];

    for tx in block.tx_results {
        for event in tx.events {
            events.push(event);
        }
    }
    Ok(Events { events })
}

Release

Dependencies

~4.5–7.5MB
~129K SLoC