AppleSauce
    Preparing search index...

    Class NostrConnectProvider

    Implements

    Index

    Constructors

    Properties

    client?: string

    The connected client's public key

    connected: boolean = false

    Whether a client is connected (received a connect request)

    listening: boolean = false

    Whether the provider is listening for events

    log: Debugger = ...

    Internal logger

    onClientConnect?: (client: string) => any

    Callbacks

    onClientDisconnect?: (client: string) => any
    onConnect?: (
        client: string,
        permissions: string[],
    ) => boolean | Promise<boolean>

    A method used to accept or reject connect requests

    onNip04Decrypt?: (
        pubkey: string,
        ciphertext: string,
        client: string,
    ) => boolean | Promise<boolean>

    A method used to accept or reject nip04_decrypt requests

    onNip04Encrypt?: (
        pubkey: string,
        plaintext: string,
        client: string,
    ) => boolean | Promise<boolean>

    A method used to accept or reject nip04_encrypt requests

    onNip44Decrypt?: (
        pubkey: string,
        ciphertext: string,
        client: string,
    ) => boolean | Promise<boolean>

    A method used to accept or reject nip44_decrypt requests

    onNip44Encrypt?: (
        pubkey: string,
        plaintext: string,
        client: string,
    ) => boolean | Promise<boolean>

    A method used to accept or reject nip44_encrypt requests

    onSignEvent?: (
        draft: EventTemplate,
        client: string,
    ) => boolean | Promise<boolean>

    A method used to accept or reject sign_event requests

    publishMethod: NostrPublishMethod

    A method that is called when an event needs to be published

    relays: string[]

    Relays to communicate over

    req?: Unsubscribable

    The currently active REQ subscription

    secret?: string

    The secret used to authorize clients to connect

    seen: Set<string> = ...

    A set of nostr requests that have been seen

    signer: ISigner

    The identity signer (provider's identity)

    subscriptionMethod: NostrSubscriptionMethod

    The active nostr subscription

    upstream: ISigner

    The main signer for the actual signing operations

    pool: undefined | NostrPool = undefined

    A fallback pool to use if none is pass in when creating the provider

    publishMethod: undefined | NostrPublishMethod = undefined

    A fallback method to use for publishMethod if none is passed in when creating the provider

    subscriptionMethod: undefined | NostrSubscriptionMethod = undefined

    A fallback method to use for subscriptionMethod if none is passed in when creating the provider

    Methods

    • Handle connect request

      Parameters

      • client: string
      • __namedParameters: [string, string] | [string] | [string, string, string]

      Returns Promise<string>