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]

Creates a new transaction with a fee calculated based on fee_per_byte.

Trait Implementations

impl Clone for Transaction[src]

impl Debug for Transaction[src]

impl<'de> Deserialize<'de> for Transaction[src]

impl Eq for Transaction[src]

impl PartialEq<Transaction> for Transaction[src]

impl Serialize for Transaction[src]

impl StructuralEq for Transaction[src]

impl StructuralPartialEq for Transaction[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,