Table of Contents

Struct Expiry

Namespace
Concordium.Sdk.Types
Assembly
Concordium.Sdk.dll

Represents an expiration time for a transaction.

A transaction can not be included in a block if its expiration time is before the block (slot) time.

public readonly record struct Expiry : IEquatable<Expiry>
Implements
Inherited Members

Fields

BytesLength

Get the number of bytes used to represent an expiry when serialized.

public const int BytesLength = 8

Field Value

int

Methods

AtMinutesFromNow(ulong)

Creates a new expiration time that is minutes ahead of the current system time.

public static Expiry AtMinutesFromNow(ulong minutes)

Parameters

minutes ulong

An expiration time specified by the number of minutes from the current system time.

Returns

Expiry

AtSecondsFromNow(ulong)

Creates a new expiration time that is seconds from the current system time.

public static Expiry AtSecondsFromNow(ulong seconds)

Parameters

seconds ulong

An expiration time specified by the number of seconds from the current system time.

Returns

Expiry

From(DateTime)

Creates an instance from a DateTime.

public static Expiry From(DateTime date)

Parameters

date DateTime

Returns

Expiry

From(DateTimeOffset)

Creates an instance from a DateTimeOffset.

public static Expiry From(DateTimeOffset timestamp)

Parameters

timestamp DateTimeOffset

Returns

Expiry

From(ulong)

Creates an instance from a expiration time represented by the elapsed number of seconds since the UNIX epoch.

public static Expiry From(ulong secondsSinceEpoch)

Parameters

secondsSinceEpoch ulong

Expiration time represented by the elapsed seconds since the UNIX epoch.

Returns

Expiry

Exceptions

ArgumentOutOfRangeException

The supplied ulong timestamp has a value which exceeds the maximum value of a long.

GetValue()

Get the expiration time represented by the elapsed number of seconds since the UNIX epoch.

public ulong GetValue()

Returns

ulong

Now()

Creates an instance whose expiration time is the current system time.

public static DateTimeOffset Now()

Returns

DateTimeOffset

Exceptions

ArgumentOutOfRangeException

System time as number of seconds since UNIX epoch should be larger than 0.

ToBytes()

Copies the expiration time represented by the elapsed number of seconds since the UNIX epoch written as a 64-bit integer in big-endian format to a byte array.

public byte[] ToBytes()

Returns

byte[]

ToProto()

Converts the expiration time to its corresponding protocol buffer message instance.

This can be used as the input for class methods of RawClient.

public TransactionTime ToProto()

Returns

TransactionTime

ToString()

Get a string representation of the date and time in the calendar used by the current culture.

public override string ToString()

Returns

string

Operators

operator >(Expiry, Expiry)

Determines whether one Expiry is greater than a second Expiry.

public static bool operator >(Expiry left, Expiry right)

Parameters

left Expiry
right Expiry

Returns

bool

operator >=(Expiry, Expiry)

Determines whether one Expiry is greater or equal than a second Expiry.

public static bool operator >=(Expiry left, Expiry right)

Parameters

left Expiry
right Expiry

Returns

bool

operator <(Expiry, Expiry)

Determines whether one Expiry is less than a second Expiry.

public static bool operator <(Expiry left, Expiry right)

Parameters

left Expiry
right Expiry

Returns

bool

operator <=(Expiry, Expiry)

Determines whether one Expiry is less or equal than a second Expiry.

public static bool operator <=(Expiry left, Expiry right)

Parameters

left Expiry
right Expiry

Returns

bool