pub struct RawTransactionOrderless {
pub sender: AccountAddress,
pub nonce: Vec<u8>,
pub payload: TransactionPayload,
pub max_gas_amount: u64,
pub gas_unit_price: u64,
pub expiration_timestamp_secs: u64,
pub chain_id: ChainId,
}Expand description
An orderless transaction using hash-based replay protection.
Unlike standard transactions that use sequence numbers, orderless transactions use a random nonce and a short expiration window (typically 60 seconds) to prevent replay attacks. This allows transactions to be submitted in any order.
§Note
Orderless transactions must be configured with a very short expiration time (recommended: 60 seconds or less) since the replay protection relies on the chain remembering recently seen transaction hashes.
Fields§
§sender: AccountAddressSender’s address.
nonce: Vec<u8>Random nonce for uniqueness (32 bytes recommended).
payload: TransactionPayloadThe transaction payload (entry function, script, etc.).
max_gas_amount: u64Maximum gas units the sender is willing to pay.
gas_unit_price: u64Price per gas unit in octas.
expiration_timestamp_secs: u64Expiration time in seconds since Unix epoch. Should be short (e.g., current time + 60 seconds).
chain_id: ChainIdChain ID to prevent cross-chain replay.
Implementations§
Source§impl RawTransactionOrderless
impl RawTransactionOrderless
Sourcepub fn new(
sender: AccountAddress,
payload: TransactionPayload,
max_gas_amount: u64,
gas_unit_price: u64,
expiration_timestamp_secs: u64,
chain_id: ChainId,
) -> Self
pub fn new( sender: AccountAddress, payload: TransactionPayload, max_gas_amount: u64, gas_unit_price: u64, expiration_timestamp_secs: u64, chain_id: ChainId, ) -> Self
Creates a new orderless transaction with a random nonce.
Sourcepub fn with_nonce(
sender: AccountAddress,
nonce: Vec<u8>,
payload: TransactionPayload,
max_gas_amount: u64,
gas_unit_price: u64,
expiration_timestamp_secs: u64,
chain_id: ChainId,
) -> Self
pub fn with_nonce( sender: AccountAddress, nonce: Vec<u8>, payload: TransactionPayload, max_gas_amount: u64, gas_unit_price: u64, expiration_timestamp_secs: u64, chain_id: ChainId, ) -> Self
Creates a new orderless transaction with a specific nonce.
Sourcepub fn signing_message(&self) -> AptosResult<Vec<u8>>
pub fn signing_message(&self) -> AptosResult<Vec<u8>>
Generates the signing message for this orderless transaction.
§Errors
Returns an error if BCS serialization of the transaction fails.
Trait Implementations§
Source§impl Clone for RawTransactionOrderless
impl Clone for RawTransactionOrderless
Source§fn clone(&self) -> RawTransactionOrderless
fn clone(&self) -> RawTransactionOrderless
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RawTransactionOrderless
impl Debug for RawTransactionOrderless
Source§impl<'de> Deserialize<'de> for RawTransactionOrderless
impl<'de> Deserialize<'de> for RawTransactionOrderless
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for RawTransactionOrderless
impl PartialEq for RawTransactionOrderless
Source§impl Serialize for RawTransactionOrderless
impl Serialize for RawTransactionOrderless
impl Eq for RawTransactionOrderless
impl StructuralPartialEq for RawTransactionOrderless
Auto Trait Implementations§
impl Freeze for RawTransactionOrderless
impl RefUnwindSafe for RawTransactionOrderless
impl Send for RawTransactionOrderless
impl Sync for RawTransactionOrderless
impl Unpin for RawTransactionOrderless
impl UnwindSafe for RawTransactionOrderless
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.