Skip to main content

Module prelude

Module prelude 

Structs§

Address
Represents an Ethereum address
Balance
Represents a non-negative balance of some Currency.
BoundedVec
Wrapper for Vec that has an explicit upper bound on the number of elements. The Structure remains heap-allocated to avoid blowing up the size of types where it is used.
DateTime
ISO 8601 combined date and time with time zone.
EthereumChallenge
Represents and Ethereum challenge.
KeyIdent
Identifier of public keys.
SerializableLog
A type containing selected fields from the eth_getLogs RPC calls.
Utc
The UTC time zone. This is the most efficient time zone when you don’t need the local time. It is also used as an offset (which is also a dummy type).
WxHOPR
Represents wxHOPR token Currency.
XDai
Represents xDai coin Currency.
XHOPR
Represents xHOPR token Currency.

Enums§

GeneralError
Listing of some general re-usable errors

Traits§

AsUnixTimestamp
A trait that’s added an extension method to represent a time object as Duration since Unix epoch.
BytesEncodable
Represents a type that can be encoded to/decoded from a fixed-sized byte array of size N.
BytesRepresentable
Represents a type already internally represented by a fixed size byte array, and therefore requires no memory allocation to represent the type in binary encoding.
Currency
Represents a general currency - like a token or a coin.
IntoEndian
Extension trait for fixed size numbers to allow conversion to/from endian representations.
KeyIdMapping
Trait that defines 1:1 mapper between key identifiers and public keys.
SaturatingSub
A trait that adds an extension method to perform saturated substractions on SystemTime instances.
ToHex
A generic type that can be converted to a hexadecimal string.
UnitaryFloatOps
Allows type to be multiplied and divided by a float in range [0.0, 1.0].

Functions§

f64_approx_eq
Approximately compares two double-precision floats.
to_hex_shortened
Converts the given data into a hex string, removing the middle part of the string if it is longer than M of hex characters.

Type Aliases§

HoprBalance
U256
XDaiBalance
XHoprBalance