Skip to main content
Version: 21.0.x

Class: Entity<UniqueIdentifiers, HumanReadable>

api/entities/Entity.Entity

Represents an object or resource in the Polymesh Ecosystem with its own set of properties and functionality

Type parameters

Name
UniqueIdentifiers
HumanReadable

Hierarchy

Properties

uuid

uuid: string

Defined in

api/entities/Entity.ts:46

Methods

exists

Abstract exists(): Promise<boolean>

Determine whether this Entity exists on chain

Returns

Promise<boolean>


isEqual

isEqual(entity): boolean

Determine whether this Entity is the same as another one

Parameters

NameType
entityEntity<unknown, unknown>

Returns

boolean


toHuman

Abstract toHuman(): HumanReadable

Returns Entity data in a human readable (JSON) format

Returns

HumanReadable


generateUuid

Static generateUuid<Identifiers>(identifiers): string

Generate the Entity's UUID from its identifying properties

Type parameters

Name
Identifiers

Parameters

NameType
identifiersIdentifiers

Returns

string


isUniqueIdentifiers

Static isUniqueIdentifiers(identifiers): boolean

Typeguard that checks whether the object passed corresponds to the unique identifiers of the class. Must be overridden

Parameters

NameTypeDescription
identifiersunknownobject to type check

Returns

boolean


unserialize

Static unserialize<Identifiers>(serialized): Identifiers

Unserialize a UUID into its Unique Identifiers

Type parameters

Name
Identifiers

Parameters

NameTypeDescription
serializedstringUUID to unserialize

Returns

Identifiers