Skip to content

@lelantos-org/sdk / prover / ArtifactCache

Interface: ArtifactCache โ€‹

Defined in: @lelantos-org/sdk/dist/prover/artifact-cache.d.ts:14

Persistence port for artifact bytes, keyed by absolute URL.

Implement this to store artifacts somewhere other than the Cache API โ€” IndexedDB, OPFS, an Electron userData directory โ€” and install it with configureArtifactCache.

Unlike the wallet-tier ports (NoteStore, TreePersistence), neither method may throw: those persist state whose loss is a correctness problem, whereas a cache is an optimisation and a storage failure must degrade to a network fetch. They are also get/put rather than load/save because this port is keyed โ€” it holds one entry per artifact URL, not one document.

Methods โ€‹

get() โ€‹

ts
get(url): Promise<Uint8Array<ArrayBufferLike> | null>;

Defined in: @lelantos-org/sdk/dist/prover/artifact-cache.d.ts:16

Cached bytes for url, or null on a miss. Must not throw.

Parameters โ€‹

ParameterType
urlstring

Returns โ€‹

Promise<Uint8Array<ArrayBufferLike> | null>


put() โ€‹

ts
put(url, bytes): Promise<void>;

Defined in: @lelantos-org/sdk/dist/prover/artifact-cache.d.ts:18

Store bytes under url. Must not throw.

Parameters โ€‹

ParameterType
urlstring
bytesUint8Array

Returns โ€‹

Promise<void>

Lelantosno cookies ๐Ÿช ยท no tracking ๐Ÿ‘๏ธ ยท no accounts ๐Ÿ‘คwalletexplorer4536080GitHub