Skip to content

IProofCache<T>

SIP Protocol API Reference v0.7.4


SIP Protocol API Reference / IProofCache

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2972

Base cache interface

T = SingleProof

get(key): Promise<CacheLookupResult<T>>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2976

Get an entry from the cache

string | CacheKey

Promise<CacheLookupResult<T>>


set(key, value, ttlMs?): Promise<boolean>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2980

Set an entry in the cache

string | CacheKey

T

number

Promise<boolean>


delete(key): Promise<boolean>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2984

Delete an entry from the cache

string | CacheKey

Promise<boolean>


has(key): Promise<boolean>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2988

Check if an entry exists

string | CacheKey

Promise<boolean>


clear(): Promise<void>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2992

Clear all entries

Promise<void>


getStats(): ProofCacheStats

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2996

Get cache statistics

ProofCacheStats


keys(pattern?): Promise<string[]>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3000

Get all keys matching a pattern

string

Promise<string[]>


addEventListener(listener): void

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3004

Add an event listener

CacheEventListener

void


removeEventListener(listener): void

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:3008

Remove an event listener

CacheEventListener

void