Skip to main content

ObjectId

type ObjectId

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

## Relationship to Address

`Address`es and `ObjectId`s 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:

```text object-id = address ```

type ObjectId struct {
// contains filtered or unexported fields
}

func LiftFromExternalObjectId

func LiftFromExternalObjectId(handle uint64) *ObjectId

func ObjectIdAuthenticatorState

func ObjectIdAuthenticatorState() *ObjectId

func ObjectIdClock

func ObjectIdClock() *ObjectId

func ObjectIdDenyList

func ObjectIdDenyList() *ObjectId

func ObjectIdDeriveId

func ObjectIdDeriveId(digest *TransactionDigest, count uint64) *ObjectId

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

func ObjectIdFramework

func ObjectIdFramework() *ObjectId

func ObjectIdFromBcs

func ObjectIdFromBcs(bcs []byte) (*ObjectId, error)

Create this type from BCS encoded bytes.

func ObjectIdFromBytes

func ObjectIdFromBytes(bytes []byte) (*ObjectId, error)

func ObjectIdFromHex

func ObjectIdFromHex(hex string) (*ObjectId, error)

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).

func ObjectIdFromJson

func ObjectIdFromJson(json string) (*ObjectId, error)

Create this type from JSON encoded string.

func ObjectIdFromPrefixedHex

func ObjectIdFromPrefixedHex(hex string) (*ObjectId, error)

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).

func ObjectIdFromPrefixedShortHex

func ObjectIdFromPrefixedShortHex(hex string) (*ObjectId, error)

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 `0`s.

func ObjectIdFromShortHex

func ObjectIdFromShortHex(hex string) (*ObjectId, error)

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 `0`s.

func ObjectIdGenesisBridge

func ObjectIdGenesisBridge() *ObjectId

func ObjectIdGenesisIotaBridge

func ObjectIdGenesisIotaBridge() *ObjectId

func ObjectIdMax

func ObjectIdMax() *ObjectId

func ObjectIdRandomnessState

func ObjectIdRandomnessState() *ObjectId

func ObjectIdStardust

func ObjectIdStardust() *ObjectId

func ObjectIdStd

func ObjectIdStd() *ObjectId

func ObjectIdSystem

func ObjectIdSystem() *ObjectId

func ObjectIdSystemState

func ObjectIdSystemState() *ObjectId

func ObjectIdTransactionDenyRules

func ObjectIdTransactionDenyRules() *ObjectId

func ObjectIdZero

func ObjectIdZero() *ObjectId

func (*ObjectId) DebugString

func (_self *ObjectId) DebugString() string

func (*ObjectId) DeriveDynamicChildId

func (_self *ObjectId) DeriveDynamicChildId(keyTypeTag *TypeTag, keyBytes []byte) *ObjectId

Derive an ObjectId for a Dynamic Child Object.

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

func (*ObjectId) DeriveObjectId

func (_self *ObjectId) DeriveObjectId(keyTypeTag *TypeTag, keyBytes []byte) *ObjectId

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

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

func (*ObjectId) Destroy

func (object *ObjectId) Destroy()

func (*ObjectId) Eq

func (_self *ObjectId) Eq(other *ObjectId) bool

func (*ObjectId) Hash

func (_self *ObjectId) Hash() uint64

func (*ObjectId) Ne

func (_self *ObjectId) Ne(other *ObjectId) bool

func (*ObjectId) NextLexicographical

func (_self *ObjectId) NextLexicographical() *ObjectId

Returns the next digest in byte-increasing order.

func (*ObjectId) NextLexicographicalOpt

func (_self *ObjectId) NextLexicographicalOpt() **ObjectId

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

func (*ObjectId) String

func (_self *ObjectId) String() string

func (*ObjectId) ToAddress

func (_self *ObjectId) ToAddress() *Address

func (*ObjectId) ToBytes

func (_self *ObjectId) ToBytes() []byte

func (*ObjectId) ToCanonicalString

func (_self *ObjectId) ToCanonicalString(withPrefix bool) string

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

func (*ObjectId) ToHex

func (_self *ObjectId) ToHex() string

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

func (*ObjectId) ToRawHex

func (_self *ObjectId) ToRawHex() string

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

func (*ObjectId) ToRawShortHex

func (_self *ObjectId) ToRawShortHex() string

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

func (*ObjectId) ToShortHex

func (_self *ObjectId) ToShortHex() string

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