Entity
Defined in: src/types/entity.ts:36
An entity as it comes back from a query.
Which fields are populated is decided by the query’s selection — select({ key: true }) gives
back an entity carrying only its key. The static type of a select() result is narrowed to
exactly the selected fields, so in typed code the undefineds here are not reachable.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Entity(
fields):Entity
Defined in: src/types/entity.ts:49
Parameters
Section titled “Parameters”fields
Section titled “fields”EntityFields = {}
Returns
Section titled “Returns”Entity
Properties
Section titled “Properties”attributes
Section titled “attributes”attributes:
Readonly<Record<string,AnyArkivValue>> |undefined
Defined in: src/types/entity.ts:47
Attribute names, types and values.
Implementation of
Section titled “Implementation of”EntityFields.attributes
attributeSchema
Section titled “attributeSchema”attributeSchema:
Readonly<Record<string,"bool"|"i32"|"u64"|"u256"|"dec"|"bytes32"|"bytes"|"str"|"addr"|"key">> |undefined
Defined in: src/types/entity.ts:46
Attribute names and types, with no values.
Implementation of
Section titled “Implementation of”EntityFields.attributeSchema
contentType
Section titled “contentType”contentType:
string|undefined
Defined in: src/types/entity.ts:44
Implementation of
Section titled “Implementation of”EntityFields.contentType
createdAt
Section titled “createdAt”createdAt:
bigint|undefined
Defined in: src/types/entity.ts:40
Block the entity was created at.
Implementation of
Section titled “Implementation of”EntityFields.createdAt
creationFlags
Section titled “creationFlags”creationFlags:
ResolvedCreationFlags|undefined
Defined in: src/types/entity.ts:43
The immutable properties the entity was created with.
Implementation of
Section titled “Implementation of”EntityFields.creationFlags
creator
Section titled “creator”creator:
`0x${string}`|undefined
Defined in: src/types/entity.ts:39
Implementation of
Section titled “Implementation of”EntityFields.creator
expiresAt
Section titled “expiresAt”expiresAt:
bigint|undefined
Defined in: src/types/entity.ts:42
Block the entity expires at.
Implementation of
Section titled “Implementation of”EntityFields.expiresAt
key:
`0x${string}`|undefined
Defined in: src/types/entity.ts:37
Implementation of
Section titled “Implementation of”EntityFields.key
owner:
`0x${string}`|undefined
Defined in: src/types/entity.ts:38
Implementation of
Section titled “Implementation of”EntityFields.owner
payload
Section titled “payload”payload:
Uint8Array<ArrayBufferLike> |undefined
Defined in: src/types/entity.ts:45
Implementation of
Section titled “Implementation of”EntityFields.payload
updatedAt
Section titled “updatedAt”updatedAt:
bigint|undefined
Defined in: src/types/entity.ts:41
Block the entity was last patched at.
Implementation of
Section titled “Implementation of”EntityFields.updatedAt
Methods
Section titled “Methods”toJson()
Section titled “toJson()”toJson():
any
Defined in: src/types/entity.ts:90
The payload parsed as JSON.
Returns
Section titled “Returns”any
Throws
Section titled “Throws”If the payload was not selected, is empty, or is not valid JSON.
toText()
Section titled “toText()”toText():
string
Defined in: src/types/entity.ts:68
The payload decoded as UTF-8 text.
Returns
Section titled “Returns”string
Throws
Section titled “Throws”If the payload was not selected, or is not valid UTF-8.