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
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
ulongAn expiration time specified by the number of minutes from the current system time.
Returns
AtSecondsFromNow(ulong)
Creates a new expiration time that is seconds
from the current system time.
public static Expiry AtSecondsFromNow(ulong seconds)
Parameters
seconds
ulongAn expiration time specified by the number of seconds from the current system time.
Returns
From(DateTime)
Creates an instance from a DateTime.
public static Expiry From(DateTime date)
Parameters
date
DateTime
Returns
From(DateTimeOffset)
Creates an instance from a DateTimeOffset.
public static Expiry From(DateTimeOffset timestamp)
Parameters
timestamp
DateTimeOffset
Returns
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
ulongExpiration time represented by the elapsed seconds since the UNIX epoch.
Returns
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
Now()
Creates an instance whose expiration time is the current system time.
public static DateTimeOffset Now()
Returns
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
ToString()
Get a string representation of the date and time in the calendar used by the current culture.
public override string ToString()
Returns
Operators
operator >(Expiry, Expiry)
Determines whether one Expiry is greater than a second Expiry.
public static bool operator >(Expiry left, Expiry right)
Parameters
Returns
operator >=(Expiry, Expiry)
Determines whether one Expiry is greater or equal than a second Expiry.
public static bool operator >=(Expiry left, Expiry right)
Parameters
Returns
operator <(Expiry, Expiry)
Determines whether one Expiry is less than a second Expiry.
public static bool operator <(Expiry left, Expiry right)
Parameters
Returns
operator <=(Expiry, Expiry)
Determines whether one Expiry is less or equal than a second Expiry.
public static bool operator <=(Expiry left, Expiry right)