Skip to main content
Version: 30.0.x

Abstract Class: Entity<UniqueIdentifiers, HumanReadable>

Defined in: src/api/entities/Entity.ts:8

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

Extended by​

Type Parameters​

Type Parameter

UniqueIdentifiers

HumanReadable

Properties​

uuid​

uuid: string

Defined in: src/api/entities/Entity.ts:46

Methods​

exists()​

abstract exists(): Promise<boolean>

Defined in: src/api/entities/Entity.ts:68

Determine whether this Entity exists on chain

Returns​

Promise<boolean>


isEqual()​

isEqual(entity: Entity<unknown, unknown>): boolean

Defined in: src/api/entities/Entity.ts:61

Determine whether this Entity is the same as another one

Parameters​

ParameterType

entity

Entity<unknown, unknown>

Returns​

boolean


toHuman()​

abstract toHuman(): HumanReadable

Defined in: src/api/entities/Entity.ts:73

Returns Entity data in a human readable (JSON) format

Returns​

HumanReadable


generateUuid()​

static generateUuid<Identifiers>(identifiers: Identifiers): string

Defined in: src/api/entities/Entity.ts:14

Generate the Entity's UUID from its identifying properties

Type Parameters​

Type Parameter

Identifiers

Parameters​

ParameterTypeDescription

identifiers

Identifiers

‐

Returns​

string


isUniqueIdentifiers()​

static isUniqueIdentifiers(identifiers: unknown): boolean

Defined in: src/api/entities/Entity.ts:42

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

Parameters​

ParameterTypeDescription

identifiers

unknown

object to type check

Returns​

boolean


unserialize()​

static unserialize<Identifiers>(serialized: string): Identifiers

Defined in: src/api/entities/Entity.ts:23

Unserialize a UUID into its Unique Identifiers

Type Parameters​

Type Parameter

Identifiers

Parameters​

ParameterTypeDescription

serialized

string

UUID to unserialize

Returns​

Identifiers