pub trait TransactionId: AlgorandMsgpack {
// Provided methods
fn id_raw(&self) -> Result<[u8; 32], AlgoKitTransactError> { ... }
fn id(&self) -> Result<String, AlgoKitTransactError> { ... }
}
Expand description
Trait for generating transaction identifiers.
This trait provides methods for calculating and representing transaction IDs, which are Sha512_256 hashes of the encoded transaction data. These IDs are used to uniquely identify transactions in the Algorand blockchain.
Provided Methods§
Sourcefn id_raw(&self) -> Result<[u8; 32], AlgoKitTransactError>
fn id_raw(&self) -> Result<[u8; 32], AlgoKitTransactError>
Generates the raw transaction ID as a hash of the transaction data.
Computes a Sha512_256 hash of the MessagePack-encoded transaction (including the appropriate domain prefix).
§Returns
The transaction ID as a 32-byte array or an AlgoKitTransactError if encoding fails.
Sourcefn id(&self) -> Result<String, AlgoKitTransactError>
fn id(&self) -> Result<String, AlgoKitTransactError>
Converts the transaction ID to a base32-encoded string.
This creates the standard human-readable representation of a transaction ID as it would appear in block explorers, APIs, and other interfaces.
§Returns
The base32-encoded transaction ID string or an AlgoKitTransactError if ID calculation fails.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.