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: StringThe version number of the transaction (global sequence number)
hash: StringThe hash of the transaction (unique identifier)
state_change_hash: StringHash representing the state changes caused by this transaction
event_root_hash: StringRoot 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: StringAmount of gas used by the transaction
success: boolWhether the transaction executed successfully
vm_status: StringStatus message from the virtual machine after execution
accumulator_root_hash: StringRoot 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: StringTimestamp when the transaction was executed (in microseconds)
max_gas_amount: StringMaximum gas amount that could be used for this transaction
transaction_type: TransactionTypeThe specific type of transaction and its payload data Uses serde flatten to include all transaction-type-specific fields
Implementations§
Source§impl Transaction
impl Transaction
Sourcepub fn is_successful(&self) -> bool
pub fn is_successful(&self) -> bool
Check if the transaction was successful
Sourcepub fn get_timestamp(&self) -> Option<u64>
pub fn get_timestamp(&self) -> Option<u64>
Get transaction timestamp
Sourcepub fn get_gas_used(&self) -> Option<u64>
pub fn get_gas_used(&self) -> Option<u64>
Get the amount of gas used
Sourcepub fn is_user_transaction(&self) -> bool
pub fn is_user_transaction(&self) -> bool
Check whether it is a user transaction
Sourcepub fn get_sender(&self) -> Option<&str>
pub fn get_sender(&self) -> Option<&str>
Get the sender address in this transaction.
Trait Implementations§
Source§impl Clone for Transaction
impl Clone for Transaction
Source§fn clone(&self) -> Transaction
fn clone(&self) -> Transaction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more