Table of Contents

Class Converters

Namespace
chia.dotnet
Assembly
chia-dotnet.dll

Helper functions for deserialization and conversion

public static class Converters
Inheritance
Converters
Inherited Members

Methods

ToDateTime(double)

Converts an epoch into a DateTime

public static DateTime ToDateTime(this double epoch)

Parameters

epoch double

Returns

DateTime

ToDateTime(ulong?)

Converts an epoch into a DateTime

public static DateTime? ToDateTime(this ulong? epoch)

Parameters

epoch ulong?

Returns

DateTime?

ToDateTime(ulong)

Converts an epoch into a DateTime

public static DateTime ToDateTime(this ulong epoch)

Parameters

epoch ulong

Returns

DateTime

ToJson(object)

Serializes an object instance into json, using snake casing and ignoring nulls

public static string ToJson(this object o)

Parameters

o object

Returns

string

ToObject<T>(string)

Deserializes a json string into the specified type, expecting snake casing

public static T? ToObject<T>(this string json)

Parameters

json string

JSON

Returns

T

Deserialized instance

Type Parameters

T

The desired type

ToTimestamp(DateTime)

Converts a DateTime object to an epoch integer

public static ulong ToTimestamp(this DateTime epoch)

Parameters

epoch DateTime

Returns

ulong