Entity
Defined in: src/types/entity.ts:5
Properties
Section titled “Properties”attributes
Section titled “attributes”attributes:
Attribute[]
Defined in: src/types/entity.ts:16
contentType
Section titled “contentType”contentType:
MimeType|undefined
Defined in: src/types/entity.ts:7
createdAtBlock
Section titled “createdAtBlock”createdAtBlock:
bigint|undefined
Defined in: src/types/entity.ts:11
creator
Section titled “creator”creator:
`0x${string}`|undefined
Defined in: src/types/entity.ts:9
expiresAtBlock
Section titled “expiresAtBlock”expiresAtBlock:
bigint|undefined
Defined in: src/types/entity.ts:10
key:
`0x${string}`
Defined in: src/types/entity.ts:6
lastModifiedAtBlock
Section titled “lastModifiedAtBlock”lastModifiedAtBlock:
bigint|undefined
Defined in: src/types/entity.ts:12
operationIndexInTransaction
Section titled “operationIndexInTransaction”operationIndexInTransaction:
bigint|undefined
Defined in: src/types/entity.ts:14
owner:
`0x${string}`|undefined
Defined in: src/types/entity.ts:8
payload
Section titled “payload”payload:
Uint8Array<ArrayBufferLike> |undefined
Defined in: src/types/entity.ts:15
transactionIndexInBlock
Section titled “transactionIndexInBlock”transactionIndexInBlock:
bigint|undefined
Defined in: src/types/entity.ts:13
Methods
Section titled “Methods”toJson()
Section titled “toJson()”toJson():
any
Defined in: src/types/entity.ts:72
Parses the entity payload as JSON and returns the resulting object. Throws an error if the payload is undefined, which may occur if the entity was not queried with the withPayload option. Throws an error if the payload is empty or cannot be parsed as JSON.
Returns
Section titled “Returns”any
The parsed JSON object from the entity payload.
toText()
Section titled “toText()”toText():
string
Defined in: src/types/entity.ts:50
Converts the entity payload from bytes to a string and returns it. Throws an error if the payload is undefined, which may occur if the entity was not queried with the withPayload option. Throws an error if the conversion from bytes to string fails.
Returns
Section titled “Returns”string
The entity payload as a string.