Documentation
    Preparing search index...

    Interface NappletArtifactCache

    Cache interface for verified NIP-5D napplet artifacts.

    interface NappletArtifactCache {
        deleteBlob(sha256Hex: string): Promise<void>;
        getCoordinate(
            input: { dTag: string; kind: number; pubkey: string },
            options?: CoordinateFreshnessOptions,
        ): Promise<CachedCoordinate & { fresh: boolean } | undefined>;
        markAggregateActive(dTag: string, aggregateHash: string): void;
        prune(now?: number): Promise<void>;
        readBlob(
            sha256Hex: string,
        ): Promise<Uint8Array<ArrayBufferLike> | undefined>;
        releaseAggregateActive(dTag: string, aggregateHash: string): void;
        touchAggregate(
            dTag: string,
            aggregateHash: string,
            now?: number,
        ): Promise<void>;
        writeCoordinate(
            input: {
                aggregateHash: string;
                backgroundTtlMs?: number;
                dTag: string;
                foregroundTtlMs?: number;
                kind: number;
                lastResolvedAt?: number;
                pubkey: string;
            },
        ): Promise<void>;
        writeVerifiedResolution(input: WriteVerifiedResolutionInput): Promise<void>;
    }

    Implemented by

    Index

    Methods

    • Protect an aggregate from normal pruning while it is in active use.

      Parameters

      • dTag: string
      • aggregateHash: string

      Returns void

    • Read one cached artifact blob by SHA-256 hash.

      Parameters

      • sha256Hex: string

      Returns Promise<Uint8Array<ArrayBufferLike> | undefined>

    • Release an aggregate previously marked active.

      Parameters

      • dTag: string
      • aggregateHash: string

      Returns void

    • Update aggregate/blob last-access timestamps.

      Parameters

      • dTag: string
      • aggregateHash: string
      • Optionalnow: number

      Returns Promise<void>

    • Cache the latest aggregate for a NIP-5D coordinate.

      Parameters

      • input: {
            aggregateHash: string;
            backgroundTtlMs?: number;
            dTag: string;
            foregroundTtlMs?: number;
            kind: number;
            lastResolvedAt?: number;
            pubkey: string;
        }

      Returns Promise<void>