Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Usage

import * as mod from "https://gitlab.com/soapbox-pub/nostr-machina/-/raw/main/mod.ts";

§Classes

Machina

Infinite async generator. Iterates messages pushed to it until closed. Only one consumer is expected to use a Machina instance at a time.

NiceRelay

Opinionated relay implementation that manages subscriptions and auto-reconnects.

Pubsub
Relay

Barebones relay client that deals directly with relay messages.

RelayPool
RelaySub
Semaphore

§Variables

AsyncSocket

Functions that make WebSockets more pleasant to use with async code.

exponential

Exponential backoff function.

fibonacci

Fibonacci backoff function.

§Functions

reanimate

Keep the WebSocket connected. When closed, a new socket is created.

§Interfaces

NiceRelaySub

Relay subscription interface. Loop over it to get events.

ReanimateOpts

Options for the reanimate function.

Sub

§Type Aliases

Backoff

Function that calculates the wait time between reconnection attempts.