Struct algonaut_transaction::transaction::Transaction [−][src]
pub struct Transaction { pub fee: MicroAlgos, pub first_valid: Round, pub genesis_hash: HashDigest, pub last_valid: Round, pub sender: Address, pub txn_type: TransactionType, pub genesis_id: String, pub group: Option<HashDigest>, pub lease: Option<HashDigest>, pub note: Vec<u8>, pub rekey_to: Option<Address>, }
A transaction that can appear in a block
Fields
fee: MicroAlgos
Paid by the sender to the FeeSink to prevent denial-of-service. The minimum fee on Algorand is currently 1000 microAlgos.
first_valid: Round
The first round for when the transaction is valid. If the transaction is sent prior to this round it will be rejected by the network.
genesis_hash: HashDigest
The hash of the genesis block of the network for which the transaction is valid. See the genesis hash for MainNet, TestNet, and BetaNet.
last_valid: Round
The ending round for which the transaction is valid. After this round, the transaction will be rejected by the network.
sender: Address
The address of the account that pays the fee and amount.
txn_type: TransactionType
Specifies the type of transaction. This value is automatically generated using any of the developer tools.
genesis_id: String
The human-readable string that identifies the network for the transaction. The genesis ID is found in the genesis block. See the genesis ID for MainNet, TestNet, and BetaNet.
group: Option<HashDigest>
The group specifies that the transaction is part of a group and, if so, specifies the hash of the transaction group. Assign a group ID to a transaction through the workflow described in the Atomic Transfers Guide.
lease: Option<HashDigest>
A lease enforces mutual exclusion of transactions. If this field is nonzero, then once the transaction is confirmed, it acquires the lease identified by the (Sender, Lease) pair of the transaction until the LastValid round passes. While this transaction possesses the lease, no other transaction specifying this lease can be confirmed. A lease is often used in the context of Algorand Smart Contracts to prevent replay attacks. Read more about Algorand Smart Contracts and see the Delegate Key Registration TEAL template for an example implementation of leases. Leases can also be used to safeguard against unintended duplicate spends. For example, if I send a transaction to the network and later realize my fee was too low, I could send another transaction with a higher fee, but the same lease value. This would ensure that only one of those transactions ends up getting confirmed during the validity period.
note: Vec<u8>
Any data up to 1000 bytes.
rekey_to: Option<Address>
Specifies the authorized address. This address will be used to authorize all future transactions. Learn more about Rekeying accounts.
Implementations
impl Transaction
[src]
pub fn fee_per_byte(
self,
fee_per_byte: MicroAlgos
) -> Result<Transaction, AlgorandError>
[src]
self,
fee_per_byte: MicroAlgos
) -> Result<Transaction, AlgorandError>
Creates a new transaction with a fee calculated based on fee_per_byte
.
Trait Implementations
impl Clone for Transaction
[src]
fn clone(&self) -> Transaction
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for Transaction
[src]
impl<'de> Deserialize<'de> for Transaction
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for Transaction
[src]
impl PartialEq<Transaction> for Transaction
[src]
fn eq(&self, other: &Transaction) -> bool
[src]
fn ne(&self, other: &Transaction) -> bool
[src]
impl Serialize for Transaction
[src]
fn serialize<S>(
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
[src]
&self,
serializer: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
impl StructuralEq for Transaction
[src]
impl StructuralPartialEq for Transaction
[src]
Auto Trait Implementations
impl RefUnwindSafe for Transaction
impl Send for Transaction
impl Sync for Transaction
impl Unpin for Transaction
impl UnwindSafe for Transaction
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,