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.

The address of the account that signs and pays the fee. It can have additional responsibilities dependending on the transaction type. We keep it in the transaction types to be able to document (and possibly name) it separately.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.