Crate serde_helpers

Expand description

Alloy serde helpers for primitive types.

§alloy-serde

Serde related helpers for Alloy.

Modules§

encryption
Serialize a byte vec as a hex string without the “0x” prefix.
quantity
Serde functions for encoding primitive numbers using the Ethereum JSON-RPC “quantity” format.
quantity_boolDeprecated
Serde serialization and deserialization for bool as 0x0 or 0x1.
storage
Storage related helpers.
ttd
Json U256 serde helpers.

Structs§

OtherFields
Generic type for capturing additional fields when deserializing structs.
WithOtherFields
An extension to a struct that allows to capture additional fields when deserializing.

Enums§

JsonStorageKey
A storage key type that can be serialized to and from a hex string up to 32 bytes. Used for eth_getStorageAt and eth_getProof RPCs.

Functions§

deserialize_json_ttd_opt
Supports parsing the TTD as an Option<u64>, or Option<f64> specifically for the mainnet TTD (5.875e22).
null_as_default
For use with serde’s deserialize_with on a sequence that must be deserialized as a single but optional (i.e. possibly null) value.
reject_if_some
For use with serde’s deserialize_with on a field that must be missing.
serialize_b256_hex_string_no_prefix
Serialize a B256 as a hex string without the “0x” prefix.
serialize_hex_string_no_prefix
Serialize a byte vec as a hex string without the “0x” prefix.