pub struct SignedTransaction {
pub inner: TxInner,
pub signature: [u8; 64],
pub public_key: [u8; 32],
}Expand description
Signed transaction (transaction + signature) Supports both legacy transfers and V2 transactions (NFT operations)
Fields§
§inner: TxInnerThe unsigned transaction (legacy or V2)
signature: [u8; 64]Ed25519 signature (64 bytes)
public_key: [u8; 32]Signer’s public key (for verification)
Implementations§
Source§impl SignedTransaction
impl SignedTransaction
Sourcepub fn new(tx: Transaction, signature: [u8; 64], public_key: [u8; 32]) -> Self
pub fn new(tx: Transaction, signature: [u8; 64], public_key: [u8; 32]) -> Self
Create a new signed legacy transaction (backwards compatible)
Sourcepub fn new_v2(
tx: TransactionV2,
signature: [u8; 64],
public_key: [u8; 32],
) -> Self
pub fn new_v2( tx: TransactionV2, signature: [u8; 64], public_key: [u8; 32], ) -> Self
Create a new signed V2 transaction (for NFT and extended operations)
Sourcepub fn token_data(&self) -> Option<&TokenTxData>
pub fn token_data(&self) -> Option<&TokenTxData>
Get Token data if this is a Token transaction
Sourcepub fn staking_data(&self) -> Option<&StakingTxData>
pub fn staking_data(&self) -> Option<&StakingTxData>
Get Staking data if this is a Staking transaction
Sourcepub fn is_staking(&self) -> bool
pub fn is_staking(&self) -> bool
Check if this is a Staking transaction
Sourcepub fn messaging_data(&self) -> Option<&MessagingTxData>
pub fn messaging_data(&self) -> Option<&MessagingTxData>
Get Messaging data if this is a Messaging transaction
Sourcepub fn is_messaging(&self) -> bool
pub fn is_messaging(&self) -> bool
Check if this is a Messaging transaction
Sourcepub fn signing_hash(&self) -> Hash
pub fn signing_hash(&self) -> Hash
Get the transaction signing hash
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
Deserialize from bytes
Sourcepub fn signer_address(&self) -> Address
pub fn signer_address(&self) -> Address
Get the expected address from the public key
Sourcepub fn verify_signer(&self) -> bool
pub fn verify_signer(&self) -> bool
Verify that the signer matches the from address
Sourcepub fn legacy_tx(&self) -> Option<&Transaction>
pub fn legacy_tx(&self) -> Option<&Transaction>
Get legacy transaction reference (for backwards compatibility) Returns None if this is a V2 NFT transaction
Source§impl SignedTransaction
impl SignedTransaction
Sourcepub fn tx(&self) -> &Transaction
👎Deprecated: Use sender(), fee(), nonce() etc. or inner() instead
pub fn tx(&self) -> &Transaction
Use sender(), fee(), nonce() etc. or inner() instead
Get legacy transaction (DEPRECATED: use sender(), fee(), nonce() etc. or inner() instead) Panics if this is a V2 NFT transaction
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 ==.