Package Logo
injective_common
injective-common@v0.2.4
Total Downloads
3112
Published
1 months ago
Network
injective-mainnet injective-mainnet
Publisher
User Avatar streamingfast

Readme

injective-common

Common Injective Substreams modules to extract events and transactions with indexing This package inherits from the generic Cosmos Foundational Modules.

Usage

Usually, foundational modules are directly imported and used in other Substreams. All the official foundational modules are stored in substreams.dev.

specVersion: v0.1.0
package:
  name: my_project
  version: v0.1.0

imports:
  injective: https://spkg.io/streamingfast/injective-common-v0.2.4.spkg # Import the package from substreams.dev

modules:
  - name: my_events # Define your Substreams module
    use: injective:filtered_events # Use the imported package
    initialBlock: 70000000

params:
  my_events: "(type:message && attr:action) || (type:wasm && attr:_contract_address)" # Pass the filter as parameter to the module

To run the Substreams:

substreams build
substreams auth
substreams gui

Modules

all_events (map)

Retrieves all the events in the Injective blockchain without any filtering.

index_events (index)

The module create an index (a cache) to efficiently retrieve events by their type and/or attribute keys.

The module sets the keys corresponding to all event 'types' and 'attribute keys' in the block For example: type:coin_received, attr:action, attr:sender ...

The attribute values are never indexed because they have a high cardinality and would be too expensive to index.

filtered_events (map)

The module reads from all_events and applies a filter on the event types and attribute keys, only outputing the events that match the filter.

The filter is specificed in the parameters of the module.

...

params:
  filtered_events: "(type:rewards && attr:validator)"

filtered_event_groups (map)

The module reads from all_events and applies a filter on the event types and attribute keys, outputing all the events from transactions that have at least one event matching the filter.

params:
    filtered_event_groups: "type:rewards && attr:validator"

filtered_events_by_attribute_value (map)

The module reads from all_events and applies a filter on the event types, attribute keys and values, only outputing the events that match the filter.

NOTE: This module does not use the index created by index_events.

params:
    filtered_events_by_attribute_value: "type:wasm && attr:_contract_address:inj1v77y5ttah96dc9qkcpc88ad7rce8n88e99t3m5"

filtered_event_groups_by_attribute_value (map)

The module reads from all_events and applies a filter on the event types, attribute keys and values, outputing all the events from transactions that have at least one event matching the filter.

NOTE: This module does not use the index created by index_events.

params:
    filtered_event_groups_by_attribute_value: "type:wasm && attr:_contract_address:inj1v77y5ttah96dc9qkcpc88ad7rce8n88e99t3m5"

Documentation

Modules

Maps icon
Maps

map
all_events

e6789527fab90caa67cdf81b81c8ed8a0013cb3d
map all_events (
blocksf.cosmos.type.v2.Block
)  -> sf.substreams.cosmos.v1.EventList
substreams gui injective-common@v0.2.4 all_events

map
filtered_events

19e44deeee79623bd57e31f40dc91294a2c23387
Default param : (type:message && attr:action) || (type:wasm && attr:_contract_address)
substreams gui injective-common@v0.2.4 filtered_events

map
filtered_event_groups

e875777893ffaa13b599d696a64992d70d724c66
Default param : type:wasm && attr:_contract_address
substreams gui injective-common@v0.2.4 filtered_event_groups

map
filtered_events_by_attribute_value

841924ea4cd884a8b60bfdb30be0fd252e7f82a1
map filtered_events_by_attribute_value (
paramsstring
)  -> sf.substreams.cosmos.v1.EventList
Default param : type:wasm && attr:_contract_address:inj1v77y5ttah96dc9qkcpc88ad7rce8n88e99t3m5
substreams gui injective-common@v0.2.4 filtered_events_by_attribute_value

map
filtered_event_groups_by_attribute_value

134bc6fe848c6b59c597b6bb60b72c959b38425a
map filtered_event_groups_by_attribute_value (
paramsstring
)  -> sf.substreams.cosmos.v1.EventList
Default param : type:wasm && attr:_contract_address:inj1v77y5ttah96dc9qkcpc88ad7rce8n88e99t3m5
substreams gui injective-common@v0.2.4 filtered_event_groups_by_attribute_value

map
cosmos:all_events

e6789527fab90caa67cdf81b81c8ed8a0013cb3d

all_events reads from the sf.cosmos.type.v2.Block source and outputs a list of all events in the block. Some events are at the block level, others appear inside the transactions.

substreams gui injective-common@v0.2.4 cosmos:all_events

map
cosmos:filtered_events

8440f1c02467940f2c27b0ab106f1aba327f9c18
Default param : (type:message && attr:action) || (type:wasm && attr:_contract_address)
substreams gui injective-common@v0.2.4 cosmos:filtered_events

map
cosmos:filtered_event_groups

bf36921328c30ec6d879d2444c3fa561256b5ff1
Default param : type:wasm && attr:_contract_address
substreams gui injective-common@v0.2.4 cosmos:filtered_event_groups

map
cosmos:filtered_events_by_attribute_value

841924ea4cd884a8b60bfdb30be0fd252e7f82a1
map cosmos:filtered_events_by_attribute_value (
paramsstring
)  -> sf.substreams.cosmos.v1.EventList
Default param : type:wasm && attr:_contract_address:inj1v77y5ttah96dc9qkcpc88ad7rce8n88e99t3m5
substreams gui injective-common@v0.2.4 cosmos:filtered_events_by_attribute_value

map
cosmos:filtered_event_groups_by_attribute_value

134bc6fe848c6b59c597b6bb60b72c959b38425a
map cosmos:filtered_event_groups_by_attribute_value (
paramsstring
)  -> sf.substreams.cosmos.v1.EventList
Default param : type:wasm && attr:_contract_address:inj1v77y5ttah96dc9qkcpc88ad7rce8n88e99t3m5
substreams gui injective-common@v0.2.4 cosmos:filtered_event_groups_by_attribute_value
Block Indexes icon
Block Indexes

blockIndex
index_events

0d0e90210ce048a30e50747536bf611d6c2edc0e
substreams gui injective-common@v0.2.4 index_events

blockIndex
cosmos:index_events

0d0e90210ce048a30e50747536bf611d6c2edc0e
substreams gui injective-common@v0.2.4 cosmos:index_events
Protobuf

Protobuf Docs Explorer

ibc.core.client.v1
cosmos.authz.v1beta1
cosmos.gov.v1beta1
injective.exchange.v1beta1
injective.peggy.v1
cosmos.base.v1beta1
injective.crypto.v1beta1.ethsecp256k1
amino
cosmos.msg.v1
gogoproto
cosmos.slashing.v1beta1
injective.auction.v1beta1
cosmos.bank.v1beta1
ibc.core.channel.v1
cosmos.tx.v1beta1
cosmos.crisis.v1beta1
cosmos_proto
cosmwasm.wasm.v1
cosmos.crypto.multisig.v1beta1
injective.wasmx.v1
cosmos.tx.signing.v1beta1
cosmos.evidence.v1beta1
sf.cosmos.type.v2
injective.oracle.v1beta1
cosmos.upgrade.v1beta1
cosmos.distribution.v1beta1