oc · docs
docs / documentation

@orangecheck/relay-filter


@orangecheck/relay-filter / AttestationIndex

Class: AttestationIndex

Defined in: attestation-index.ts:93

Every OC attestation that binds a Nostr key, held in memory and kept current by one standing subscription. decide() answers from memory, so a relay's write path never waits on the network. Bonds are re-read from the chain in the background every refreshMs, which bounds how long a spent bond keeps passing (SECURITY.md §2, chain finality).

Constructors

Constructor

new AttestationIndex(options?: IndexOptions): AttestationIndex;

Defined in: attestation-index.ts:104

Parameters

ParameterType
optionsIndexOptions

Returns

AttestationIndex

Accessors

size

Get Signature

get size(): number;

Defined in: attestation-index.ts:205

Attestations held, for logging.

Returns

number

Methods

decide()

decide(event: MinimalNostrEvent, opts?: FilterOptions): FilterDecision;

Defined in: attestation-index.ts:140

Parameters

ParameterType
eventMinimalNostrEvent
optsFilterOptions

Returns

FilterDecision


ingest()

ingest(event: {
  content?: string;
  tags?: string[][];
}): boolean;

Defined in: attestation-index.ts:120

Add one attestation event. Returns true if it was new and sound.

Parameters

ParameterType
event{ content?: string; tags?: string[][]; }
event.content?string
event.tags?string[][]

Returns

boolean


markSynced()

markSynced(): void;

Defined in: attestation-index.ts:136

Mark the initial backlog as loaded; before this, unknown keys are "not yet", not "no".

Returns

void


start()

start(): void;

Defined in: attestation-index.ts:106

Returns

void


stop()

stop(): void;

Defined in: attestation-index.ts:113

Returns

void