Crate substreams_solana

Source
Expand description

§Substreams Solana Library

This library provides the Substreams Solana generated Protobuf bindings. As well as a bunch of helpers that exists to make it easier to work with the generated Protobuf bindings.

Below you will find information about the most important types, helpers and traits that are provided by this library.

§Block, Transaction and Instruction Views & Helpers

We provide the following helpers to deal with Solana block and transaction:

  • Block::transactions returns an iterator over successful transactions of a block. The iterator element is a reference to ConfirmedTransaction.

  • Block::transactions_owned returns an owned iterator over successful transactions of a block. The iterator element is a owned ConfirmedTransaction.

  • Transaction::id returns the transaction’s id (first signature) as a base58 encoded string.

  • Transaction::hash returns the transaction’s hash (first signature) as byte array.

  • ConfirmedTransaction::id returns the transaction’s id (first signature) as a base58 encoded string.

  • ConfirmedTransaction::hash returns the transaction’s hash (first signature) as byte array.

  • ConfirmedTransaction::walk_instructions returns an iterator over all instructions, including inner instructions, of a transaction. The iterator element is a view over the instruction, has resolved accounts and provides access to the transaction, compiled instruction of the transaction. It make it much easier to walk the whole instruction tree of a transaction. Refer to the method documentation for more information about it.

Modules§

base58
Helpers to deal with base58 encoding and decoding.
block_view
Helpers to deal with block sources.
pb

Macros§

b58
Macro for converting sequence of string literals containing base58 encoded data into an array of bytes.

Structs§

Address
A wrapper around a byte array that represents a Solana address. It provides a way to convert the address to a base58 encoded string.

Traits§

Instruction
Instruction trait to be implemented by all instructions. The trait enables you to work on a generic instruction type instead of working with either CompiledInstruction or InnerInstruction model.