substreams-antelope 0.1.0

Substreams for Antelope
Documentation

Substreams for Antelope

This library contains the generated protobuffer for the Antelope blocks as well as helper methods to extract and parse block data.

📖 Documentation

https://docs.rs/substreams-antelope

Further resources

🛠 Feature Roadmap

  • Antelope blocks
  • Block helper methods
    • all_transaction_traces
    • executed_transaction_traces
    • transaction_traces_count
    • executed_input_action_count
    • executed_total_action_count

Install

$ cargo add substreams-antelope

Quickstart

Cargo.toml

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

src/lib.rs

use substreams::prelude::*;
use substreams::errors::Error;
use substreams_antelope::{Block, ActionTraces};

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

    for trx in block.clone().all_transaction_traces() {
        for trace in trx.action_traces.clone() {
            action_traces.push(trace);
        }
    }
    Ok(ActionTraces { action_traces })
}