Transaction

Struct Transaction 

Source
pub struct Transaction {
Show 14 fields pub version: String, pub hash: String, pub state_change_hash: String, pub event_root_hash: String, pub state_checkpoint_hash: Option<String>, pub gas_used: String, pub success: bool, pub vm_status: String, pub accumulator_root_hash: String, pub changes: Vec<WriteSetChange>, pub events: Vec<Event>, pub timestamp: String, pub max_gas_amount: String, pub transaction_type: TransactionType,
}
Expand description

Represents a transaction on the Aptos blockchain Contains all relevant information about a transaction including metadata, payload, and execution results

Fields§

§version: String

The version number of the transaction (global sequence number)

§hash: String

The hash of the transaction (unique identifier)

§state_change_hash: String

Hash representing the state changes caused by this transaction

§event_root_hash: String

Root hash of the event accumulator after this transaction

§state_checkpoint_hash: Option<String>

Hash of the state checkpoint (if this is a checkpoint transaction)

§gas_used: String

Amount of gas used by the transaction

§success: bool

Whether the transaction executed successfully

§vm_status: String

Status message from the virtual machine after execution

§accumulator_root_hash: String

Root hash of the transaction accumulator

§changes: Vec<WriteSetChange>

List of state changes (resources modified, tables updated, etc.)

§events: Vec<Event>

Events emitted during transaction execution

§timestamp: String

Timestamp when the transaction was executed (in microseconds)

§max_gas_amount: String

Maximum gas amount that could be used for this transaction

§transaction_type: TransactionType

The specific type of transaction and its payload data Uses serde flatten to include all transaction-type-specific fields

Implementations§

Source§

impl Transaction

Source

pub fn is_successful(&self) -> bool

Check if the transaction was successful

Source

pub fn get_timestamp(&self) -> Option<u64>

Get transaction timestamp

Source

pub fn get_gas_used(&self) -> Option<u64>

Get the amount of gas used

Source

pub fn is_user_transaction(&self) -> bool

Check whether it is a user transaction

Source

pub fn get_sender(&self) -> Option<&str>

Get the sender address in this transaction.

Trait Implementations§

Source§

impl Clone for Transaction

Source§

fn clone(&self) -> Transaction

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Transaction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Transaction

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Transaction

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,