Extended information about the current transaction.

Signature


#[derive(Copy, Drop, Debug, Serde)]
pub struct TxInfo {
    pub version: felt252,
    pub account_contract_address: ContractAddress,
    pub max_fee: u128,
    pub signature: Span,
    pub transaction_hash: felt252,
    pub chain_id: felt252,
    pub nonce: felt252,
    pub resource_bounds: Span,
    pub tip: u128,
    pub paymaster_data: Span,
    pub nonce_data_availability_mode: u32,
    pub fee_data_availability_mode: u32,
    pub account_deployment_data: Span,
}

Members

version

The version of the transaction. It is fixed (currently, 1) in the OS, and should be signed by the account contract. This field allows invalidating old transactions, whenever the meaning of the other transaction fields is changed (in the OS).

Signature

pub version: felt252

account_contract_address

The account contract from which this transaction originates.

Signature

pub account_contract_address: ContractAddress

max_fee

The max_fee field of the transaction.

Signature

pub max_fee: u128

signature

The signature of the transaction.

Signature

pub signature: Span

transaction_hash

The hash of the transaction.

Signature

pub transaction_hash: felt252

chain_id

The identifier of the chain. This field can be used to prevent replay of testnet transactions on mainnet.

Signature

pub chain_id: felt252

nonce

The transaction’s nonce.

Signature

pub nonce: felt252

resource_bounds

A span of ResourceBounds structs used for V3 transactions.

Signature

pub resource_bounds: Span

tip

The tip of the transaction.

Signature

pub tip: u128

paymaster_data

If specified, the paymaster should pay for the execution of the transaction. The data includes the address of the paymaster sponsoring the transaction, followed by extra data to send to the paymaster. Used for V3 transactions.

Signature

pub paymaster_data: Span

nonce_data_availability_mode

The data availability mode for the nonce. Used for V3 transactions.

Signature

pub nonce_data_availability_mode: u32

fee_data_availability_mode

The data availability mode for the account balance from which fee will be taken. Used for V3 transactions.

Signature

pub fee_data_availability_mode: u32

account_deployment_data

If nonempty, will contain the required data for deploying and initializing an account contract: its class hash, address salt and constructor calldata. Used for V3 transactions.

Signature

pub account_deployment_data: Span