Module utils

Module utils 

Source
Expand description

Provides various utilities that are commonly used throughout the Miden client library.

Structs§

LazyLock
A value which is initialized on the first access.
ScriptBuilderError

Enums§

DeserializationError
Defines errors which can occur during deserialization.
TokenParseError
Errors that can occur when parsing a token represented as a decimal number in a string into base units.

Traits§

ByteReader
Defines how primitive values are to be read from Self.
ByteWriter
Defines how primitive values are to be written into Self.
Deserializable
Defines how to deserialize Self from bytes.
Serializable
Defines how to serialize Self into bytes.
ToHex
This trait represents a value that can be converted to a string of hexadecimal digits which represent the raw byte encoding of that value.

Functions§

base_units_to_tokens
Converts an amount in the faucet base units to the token’s decimals.
bytes_to_hex_string
Renders an array of bytes as hex into a String.
get_public_keys_from_account
Gets the public key from the storage of an account. The function is required to create an AccountFile for exporting accounts in the cli and the web client.
hex_to_bytes
Parses a hex string into an array of bytes of known size.
tokens_to_base_units
Converts a decimal number, represented as a string, into an integer by shifting the decimal point to the right by a specified number of decimal places.

Type Aliases§

RwLock
A reader-writer lock
RwLockReadGuard
RAII structure used to release the shared read access of a lock when dropped.
RwLockWriteGuard
RAII structure used to release the exclusive write access of a lock when dropped.