Skip to main content

TransactionAdapter

Struct TransactionAdapter 

Source
pub struct TransactionAdapter<'a> {
    pub config: Option<ParseConfig>,
    pub account_keys: Vec<String>,
    pub spl_token_map: HashMap<String, TokenInfo>,
    pub spl_decimals_map: HashMap<String, u8>,
    /* private fields */
}

Fields§

§config: Option<ParseConfig>§account_keys: Vec<String>§spl_token_map: HashMap<String, TokenInfo>§spl_decimals_map: HashMap<String, u8>

Implementations§

Source§

impl<'a> TransactionAdapter<'a>

Source

pub fn new(tx: &'a SolanaTransactionInput, config: Option<ParseConfig>) -> Self

Source

pub fn slot(&self) -> u64

Source

pub fn block_time(&self) -> i64

Source

pub fn signature(&self) -> String

Source

pub fn signer(&self) -> String

Source

pub fn signers(&self) -> Vec<String>

Source

pub fn fee(&self) -> TokenAmount

Source

pub fn compute_units(&self) -> u64

Source

pub fn tx_status(&self) -> TransactionStatus

Source

pub fn instructions(&self) -> Vec<ParsedInstructionRef>

Source

pub fn inner_instructions(&self) -> Option<&[InnerInstructionSet]>

Source

pub fn raw_instructions(&self) -> &[RawInstruction]

Source

pub fn raw_inner_instructions(&self) -> Option<&[InnerInstructionSet]>

Source

pub fn get_instruction( &self, raw: &RawInstruction, program_id_index: u8, ) -> ParsedInstruction

Source

pub fn get_instruction_program_id(&self, raw: &RawInstruction) -> String

Source

pub fn get_account_key(&self, index: usize) -> Option<String>

Source

pub fn get_account_index(&self, address: &str) -> Option<usize>

Source

pub fn is_supported_token(&self, mint: &str) -> bool

Source

pub fn get_token_decimals(&self, mint: &str) -> u8

Source

pub fn get_pool_event_base( &self, pool_event_type: PoolEventType, program_id: &str, ) -> PoolEventBase

Source

pub fn pre_balances(&self) -> Option<&[u64]>

Source

pub fn post_balances(&self) -> Option<&[u64]>

Source

pub fn pre_token_balances(&self) -> Option<&[TokenBalanceInput]>

Source

pub fn post_token_balances(&self) -> Option<&[TokenBalanceInput]>

Source

pub fn get_token_account_owner(&self, account_key: &str) -> Option<String>

Source

pub fn get_token_account_balance( &self, account_keys: &[String], ) -> Vec<Option<TokenAmount>>

Source

pub fn get_token_account_pre_balance( &self, account_keys: &[String], ) -> Vec<Option<TokenAmount>>

Source

pub fn get_account_balance( &self, account_keys: &[String], ) -> Vec<Option<TokenAmount>>

Source

pub fn get_account_pre_balance( &self, account_keys: &[String], ) -> Vec<Option<TokenAmount>>

Source

pub fn get_account_sol_balance_changes( &self, _is_owner: bool, ) -> HashMap<String, BalanceChange>

Source

pub fn get_account_token_balance_changes( &self, _is_owner: bool, ) -> HashMap<String, HashMap<String, BalanceChange>>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V