Class EndpointBuilder

A mutable handle to an endpoint builder.

Mirrors the uniffi EndpointBuilder. A "preset" in JS is simply any function (builder: EndpointBuilder) => void — call one of the built-in [presetN0] / [presetMinimal] / [presetN0DisableRelay] helpers (which install the crypto provider) and then layer on your own configuration.

const b = Endpoint.builder()
presetMinimal(b)
b.alpns([alpn])
const ep = await b.bind()

Constructors

Methods

  • Set the advertised ALPNs.

    Parameters

    • alpns: number[][]

    Returns void

  • Replay the minimal preset (crypto provider only, no external deps).

    Returns void

  • Replay the n0 production preset (relays + discovery + crypto provider).

    Returns void

  • Replay the n0 preset with relays disabled.

    Returns void

  • Set the address the endpoint binds to (host:port).

    Parameters

    • addr: string

    Returns void

  • Set the endpoint secret key (32 bytes).

    Parameters

    • bytes: number[]

    Returns void