Class NullableEvmAddressConverter
Nullable EVM-address converter that preserves an explicit
wire-null as a C# null, rather than coercing it to
None (the all-zeros sentinel). The plain
EvmAddressConverter collapses both forms — useful when
the server never sends null — but on endpoints that do send null
to distinguish "no address" from "the literal zero address" (e.g.
contract-action to fields, where CREATE actions can leave
the recipient null), use this converter.
Inherited Members
Namespace: Hiero.Converters
Assembly: Hiero.dll
Syntax
public sealed class NullableEvmAddressConverter : JsonConverter<EvmAddress?>
Methods
| Edit this page View SourceRead(ref Utf8JsonReader, Type, JsonSerializerOptions)
Reads and converts the JSON to type EvmAddress.
Declaration
public override EvmAddress? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Utf8JsonReader | reader | The reader. |
| Type | typeToConvert | The type to convert. |
| JsonSerializerOptions | options | An object that specifies serialization options to use. |
Returns
| Type | Description |
|---|---|
| EvmAddress | The converted value. |
Overrides
| Edit this page View SourceWrite(Utf8JsonWriter, EvmAddress?, JsonSerializerOptions)
Writes a specified value as JSON.
Declaration
public override void Write(Utf8JsonWriter writer, EvmAddress? evmAddress, JsonSerializerOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| Utf8JsonWriter | writer | The writer to write to. |
| EvmAddress | evmAddress | |
| JsonSerializerOptions | options | An object that specifies serialization options to use. |