Class NostrRoom<T>

Type Parameters

  • T extends {}

Hierarchy

Constructors

  • Type Parameters

    • T extends {}

    Parameters

    • signer: SignerAPI
    • Optional options: Partial<RoomConfig>

    Returns NostrRoom<T>

Properties

_events: Map<"close" | "error" | "ready" | "reject" | "msg" | "fetch" | "update", Set<Function>>
_init: boolean
_socket: NostrSocket
_store: NostrStore<T>
list: ((address, signer, filter?, options?) => Promise<StoreItem[]>) = NostrStore.list

Type declaration

    • (address, signer, filter?, options?): Promise<StoreItem[]>
    • Fetch a list of recoverable stores from the relay.

      Parameters

      Returns Promise<StoreItem[]>

Accessors

  • get store(): Map<string, any>
  • Returns Map<string, any>

Methods

  • Parameters

    • event: string

    Returns Set<Function>

  • Parameters

    • secret: string

    Returns void

  • Parameters

    • event: string

    Returns void

  • Connect to the room using the specified relay address.

    Parameters

    • address: string
    • secret: string

    Returns Promise<NostrRoom<T>>

  • Type Parameters

    • K extends "close" | "error" | "ready" | "reject" | "msg" | "fetch" | "update"

    Parameters

    Returns void

  • Type Parameters

    • K extends "close" | "error" | "ready" | "reject" | "msg" | "fetch" | "update"

    Parameters

    • topic: K

    Returns boolean

  • Type Parameters

    • K extends "close" | "error" | "ready" | "reject" | "msg" | "fetch" | "update"

    Parameters

    • event: K
    • method: ((args) => void | Promise<void>)
        • (args): void | Promise<void>
        • Parameters

          Returns void | Promise<void>

    Returns void

  • Type Parameters

    • T

    Parameters

    • topic: string
    • fn: ((msg) => void)

    Returns void

  • Type Parameters

    • K extends "close" | "error" | "ready" | "reject" | "msg" | "fetch" | "update"

    Parameters

    • event: K
    • method: ((args) => void | Promise<void>)
        • (args): void | Promise<void>
        • Parameters

          Returns void | Promise<void>

    Returns void

  • Type Parameters

    • K extends "close" | "error" | "ready" | "reject" | "msg" | "fetch" | "update"

    Parameters

    • event: string
    • method: ((args) => void | Promise<void>)
        • (args): void | Promise<void>
        • Parameters

          Returns void | Promise<void>

    Returns void

  • Type Parameters

    • K extends "close" | "error" | "ready" | "reject" | "msg" | "fetch" | "update"

    Parameters

    • event: K
    • method: ((args) => void | Promise<void>)
        • (args): void | Promise<void>
        • Parameters

          Returns void | Promise<void>

    • timeout: number

    Returns void

Generated using TypeDoc