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 txn_type: TransactionType, pub genesis_id: Option<String>, pub group: Option<HashDigest>, pub lease: Option<HashDigest>, pub note: Option<Vec<u8>>, pub rekey_to: Option<Address>, }
Expand description
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.
txn_type: TransactionType
Specifies the type of transaction. This value is automatically generated using any of the developer tools.
genesis_id: Option<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: Option<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
Creates a new transaction with a fee calculated based on fee_per_byte
.
Trait Implementations
Convenience to deserialize Transaction directly from msg pack
Deserialize this value from the given Serde deserializer. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Convenience to serialize Transaction directly to msg pack
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
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self