Type Alias NostrConnectConnectionMethods

NostrConnectConnectionMethods: {
    onAuth?: ((url: string) => Promise<void>);
    onPublishEvent: ((event: NostrEvent, relays: string[]) => Promise<void>);
    onSubClose: (() => Promise<void>);
    onSubOpen: ((filters: Filter[], relays: string[], onEvent: ((event: NostrEvent) => void)) => Promise<void>);
}

Type declaration

  • OptionalonAuth?: ((url: string) => Promise<void>)

    A method for handling "auth" requests

      • (url): Promise<void>
      • Parameters

        • url: string

        Returns Promise<void>

  • onPublishEvent: ((event: NostrEvent, relays: string[]) => Promise<void>)

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

      • (event, relays): Promise<void>
      • Parameters

        • event: NostrEvent
        • relays: string[]

        Returns Promise<void>

  • onSubClose: (() => Promise<void>)

    A method called when the subscription should be closed

      • (): Promise<void>
      • Returns Promise<void>

  • onSubOpen: ((filters: Filter[], relays: string[], onEvent: ((event: NostrEvent) => void)) => Promise<void>)

    A method that is called when the subscription needs to be updated

      • (filters, relays, onEvent): Promise<void>
      • Parameters

        • filters: Filter[]
        • relays: string[]
        • onEvent: ((event: NostrEvent) => void)
            • (event): void
            • Parameters

              • event: NostrEvent

              Returns void

        Returns Promise<void>