Skip to main content

Class: Random

A typed view of the on-chain 0x2::random::Random object (the 0x8 singleton holding the global randomness state).

Extends​

  • UniffiAbstractObject

Implements​

Properties​

[destructorGuardSymbol]​

readonly [destructorGuardSymbol]: UniffiGcObject;

[pointerLiteralSymbol]​

readonly [pointerLiteralSymbol]: bigint;

[uniffiTypeNameSymbol]​

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

Methods​

id()​

id(): ObjectIdLike;

The object's ID.

Returns​

ObjectIdLike

Implementation of​

RandomLike.id


toDebugString()​

toDebugString(): string;

Returns​

string


toString()​

toString(): string;

Returns a string representation of an object.

Returns​

string


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

instanceOf()​

static instanceOf(obj_): obj_ is Random;

Parameters​

obj_​

any

Returns​

obj_ is Random


tryFromBcs()​

static tryFromBcs(bytes): RandomLike;

Decode from BCS bytes, without validating the on-chain type tag.

Parameters​

bytes​

ArrayBuffer

Returns​

RandomLike


tryFromObject()​

static tryFromObject(object): RandomLike;

Decode from an on-chain object, validating its Move type tag.

Parameters​

object​

ObjectLike

Returns​

RandomLike