Skip to main content

serialize_value_as_json

Function serialize_value_as_json 

Source
pub fn serialize_value_as_json(
    value: DynSolValue,
    defs: Option<&StructDefinitions>,
    strict: bool,
) -> Result<Value>
Expand description

Serializes given [DynSolValue] into a serde_json::Value.

If strict is true, numeric values are serialized according to their Solidity type width: integers with bits <= 64 become JSON numbers, while wider integer types are serialized as strings, even when a particular runtime value would fit into i64/u64.