All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Downgrade required rust-version from 1.80 to 1.60 (it forces a requirement that is too high upon other dependencies)
- Bumped dependencies to
substreams
to 0.6 andprost
to 0.13 (see Upgrade notes) - Added
InstructionView.inner_instruction(at)
to retrieve an inner instruction at a specific indexat
. This works only if the view is currently on aCompiledInstruction
(e.g.InstructionView.is_root() == true
).
This is a relatively important update of the library bringing in improved version of the utilities the exist to iterate over instructions as well as access to pre-resolved Instruction's program id and accounts. The goal of this update was to make it easier to process instruction(s), reducing the overall code needed to link inner instructions and to avoid the need to implement account resolution.
Essentially, this update adds a new InstructionView replacing the older one. This InstructionView has resolved progam id, resolved accounts and provides access to the transaction, compiled instruction and inner instructions (if viewing a CompiledInstruction
).
You now get an InstructionView when iterating over all CompiledInstruction
(a.k.a root instruction) of a transaction via ConfirmedTransaction::compiled_instructions (this was previously named instructions()
directly).
And you can now also iterates over all instructions, root or inner(s), of a transaction via ConfirmedTransaction::walk_instructions.
The same method are available on the Block directly to easily walk over all instructions found in a block.
In this update, we also added an Address type that is a simply wrapper today around a &Vec<u8>
with methods to more easily convert to base58
string (to_string
) as well as testing equality against various other types. For now Address
is mainly used within the new InstructionView struct, we plan on using it more where possible in the future.
In future updates, we plan to also attach the logs properly to InstructionView
.
-
Replaced
InstructionView
with an updated incompatible version, the 3 public fields that you had access to before has been removed in favor of methods instead, enabling future refactoring without breaking the API. Check next point for how to update. -
The methods
Block::instructions
andConfirmedTransaction::instructions
have been both renamed tocompiled_instructions
, they are still return an iterator to an InstructionView.for view in trx.instructions() { let meta = view.meta; let transaction = view.transaction; let program_id = resolve_account(view.instruction.program_id_index); let accounts = resolve_accounts(view.instruction.accounts); let data = view.instruction.data; }
Becomes
for view in trx.instructions() { let meta = view.meta(); let transaction = view.transaction(); // Program ID and accounts are already resolved now! let program_id = view.program_id(); let accounts = view.accounts(); let data = view.data(); }
-
The all_instructions method added on
0.12.0
on bothBlock
andConfirmedTransaction
has been renamed towalk_instructions
to better convey the fact that we iterate over compiled (root) instruction and inner instructions.for view in trx.all_instructions() { // ... }
Becomes
for view in trx.walk_instructions() { // ... }
-
Added account_at which returns the account at the given index.
-
Added ConfirmedTransaction::walk_instructions to more easily walk over compiled and inner instructions.
-
Renamed
instructions
tocompiled_instructions
. -
Improved InstructionView so that methods now returns resolved program ID and accounts and well as a bunch of newer helper(s).
-
Added
id
helper onpb::Transaction
andpb::ConfirmedTransaction
that returns the transaction's hash as a base58String
value. -
Added
hash
helper onpb::Transaction
andpb::ConfirmedTransaction
that returns the transaction's hash as a byte array (&[u8]
). -
Added
all_instructions
helper onpb::ConfirmedTransaction
to more easily recursively walk through top level as well as inner instructions in one swift. See all_instructions Docs for details. -
Added
resolved_accounts
for address lookup accounts, the method will take theloaded_writable_addresses
andloaded_readonly_addresses
from theTransactionStatusMeta
of aConfirmedTransaction
and resolved the accounts.
- Bring back module
substreams-solana
to expose modulescore
andmacro
- Move
substreams-solana
code to https://github.com/streamingfast/substreams-solana-program-instructions crate.
- Update
Unexpected Errors
returned to useanyhow
crate instead of customUnexpectedError
- Bump Firehose Solana Blocks with latest (v0.1.1) spkg from
firehose-solana
. This is NOT a breaking change. We have added the Address Lookup Tables to the proto definition of Message. You can read more about Address Lookup Tables here.
- Updated to
prost
0.11.
- StreamingFast Firehose Block generated Rust code is now included in this library directly.