carbon_core::transformers

Function extract_instructions_with_metadata

Source
pub fn extract_instructions_with_metadata(
    transaction_metadata: &TransactionMetadata,
    transaction_update: &TransactionUpdate,
) -> CarbonResult<Vec<(InstructionMetadata, Instruction)>>
Expand description

Extracts instructions with metadata from a transaction update.

This function parses both top-level and inner instructions, associating them with metadata such as stack height and account information. It provides a detailed breakdown of each instruction, useful for further processing.

§Parameters

  • transaction_metadata: Metadata about the transaction from which instructions are extracted.
  • transaction_update: The TransactionUpdate containing the transaction’s data and message.

§Returns

A CarbonResult<Vec<(InstructionMetadata, solana_sdk::instruction::Instruction)>> containing instructions along with their associated metadata.

§Errors

Returns an error if any account metadata required for instruction processing is missing.