Skip to main content

Class: ObjectId

An ObjectId is a 32-byte identifier used to uniquely identify an object on the IOTA blockchain.

Relationship to Address​

Addresses and ObjectIds share the same 32-byte addressable space but are derived leveraging different domain-separator values to ensure, cryptographically, that there won't be any overlap, e.g. there can't be a valid Object whose ObjectId is equal to that of the Address of a user account.

BCS

An ObjectId's BCS serialized form is defined by the following:

object-id = address

Extends​

  • UniffiAbstractObject

Implements​

Properties​

[destructorGuardSymbol]​

readonly [destructorGuardSymbol]: UniffiGcObject;

[pointerLiteralSymbol]​

readonly [pointerLiteralSymbol]: bigint;

[uniffiTypeNameSymbol]​

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

Methods​

deriveDynamicChildId()​

deriveDynamicChildId(keyTypeTag, keyBytes): ObjectIdLike;

Derive an ObjectId for a Dynamic Child globalThis.Object.

hash(parent || len(key) || key || key_type_tag)

Parameters​

keyTypeTag​

TypeTagLike

keyBytes​

ArrayBuffer

Returns​

ObjectIdLike

Implementation of​

ObjectIdLike.deriveDynamicChildId


deriveObjectId()​

deriveObjectId(keyTypeTag, keyBytes): ObjectIdLike;

Derive the ObjectId of a derived object (0x2::derived_object).

hash(parent || len(key) || key || DerivedObjectKey(key_type_tag))

Parameters​

keyTypeTag​

TypeTagLike

keyBytes​

ArrayBuffer

Returns​

ObjectIdLike

Implementation of​

ObjectIdLike.deriveObjectId


equals()​

equals(other): boolean;

Parameters​

other​

ObjectId

Returns​

boolean


hashCode()​

hashCode(): bigint;

Returns​

bigint


nextLexicographical()​

nextLexicographical(): ObjectIdLike;

Returns the next digest in byte-increasing order.

Returns​

ObjectIdLike

Implementation of​

ObjectIdLike.nextLexicographical


nextLexicographicalOpt()​

nextLexicographicalOpt(): ObjectIdLike | undefined;

Returns the next digest in byte-increasing order, or None if the result would overflow.

Returns​

ObjectIdLike | undefined

Implementation of​

ObjectIdLike.nextLexicographicalOpt


toAddress()​

toAddress(): AddressLike;

Returns​

AddressLike

Implementation of​

ObjectIdLike.toAddress


toBytes()​

toBytes(): ArrayBuffer;

Returns​

ArrayBuffer

Implementation of​

ObjectIdLike.toBytes


toCanonicalString()​

toCanonicalString(withPrefix): string;

Returns the string representation of this object ID using the canonical display, with or without a 0x prefix.

Parameters​

withPrefix​

boolean

Returns​

string

Implementation of​

ObjectIdLike.toCanonicalString


toDebugString()​

toDebugString(): string;

Returns​

string


toHex()​

toHex(): string;

Returns the string representation of this object id in hex format with 0x prefix.

Returns​

string

Implementation of​

ObjectIdLike.toHex


toRawHex()​

toRawHex(): string;

Returns the string representation of this object id in hex format without 0x prefix.

Returns​

string

Implementation of​

ObjectIdLike.toRawHex


toRawShortHex()​

toRawShortHex(): string;

Returns the shortest possible string representation of the object id (i.e. with leading zeroes trimmed), without 0x prefix.

Returns​

string

Implementation of​

ObjectIdLike.toRawShortHex


toShortHex()​

toShortHex(): string;

Returns the shortest possible string representation of the object ID (i.e. with leading zeroes trimmed).

Returns​

string

Implementation of​

ObjectIdLike.toShortHex


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

authenticatorState()​

static authenticatorState(): ObjectIdLike;

Returns​

ObjectIdLike


clock()​

static clock(): ObjectIdLike;

Returns​

ObjectIdLike


denyList()​

static denyList(): ObjectIdLike;

Returns​

ObjectIdLike


deriveId()​

static deriveId(digest, count): ObjectIdLike;

Create an ObjectId from a transaction digest and the number of objects that have been created during a transactions.

Parameters​

digest​

TransactionDigestLike

count​

bigint

Returns​

ObjectIdLike


framework()​

static framework(): ObjectIdLike;

Returns​

ObjectIdLike


fromBytes()​

static fromBytes(bytes): ObjectIdLike;

Parameters​

bytes​

ArrayBuffer

Returns​

ObjectIdLike


fromHex()​

static fromHex(hex): ObjectIdLike;

Parses an ObjectId from a full-length hex string (64 hex characters), with or without a 0x prefix. Will return an error if the string is not exactly 64 hex characters long (excluding the 0x prefix).

Parameters​

hex​

string

Returns​

ObjectIdLike


fromPrefixedHex()​

static fromPrefixedHex(hex): ObjectIdLike;

Parses an ObjectId from a full-length hex string (64 hex characters), with a mandatory 0x prefix. Will return an error if the string is not exactly 64 hex characters long (excluding the 0x prefix).

Parameters​

hex​

string

Returns​

ObjectIdLike


fromPrefixedShortHex()​

static fromPrefixedShortHex(hex): ObjectIdLike;

Parses an ObjectId from a hex string with a mandatory 0x prefix. The string can be of variable length; if it's shorter than 64 hex characters, it will be left-padded with 0s.

Parameters​

hex​

string

Returns​

ObjectIdLike


fromShortHex()​

static fromShortHex(hex): ObjectIdLike;

Parses an ObjectId from a hex string, with or without a 0x prefix. The string can be of variable length; if it's shorter than 64 hex characters, it will be left-padded with 0s.

Parameters​

hex​

string

Returns​

ObjectIdLike


genesisBridge()​

static genesisBridge(): ObjectIdLike;

Returns​

ObjectIdLike


genesisIotaBridge()​

static genesisIotaBridge(): ObjectIdLike;

Returns​

ObjectIdLike


instanceOf()​

static instanceOf(obj_): obj_ is ObjectId;

Parameters​

obj_​

any

Returns​

obj_ is ObjectId


max()​

static max(): ObjectIdLike;

Returns​

ObjectIdLike


randomnessState()​

static randomnessState(): ObjectIdLike;

Returns​

ObjectIdLike


stardust()​

static stardust(): ObjectIdLike;

Returns​

ObjectIdLike


std()​

static std(): ObjectIdLike;

Returns​

ObjectIdLike


system()​

static system(): ObjectIdLike;

Returns​

ObjectIdLike


systemState()​

static systemState(): ObjectIdLike;

Returns​

ObjectIdLike


transactionDenyRules()​

static transactionDenyRules(): ObjectIdLike;

Returns​

ObjectIdLike


zero()​

static zero(): ObjectIdLike;

Returns​

ObjectIdLike