Skip to content

Braga has been retired. The next public testnet is coming in September 2026. Read the announcement →

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.

new Entity(fields): Entity

Defined in: src/types/entity.ts:49

EntityFields = {}

Entity

attributes: Readonly<Record<string, AnyArkivValue>> | undefined

Defined in: src/types/entity.ts:47

Attribute names, types and values.

EntityFields.attributes


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.

EntityFields.attributeSchema


contentType: string | undefined

Defined in: src/types/entity.ts:44

EntityFields.contentType


createdAt: bigint | undefined

Defined in: src/types/entity.ts:40

Block the entity was created at.

EntityFields.createdAt


creationFlags: ResolvedCreationFlags | undefined

Defined in: src/types/entity.ts:43

The immutable properties the entity was created with.

EntityFields.creationFlags


creator: `0x${string}` | undefined

Defined in: src/types/entity.ts:39

EntityFields.creator


expiresAt: bigint | undefined

Defined in: src/types/entity.ts:42

Block the entity expires at.

EntityFields.expiresAt


key: `0x${string}` | undefined

Defined in: src/types/entity.ts:37

EntityFields.key


owner: `0x${string}` | undefined

Defined in: src/types/entity.ts:38

EntityFields.owner


payload: Uint8Array<ArrayBufferLike> | undefined

Defined in: src/types/entity.ts:45

EntityFields.payload


updatedAt: bigint | undefined

Defined in: src/types/entity.ts:41

Block the entity was last patched at.

EntityFields.updatedAt

toJson(): any

Defined in: src/types/entity.ts:90

The payload parsed as JSON.

any

If the payload was not selected, is empty, or is not valid JSON.


toText(): string

Defined in: src/types/entity.ts:68

The payload decoded as UTF-8 text.

string

If the payload was not selected, or is not valid UTF-8.