Skip to main content

TransactionAccess

Trait TransactionAccess 

Source
pub trait TransactionAccess {
    // Required methods
    fn slot(&self) -> Result<u64, DecodeError>;
    fn index(&self) -> Result<Option<usize>, DecodeError>;
    fn signature(&self) -> Result<&Signature, DecodeError>;
    fn num_signers(&self, is_writable: bool) -> Result<usize, DecodeError>;
    fn num_accounts(&self) -> usize;
    fn message_signature(&self, idx: usize) -> Option<&Signature>;
    fn account_meta(
        &self,
        idx: usize,
    ) -> Result<Option<AccountMeta>, DecodeError>;
    fn num_address_table_lookups(&self) -> usize;
    fn address_table_lookup(
        &self,
        idx: usize,
    ) -> Option<&MessageAddressTableLookup>;
    fn num_instructions(&self) -> usize;
    fn instruction(&self, idx: usize) -> Option<&CompiledInstruction>;
    fn transaction_status_meta(&self) -> Option<&UiTransactionStatusMeta>;
}
Expand description

Access a transaction.

Required Methods§

Source

fn slot(&self) -> Result<u64, DecodeError>

Gets the slot of the transaction where the events were generated.

Source

fn index(&self) -> Result<Option<usize>, DecodeError>

Gets the index in the block of the transaction where the events were generated.

§Note

The index may be None because for old transaction info format, the index of the transaction is not provided.

Source

fn signature(&self) -> Result<&Signature, DecodeError>

Gets the signature of the transaction where the events were generated.

Source

fn num_signers(&self, is_writable: bool) -> Result<usize, DecodeError>

Returns the number of signers.

Source

fn num_accounts(&self) -> usize

Returns the number of accounts.

Source

fn message_signature(&self, idx: usize) -> Option<&Signature>

Gets message signature.

Source

fn account_meta(&self, idx: usize) -> Result<Option<AccountMeta>, DecodeError>

Gets account meta by index.

Source

fn num_address_table_lookups(&self) -> usize

Returns the number of address table lookups.

Source

fn address_table_lookup(&self, idx: usize) -> Option<&MessageAddressTableLookup>

Gets address table lookup by index.

Source

fn num_instructions(&self) -> usize

Returns the number of instructions.

Source

fn instruction(&self, idx: usize) -> Option<&CompiledInstruction>

Gets instruction by index.

Source

fn transaction_status_meta(&self) -> Option<&UiTransactionStatusMeta>

Returns transaction status meta if available.

Implementors§

Source§

impl TransactionAccess for DecodedTransaction<'_>

Available on crate feature solana-decoder only.