Skip to main content

Class: Version

Extends

  • UniffiAbstractObject

Implements

Properties

[destructorGuardSymbol]

readonly [destructorGuardSymbol]: UniffiGcObject;

[pointerLiteralSymbol]

readonly [pointerLiteralSymbol]: bigint;

[uniffiTypeNameSymbol]

readonly [uniffiTypeNameSymbol]: "Version" = "Version";

Methods

asU64()

asU64(): bigint;

Get the underlying u64 value of this version

Returns

bigint

Implementation of

VersionLike.asU64


getCongestedVersionSuggestedGasPrice()

getCongestedVersionSuggestedGasPrice(): bigint;

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.

Returns

bigint

Implementation of

VersionLike.getCongestedVersionSuggestedGasPrice


isCanceled()

isCanceled(): boolean;

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

Returns

boolean

Implementation of

VersionLike.isCanceled


isCongested()

isCongested(): boolean;

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

Returns

boolean

Implementation of

VersionLike.isCongested


isValid()

isValid(): boolean;

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

Returns

boolean

Implementation of

VersionLike.isValid


next()

next(): VersionLike;

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

Returns

VersionLike

Implementation of

VersionLike.next


previous()

previous(): VersionLike;

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

Returns

VersionLike

Implementation of

VersionLike.previous


uniffiDestroy()

uniffiDestroy(): void;

Explicitly tell Rust to destroy the native peer that backs this object.

Once this method has been called, any following method calls will throw an error.

Can be called more than once.

Returns

void

Overrides

UniffiAbstractObject.uniffiDestroy

uniffiUse()

uniffiUse<T>(block): T;

A convenience method to use this object, then destroy it after its use.

Type Parameters

T

T

Parameters

block

(obj) => T

Returns

T

Inherited from

UniffiAbstractObject.uniffiUse

canceledRead()

static canceledRead(): VersionLike;

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

Returns

VersionLike


congestedPriorToGasPriceFeedback()

static congestedPriorToGasPriceFeedback(): VersionLike;

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.

Returns

VersionLike


fromU64()

static fromU64(value): VersionLike;

Create a new Version from a u64 value

Parameters

value

bigint

Returns

VersionLike


instanceOf()

static instanceOf(obj_): obj_ is Version;

Parameters

obj_

any

Returns

obj_ is Version


lamportIncrement()

static lamportIncrement(inputs): VersionLike;

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

Parameters

inputs

VersionLike[]

Returns

VersionLike


maxValidExcl()

static maxValidExcl(): VersionLike;

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.

Returns

VersionLike


minValidIncl()

static minValidIncl(): VersionLike;

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.

Returns

VersionLike


newCongestedWithSuggestedGasPrice()

static newCongestedWithSuggestedGasPrice(suggestedGasPrice): VersionLike;

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.

Parameters

suggestedGasPrice

bigint

Returns

VersionLike


randomnessUnavailable()

static randomnessUnavailable(): VersionLike;

Returns

VersionLike