Module hex

Source
Expand description

Hexadecimal string parsing utilities for blockchain data.

This module provides functions for converting hexadecimal strings (commonly used in blockchain APIs and JSON-RPC responses) to native Rust types, with specialized support for timestamps.

Functions§

deserialize_hex_number
Custom deserializer function for hex numbers.
deserialize_hex_timestamp
Custom deserializer function for hex timestamps to convert hex seconds to UnixNanos.
deserialize_opt_hex_u64
Custom deserializer that converts an optional hexadecimal string into an Option<u64>.
deserialize_opt_hex_u256
Custom deserializer that converts an optional hexadecimal string into an Option<U256>. A None result indicates the field was absent or explicitly null.
from_str_hex_to_u64
Converts a hexadecimal string to a u64 integer.