Skip to main content

Version

Namespace: IotaSdk

public class Version : IVersion, System.IDisposable

Inheritance Object → Version
Implements IVersion, IDisposable
Attributes NullableContextAttribute, NullableAttribute

Constructors​

Version(UInt64)​

public Version(ulong pointer)

Parameters​

pointer UInt64

Methods​

Destroy()​

public void Destroy()

Dispose()​

public void Dispose()

AsU64()​

Get the underlying u64 value of this version

public ulong AsU64()

Returns​

UInt64

GetCongestedVersionSuggestedGasPrice()​

Returns the suggested_gas_price embedded in this congested shared object version. The suggested_gas_price here is used for a gas price feedback mechanism for transactions canceled due to shared object congestion.

public ulong GetCongestedVersionSuggestedGasPrice()

Returns​

UInt64

Exceptions​

SdkFfiException

IsCanceled()​

Checks if this version is canceled, i.e., the corresponding object appears in a canceled transaction.

public bool IsCanceled()

Returns​

Boolean

IsCongested()​

Check if this version is congested, i.e., the corresponding object is the reason for transaction cancellation.

public bool IsCongested()

Returns​

Boolean

IsValid()​

Checks if this version is valid, i.e., the corresponding object does not appear in a canceled transaction.

public bool IsValid()

Returns​

Boolean

Next()​

Returns the next version, or an error if overflow occurs.

public Version Next()

Returns​

Version

Exceptions​

SdkFfiException

Previous()​

Returns the previous version, or an error if underflow occurs.

public Version Previous()

Returns​

Version

Exceptions​

SdkFfiException

CanceledRead()​

Special version that is assigned to objects which are accessed immutably in a canceled transaction.

public static Version CanceledRead()

Returns​

Version

CongestedPriorToGasPriceFeedback()​

Special version that was assigned to congested objects which cause transaction cancellations. Note that this special version was only used prior to the introduction of a gas price feedback mechanism, but it is kept for backward compatibility.

public static Version CongestedPriorToGasPriceFeedback()

Returns​

Version

FromU64(UInt64)​

Create a new Version from a u64 value

public static Version FromU64(ulong value)

Parameters​

value UInt64

Returns​

Version

LamportIncrement(Version[])​

Returns a new version that is greater than all versions in inputs, assuming this operation will not overflow.

public static Version LamportIncrement(Version[] inputs)

Parameters​

inputs Version[]

Returns​

Version

Exceptions​

SdkFfiException

MaxValidExcl()​

An exclusive upper limit on a valid version: versions strictly smaller than this limit are valid versions.

A valid version means an object, which this version is assigned to, does not appear in a canceled transaction. Versions larger than this value are "special" and assigned to objects that appear in canceled transactions.

public static Version MaxValidExcl()

Returns​

Version

MinValidIncl()​

An inclusive lower limit on a valid version.

A valid version means an object, which this version is assigned to, does not appear in a canceled transaction.

public static Version MinValidIncl()

Returns​

Version

NewCongestedWithSuggestedGasPrice(UInt64)​

Returns a special version used for congested shared objects: Version::MIN_CONGESTED + suggested_gas_price, where suggested_gas_price is embedded into a congested version to facilitate a gas price feedback mechanism for transactions canceled due to shared object congestion.

public static Version NewCongestedWithSuggestedGasPrice(ulong suggestedGasPrice)

Parameters​

suggestedGasPrice UInt64

Returns​

Version

Exceptions​

SdkFfiException

RandomnessUnavailable()​

public static Version RandomnessUnavailable()

Returns​

Version