substreams 0.7.6

Substreams SDK - A streaming data engine for The Graph - by StreamingFast
Documentation
// @generated
// This file is @generated by prost-build.
/// Specifies which value to retrieve at a specific block
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetRequest {
    /// Block number for data retrieval
    /// Required for gRPC calls, specifies the exact block height for querying
    /// Must be left blank (0) for Substreams WASM intrinsics, runtime provides block context
    #[prost(uint64, tag="1")]
    pub block_number: u64,
    /// Block hash for data retrieval
    /// Required for gRPC calls, ensures block identity and fork-awareness
    /// Must be left blank (empty) for Substreams WASM intrinsics, runtime provides block context
    #[prost(bytes="vec", tag="2")]
    pub block_hash: ::prost::alloc::vec::Vec<u8>,
    #[prost(bool, tag="3")]
    pub omit_deleted: bool,
    #[prost(bytes="vec", tag="4")]
    pub key: ::prost::alloc::vec::Vec<u8>,
}
/// Contains the retrieved value and status
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetResponse {
    #[prost(bool, tag="3")]
    pub block_reached: bool,
    #[prost(enumeration="ResponseCode", tag="4")]
    pub code: i32,
    /// The stored value (only present when response = FOUND)
    #[prost(message, optional, tag="5")]
    pub value: ::core::option::Option<::prost_types::Any>,
}
/// Specifies multiple values to retrieve at a specific block
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAllRequest {
    /// Block number for data retrieval
    /// Required for gRPC calls, specifies the exact block height for querying
    /// Must be left blank (0) for Substreams WASM intrinsics, runtime provides block context
    #[prost(uint64, tag="1")]
    pub block_number: u64,
    /// Block hash for data retrieval
    /// Required for gRPC calls, ensures block identity and fork-awareness
    /// Must be left blank (empty) for Substreams WASM intrinsics, runtime provides block context
    #[prost(bytes="vec", tag="2")]
    pub block_hash: ::prost::alloc::vec::Vec<u8>,
    #[prost(bool, tag="3")]
    pub omit_deleted: bool,
    #[prost(bytes="vec", repeated, tag="4")]
    pub keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
}
/// Pairs a key with its individual response
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ResponseEntry {
    #[prost(bytes="vec", tag="1")]
    pub key: ::prost::alloc::vec::Vec<u8>,
    #[prost(message, optional, tag="2")]
    pub response: ::core::option::Option<GetResponse>,
}
/// Contains all retrieved entries with batch-level metadata
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAllResponse {
    #[prost(message, repeated, tag="1")]
    pub entries: ::prost::alloc::vec::Vec<ResponseEntry>,
    /// Whether the requested block has been processed by the store (applies to all entries)
    #[prost(bool, tag="2")]
    pub block_reached: bool,
}
/// Represents a key-value pair in the store used for Substreams sink operations
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Entry {
    #[prost(bytes="vec", tag="2")]
    pub key: ::prost::alloc::vec::Vec<u8>,
    #[prost(message, optional, tag="4")]
    pub value: ::core::option::Option<::prost_types::Any>,
}
/// Container for multiple key-value pairs, typically used as Substreams module output
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Entries {
    /// Collection of entries to be stored atomically at the same block number
    #[prost(message, repeated, tag="1")]
    pub entries: ::prost::alloc::vec::Vec<Entry>,
}
/// Indicates the result of a get operation with detailed status information
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ResponseCode {
    /// Default value, should not be used
    Unspecified = 0,
    /// Key exists and value was retrieved successfully
    Found = 1,
    /// Key does not exist at the requested block
    NotFound = 2,
    /// Key was deleted after finality (LIB) -> historical reference
    NotFoundFinalize = 4,
    /// Requested block number has not been processed yet (block_number > head_block)
    NotFoundBlockNotReached = 5,
}
impl ResponseCode {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            ResponseCode::Unspecified => "RESPONSE_CODE_UNSPECIFIED",
            ResponseCode::Found => "RESPONSE_CODE_FOUND",
            ResponseCode::NotFound => "RESPONSE_CODE_NOT_FOUND",
            ResponseCode::NotFoundFinalize => "RESPONSE_CODE_NOT_FOUND_FINALIZE",
            ResponseCode::NotFoundBlockNotReached => "RESPONSE_CODE_NOT_FOUND_BLOCK_NOT_REACHED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "RESPONSE_CODE_UNSPECIFIED" => Some(Self::Unspecified),
            "RESPONSE_CODE_FOUND" => Some(Self::Found),
            "RESPONSE_CODE_NOT_FOUND" => Some(Self::NotFound),
            "RESPONSE_CODE_NOT_FOUND_FINALIZE" => Some(Self::NotFoundFinalize),
            "RESPONSE_CODE_NOT_FOUND_BLOCK_NOT_REACHED" => Some(Self::NotFoundBlockNotReached),
            _ => None,
        }
    }
}
// @@protoc_insertion_point(module)