Skip to content

Documentation / @etherfold/processor-entities / EntityReads

Type Alias: EntityReads<S, E> ​

EntityReads<S, E> = object

Defined in: packages/state-store/dist/read-surface.d.ts:90

The four seam reads of ONE declared entity, typed off its declaration.

Type Parameters ​

S ​

S extends StateStore

E ​

E extends EntityDeclaration

Methods ​

getAsOf() ​

getAsOf(id, at): Promise<EntityRow<E> | undefined>

Defined in: packages/state-store/dist/read-surface.d.ts:99

The entity as of a block, or undefined if it was absent then.

Throws rather than answering when the address resolves to no block, or when the store does not retain that far back: see the module note.

Parameters ​

id ​

EntityIdOf<E>

at ​

AsOfAddress<S>

Returns ​

Promise<EntityRow<E> | undefined>


getCurrent() ​

getCurrent(id): Promise<EntityRow<E> | undefined>

Defined in: packages/state-store/dist/read-surface.d.ts:92

The entity at the tip, or undefined if it is absent.

Parameters ​

id ​

EntityIdOf<E>

Returns ​

Promise<EntityRow<E> | undefined>


listAsOf() ​

listAsOf(prefix, at, limit): Promise<Listing<EntityRow<E>>>

Defined in: packages/state-store/dist/read-surface.d.ts:107

The same listing as of a block. Refused, never answered from the tip, outside retention.

Parameters ​

prefix ​

EntityPrefixOf<E>

at ​

AsOfAddress<S>

limit ​

number

Returns ​

Promise<Listing<EntityRow<E>>>


listCurrent() ​

listCurrent(prefix, limit): Promise<Listing<EntityRow<E>>>

Defined in: packages/state-store/dist/read-surface.d.ts:105

The children of a prefix of the declared id at the tip, ascending in the id's own order, at most limit of them, with truncated saying whether more matched.

Parameters ​

prefix ​

EntityPrefixOf<E>

limit ​

number

Returns ​

Promise<Listing<EntityRow<E>>>