pub struct SignedTransaction {
pub raw_txn: RawTransaction,
pub authenticator: TransactionAuthenticator,
}Expand description
A signed transaction ready for submission.
Fields§
§raw_txn: RawTransactionThe raw transaction.
authenticator: TransactionAuthenticatorThe authenticator (signature(s) and public key(s)).
Implementations§
Source§impl SignedTransaction
impl SignedTransaction
Sourcepub fn new(
raw_txn: RawTransaction,
authenticator: TransactionAuthenticator,
) -> Self
pub fn new( raw_txn: RawTransaction, authenticator: TransactionAuthenticator, ) -> Self
Creates a new signed transaction.
Sourcepub fn for_simulate_endpoint(&self) -> Self
pub fn for_simulate_endpoint(&self) -> Self
Clones this transaction with authenticators rewritten for /transactions/simulate.
The Aptos fullnode rejects simulate requests that carry a cryptographically valid
signature. crate::api::FullnodeClient::simulate_transaction applies this
transformation automatically; this helper exists for callers who serialize manually.
Sourcepub fn to_bcs(&self) -> AptosResult<Vec<u8>>
pub fn to_bcs(&self) -> AptosResult<Vec<u8>>
Serializes this signed transaction to BCS bytes.
§Errors
Returns an error if BCS serialization fails.
Sourcepub fn sender(&self) -> AccountAddress
pub fn sender(&self) -> AccountAddress
Returns the sender address.
Sourcepub fn sequence_number(&self) -> u64
pub fn sequence_number(&self) -> u64
Returns the sequence number.
Sourcepub fn hash(&self) -> AptosResult<HashValue>
pub fn hash(&self) -> AptosResult<HashValue>
Computes the transaction hash.
§Errors
Returns an error if BCS serialization of the transaction fails.
Sourcepub fn verify_signature(&self) -> AptosResult<()>
pub fn verify_signature(&self) -> AptosResult<()>
Verifies the transaction authenticator against the transaction’s signing message and sender address.
§Errors
Returns an error if the authenticator does not verify or if the derived sender address does not match the raw transaction sender.
Trait Implementations§
Source§impl Clone for SignedTransaction
impl Clone for SignedTransaction
Source§fn clone(&self) -> SignedTransaction
fn clone(&self) -> SignedTransaction
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SignedTransaction
impl Debug for SignedTransaction
Source§impl<'de> Deserialize<'de> for SignedTransaction
impl<'de> Deserialize<'de> for SignedTransaction
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 SignedTransaction
impl PartialEq for SignedTransaction
Source§fn eq(&self, other: &SignedTransaction) -> bool
fn eq(&self, other: &SignedTransaction) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for SignedTransaction
impl Serialize for SignedTransaction
impl Eq for SignedTransaction
impl StructuralPartialEq for SignedTransaction
Auto Trait Implementations§
impl Freeze for SignedTransaction
impl RefUnwindSafe for SignedTransaction
impl Send for SignedTransaction
impl Sync for SignedTransaction
impl Unpin for SignedTransaction
impl UnsafeUnpin for SignedTransaction
impl UnwindSafe for SignedTransaction
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.