Skip to main content

Interface: ObjectIdLike

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

The BCS serialized form of this type is specified in bcs-schema.abnf.

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


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


nextLexicographical()​

nextLexicographical(): ObjectIdLike;

Returns the next digest in byte-increasing order.

Returns​

ObjectIdLike


nextLexicographicalOpt()​

nextLexicographicalOpt(): ObjectIdLike | undefined;

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

Returns​

ObjectIdLike | undefined


toAddress()​

toAddress(): AddressLike;

Returns​

AddressLike


toBcs()​

toBcs(): ArrayBuffer;

Convert this type to BCS encoded bytes.

Returns​

ArrayBuffer


toBytes()​

toBytes(): ArrayBuffer;

Returns​

ArrayBuffer


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


toDisplayString()​

toDisplayString(): string;

Render this type as human-readable text.

Some types also print this through the binding's native string conversion; this method is the spelling every object type has.

The layout is meant for reading and can change between releases. Use the JSON or BCS conversions for output that gets parsed.

Returns​

string


toHex()​

toHex(): string;

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

Returns​

string


toJson()​

toJson(): string;

Convert this type to a JSON encoded string.

Returns​

string


toRawHex()​

toRawHex(): string;

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

Returns​

string


toRawShortHex()​

toRawShortHex(): string;

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

Returns​

string


toShortHex()​

toShortHex(): string;

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

Returns​

string