Applesauce
    Preparing search index...

    A client for an Open Ranking (ORE) provider — a plain HTTP/JSON interface to a nostr web of trust. Authenticates point-of-view requests with Nostr Web Tokens (kind 27519) when a signer is provided.

    Index

    Constructors

    Properties

    authorizationCache?: { expiration: number; header: Promise<string> }
    capabilities?: Promise<OpenRankingCapabilities>
    provider: string

    The base URL of the provider (without a trailing slash)

    searchCache: LRU<OpenRankingSearchResult[]> = ...
    signer?: ISigner
    tokenExpiration: number
    tokenSkew: number = 10

    Methods

    • Creates a Nostr Web Token authorization header for the provider, or an empty object when no signer is set. The signed token is cached and reused until it expires, so scoring many pubkeys only ever asks the signer once.

      Returns Promise<Record<string, string>>

    Protectedpost

    • post<T>(path: string, body: unknown): Promise<T>

      Makes a POST request to the provider, signing a Nostr Web Token when a signer is available

      Type Parameters

      • T

      Parameters

      • path: string
      • body: unknown

      Returns Promise<T>

    • Sets or clears the signer used to issue Nostr Web Tokens

      Parameters

      • Optionalsigner: ISigner

      Returns void