pub struct TransactionView<const SANITIZED: bool, D: TransactionData> { /* private fields */ }
Expand description
A view into a serialized transaction.
This struct provides access to the transaction data without
deserializing it. This is done by parsing and caching metadata
about the layout of the serialized transaction.
The owned data
is abstracted through the TransactionData
trait,
so that different containers for the serialized transaction can be used.
Implementations§
Source§impl<D: TransactionData> TransactionView<false, D>
impl<D: TransactionData> TransactionView<false, D>
Sourcepub fn try_new_unsanitized(data: D) -> Result<Self>
pub fn try_new_unsanitized(data: D) -> Result<Self>
Creates a new TransactionView
without running sanitization checks.
Sourcepub fn sanitize(self) -> Result<SanitizedTransactionView<D>>
pub fn sanitize(self) -> Result<SanitizedTransactionView<D>>
Sanitizes the transaction view, returning a sanitized view on success.
Source§impl<D: TransactionData> TransactionView<true, D>
impl<D: TransactionData> TransactionView<true, D>
Sourcepub fn try_new_sanitized(data: D) -> Result<Self>
pub fn try_new_sanitized(data: D) -> Result<Self>
Creates a new TransactionView
, running sanitization checks.
Source§impl<const SANITIZED: bool, D: TransactionData> TransactionView<SANITIZED, D>
impl<const SANITIZED: bool, D: TransactionData> TransactionView<SANITIZED, D>
Sourcepub fn num_signatures(&self) -> u8
pub fn num_signatures(&self) -> u8
Return the number of signatures in the transaction.
Sourcepub fn num_required_signatures(&self) -> u8
pub fn num_required_signatures(&self) -> u8
Return the number of required signatures in the transaction.
Sourcepub fn num_readonly_signed_static_accounts(&self) -> u8
pub fn num_readonly_signed_static_accounts(&self) -> u8
Return the number of readonly signed static accounts in the transaction.
Sourcepub fn num_readonly_unsigned_static_accounts(&self) -> u8
pub fn num_readonly_unsigned_static_accounts(&self) -> u8
Return the number of readonly unsigned static accounts in the transaction.
Sourcepub fn num_static_account_keys(&self) -> u8
pub fn num_static_account_keys(&self) -> u8
Return the number of static account keys in the transaction.
Sourcepub fn num_instructions(&self) -> u16
pub fn num_instructions(&self) -> u16
Return the number of instructions in the transaction.
Sourcepub fn num_address_table_lookups(&self) -> u8
pub fn num_address_table_lookups(&self) -> u8
Return the number of address table lookups in the transaction.
Sourcepub fn total_writable_lookup_accounts(&self) -> u16
pub fn total_writable_lookup_accounts(&self) -> u16
Return the number of writable lookup accounts in the transaction.
Sourcepub fn total_readonly_lookup_accounts(&self) -> u16
pub fn total_readonly_lookup_accounts(&self) -> u16
Return the number of readonly lookup accounts in the transaction.
Sourcepub fn signatures(&self) -> &[Signature]
pub fn signatures(&self) -> &[Signature]
Return the slice of signatures in the transaction.
Sourcepub fn static_account_keys(&self) -> &[Pubkey]
pub fn static_account_keys(&self) -> &[Pubkey]
Return the slice of static account keys in the transaction.
Sourcepub fn recent_blockhash(&self) -> &Hash
pub fn recent_blockhash(&self) -> &Hash
Return the recent blockhash in the transaction.
Sourcepub fn instructions_iter(&self) -> InstructionsIterator<'_>
pub fn instructions_iter(&self) -> InstructionsIterator<'_>
Return an iterator over the instructions in the transaction.
Sourcepub fn address_table_lookup_iter(&self) -> AddressTableLookupIterator<'_>
pub fn address_table_lookup_iter(&self) -> AddressTableLookupIterator<'_>
Return an iterator over the address table lookups in the transaction.
Sourcepub fn message_data(&self) -> &[u8] ⓘ
pub fn message_data(&self) -> &[u8] ⓘ
Return the serialized message data. This does not include the signatures.
Source§impl<D: TransactionData> TransactionView<true, D>
impl<D: TransactionData> TransactionView<true, D>
Sourcepub fn program_instructions_iter(
&self,
) -> impl Iterator<Item = (&Pubkey, SVMInstruction<'_>)>
pub fn program_instructions_iter( &self, ) -> impl Iterator<Item = (&Pubkey, SVMInstruction<'_>)>
Return an iterator over the instructions paired with their program ids.
Trait Implementations§
Auto Trait Implementations§
impl<const SANITIZED: bool, D> Freeze for TransactionView<SANITIZED, D>where
D: Freeze,
impl<const SANITIZED: bool, D> RefUnwindSafe for TransactionView<SANITIZED, D>where
D: RefUnwindSafe,
impl<const SANITIZED: bool, D> Send for TransactionView<SANITIZED, D>where
D: Send,
impl<const SANITIZED: bool, D> Sync for TransactionView<SANITIZED, D>where
D: Sync,
impl<const SANITIZED: bool, D> Unpin for TransactionView<SANITIZED, D>where
D: Unpin,
impl<const SANITIZED: bool, D> UnwindSafe for TransactionView<SANITIZED, D>where
D: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more