@sloppyvoice/sdk: a TypeScript client for the Sloppy Voice v2 protocol (sv1).

The main entry point has the integrated client (SloppyVoiceClient, ServerClient), the transport layer (HTTP client, errors, token providers, paging, the event socket), sign-in and remote sessions, every resource API, discovery, calls, the MLS provider seam and every wire type.

Further entry points:

Entry point Contents
@sloppyvoice/sdk/address Addresses, display names, links (01)
@sloppyvoice/sdk/discovery Discovery (02)
@sloppyvoice/sdk/crypto Encodings and cryptographic conventions (04), identity verification (07), DM IDs (12), sealed messages and history shares (14), safety numbers
@sloppyvoice/sdk/media voice-dc/1, video-dc/1 and SFrame helpers (16–18)
@sloppyvoice/sdk/wire Wire types only
@sloppyvoice/sdk/testing MockServer, an in-memory server for tests
@sloppyvoice/sdk/node Node-only helpers: the DNS TXT resolver
import { SloppyVoiceClient, botToken } from '@sloppyvoice/sdk'
import { nodeTxtResolver } from '@sloppyvoice/sdk/node'

const sv = new SloppyVoiceClient({ client: 'my-bot/1.0', auth: botToken('svb_…'), home: 'sloppyvoice.com', txt: nodeTxtResolver() })
const home = await sv.home()
import { … } from '@sloppyvoice/sdk'

Classes

AddressesApi class

Address lookup (01 §9).

class AddressesApi

constructor

new AddressesApi(http: HttpClient)

get

get(local: string, opts?: PublicReadOptions): Promise<AddressInfo>

Look up what a local part names on this server. GET /v1/addresses/{local} (01 §9.2, §9.3). local may be in any input form (case, width and spacing variants, the display-local form); it is sent as one percent-encoded path segment, and the server answers with the canonical address, never echoing the form sent.

Rejects with address.not_found (404, data per 01 §9.4), address.deleted (410), address.invalid_local_part (400), core.unauthenticated/core.token_expired (401) or core.rate_limited (429). Clients debounce live checks by at least 300 ms (01 §8.3).

local: string
opts: PublicReadOptions

Default: {}

lookup

lookup(local: string, opts?: PublicReadOptions): Promise<AddressInfo>

Alias of get, named after 01 §9 ("address lookup").

local: string
opts: PublicReadOptions

Default: {}

checkAvailability

checkAvailability(local: string, opts?: PublicReadOptions): Promise<AddressAvailability>

The availability check of sign-up (01 §9.4, 00 §8 F1): the lookup, read as availability. 200 means taken; 404 carries available and reason; 410 means the address is quarantined and not available. Other errors (400 for a name that fails the profile, 429, network) reject.

local: string
opts: PublicReadOptions

Default: {}

Source: api/addresses.ts:39

AttachmentsApi class

Attachment uploads and downloads (11 §14).

class AttachmentsApi

constructor

new AttachmentsApi(http: HttpClient, options?: AttachmentsApiOptions)
options: AttachmentsApiOptions

Default: {}

maxAttachmentBytes

get maxAttachmentBytes(): number

The maxAttachmentBytes this API checks against (11 §2.3).

create

create(ctx: string, body: CreateAttachmentRequest, opts?: RequestOptions): Promise<CreateAttachmentResponse>

Step 1: create an upload (11 §14.2). Returns the pending Attachment and the upload instructions. POST /v1/contexts/{ctx}/attachments.

ctx: string

put

put(upload: UploadInstructions, blob: Uint8Array, opts?: RequestOptions): Promise<void>

Step 2: send the blob to upload.url with PUT (11 §14.2): Content-Type: application/octet-stream and every header of upload.headers. The session token is sent only if the URL is under {base}/; a pre-signed capability URL gets no Authorization.

blob: Uint8Array

putContent

putContent(ctx: string, id: string, blob: Uint8Array, opts?: RequestOptions): Promise<void>

Upload the blob to the server's own endpoint (11 §14.2), which accepts only the uploader's session and answers 204. PUT /v1/contexts/{ctx}/attachments/{id}/content.

ctx: string
id: string
blob: Uint8Array

complete

complete(ctx: string, id: string, opts?: RequestOptions): Promise<Attachment>

Step 3: complete (11 §14.2). The server checks the length (422 attachment.size_mismatch) and SHA-256 (422 attachment.hash_mismatch); on a mismatch the upload stays pending for another PUT. Completing an uploaded attachment again returns it unchanged. POST /v1/contexts/{ctx}/attachments/{id}/complete.

ctx: string
id: string

get

get(ctx: string, id: string, opts?: RequestOptions): Promise<Attachment>

The Attachment object (11 §14.4). GET /v1/contexts/{ctx}/attachments/{id}.

ctx: string
id: string

downloadResponse

downloadResponse(ctx: string, id: string, opts?: RequestOptions & { range?: { start: number; end?: number } }): Promise<Response>

The blob's raw Response (11 §14.4), for streaming. The server answers 200 (206 with range) or redirects to a capability URL, which the HTTP client follows without Authorization. range asks for bytes start to end inclusive (a single range, RFC 9110 §14). GET /v1/contexts/{ctx}/attachments/{id}/content.

ctx: string
id: string
opts: RequestOptions & { range?: { start: number; end?: number } }

Default: {}

download

download(ctx: string, id: string, opts?: RequestOptions & { range?: { start: number; end?: number } }): Promise<Uint8Array<ArrayBufferLike>>

The blob's bytes (11 §14.4). GET /v1/contexts/{ctx}/attachments/{id}/content.

ctx: string
id: string
opts: RequestOptions & { range?: { start: number; end?: number } }

Default: {}

downloadFile

downloadFile(ctx: string, ref: ThumbnailRef | AttachmentRef, opts: RequestOptions & { secure: boolean }): Promise<Uint8Array<ArrayBufferLike>>

Download a referenced file and check it (11 §14.3 receiver steps): in a secure context decrypt it with SVF1 under the reference's key; in both modes check size (and sha256 where given). Failures are crypto.decrypt_failed, shown as the generic attachment failure.

ctx: string
opts: RequestOptions & { secure: boolean }

delete

delete(ctx: string, id: string, opts?: RequestOptions): Promise<void>

Cancel a pending or uploaded attachment (11 §14.2). A bound one answers 409 attachment.already_bound. DELETE /v1/contexts/{ctx}/attachments/{id}.

ctx: string
id: string

uploadAttachment

uploadAttachment(ctx: string, file: Uint8Array, opts: UploadAttachmentOptions): Promise<UploadedAttachment<AttachmentRef>>

Upload one file and return its AttachmentRef (11 §14.2, §14.3). Checks the size against maxAttachmentBytes before anything is sent (11 §14.6) and refuses empty files (11 §3.6). In a secure context it encrypts the file with SVF1 under a fresh K_file and uploads the blob as application/octet-stream, and the reference carries key and sha256. Then it creates the upload, PUTs the bytes, and completes it; on a size or hash mismatch it uploads the bytes once more, and if the upload URL expired it deletes the upload and starts again once (11 §13.3).

ctx: string
file: Uint8Array

uploadThumbnail

uploadThumbnail(ctx: string, image: Uint8Array, opts: UploadThumbnailOptions): Promise<UploadedAttachment<ThumbnailRef>>

Upload a thumbnail and return its ThumbnailRef (11 §3.6, §14.3): purpose thumbnail in an insecure context, and in a secure one purpose file, encrypted with its own key like any file. Checks THUMB_MAX_BYTES and THUMB_MAX_PX first.

ctx: string
image: Uint8Array

Source: api/attachments.ts:110

AuditLogApi class

The community's append-only audit log (10 §11). Needs view_audit_log; entries with restricted: true are returned only to admins.

class AuditLogApi

constructor

new AuditLogApi(http: HttpClient)
http: HttpClient

The community server's HTTP client.

list

list(params?: AuditLogParams, opts?: RequestOptions): Pager<AuditLogEntry, AuditLogPage>

List entries newest first (by seq), paging automatically, filtered by any of action, actor, targetAddress, targetType, ctx, reportId, since and until. limit 1–100 (default 50). Each page carries retentionDays. GET /v1/audit-log (10 §11.4).

params: AuditLogParams

Default: {}

Source: api/audit-log.ts:16

AuthApi class

The home server's /v1/auth/* API endpoints (05 §6.1, §7, §8.4, §14) and the client side of the authorization flow (05 §6). The HttpClient must point at the home server's base URL; it doesn't need a token provider, because every call here states its credential explicitly.

class AuthApi

constructor

new AuthApi(http: HttpClient, options?: AuthApiOptions)
options: AuthApiOptions

Default: {}

issuer

get issuer(): string

The home server's base URL, which is also its OAuth issuer (05 §3.3).

endpoints

get endpoints(): AuthEndpoints

The /v1/auth/* URLs of this server (05 §3.2).

par

par(params: PushedAuthorizationRequest, opts?: RequestOptions & { accessToken?: string }): Promise<PushedAuthorizationResponse>

Push authorization parameters (RFC 9126). POST /v1/auth/par (05 §6.1). intent: 'reauth' needs the session's access token in accessToken. The request_uri is single use and valid 60 s.

opts: RequestOptions & { accessToken?: string }

Default: {}

authorizeUrl

authorizeUrl(params: AuthorizationParams | { client_id: string; request_uri: string }): string

The authorize URL for these parameters (05 §6.2). Doesn't fetch it.

params: AuthorizationParams | { client_id: string; request_uri: string }

token

token(body: TokenRequest, opts?: Pick<RequestOptions, "signal">): Promise<TokenResponse>

The token endpoint, POST /v1/auth/token (05 §7). Public client: no Authorization, client_id in the body. Never retried automatically and never sent with Idempotency-Key (05 §7.4).

opts: Pick<RequestOptions, "signal">

Default: {}

exchangeCode

exchangeCode(body: Omit<AuthorizationCodeGrantRequest, "grant_type">, opts?: Pick<RequestOptions, "signal">): Promise<SessionTokenResponse | SignupTokenResponse | ReauthTokenResponse | LinkTokenResponse>

Redeem an authorization code (05 §7.3). See completeAuthorization for the whole step.

body: Omit<AuthorizationCodeGrantRequest, "grant_type">
opts?: Pick<RequestOptions, "signal">

refresh

refresh(body: Omit<RefreshTokenGrantRequest, "grant_type">, opts?: Pick<RequestOptions, "signal">): Promise<RefreshTokenResponse>

Exchange a refresh token for a new access token and a new refresh token (05 §7.6). Refresh tokens rotate on every use: the presented one is rotated, so store the new one before using it. Serialize refreshes per session (05 §7.7); HomeSession does.

body: Omit<RefreshTokenGrantRequest, "grant_type">
opts?: Pick<RequestOptions, "signal">

signup

signup(signupToken: string, body: SignupRequest, opts?: Pick<RequestOptions, "signal">): Promise<SessionTokenResponse>

Create the account with a sign-up token. POST /v1/auth/signup (05 §8.4). Answers the full token response of 05 §7.3. The token is single use: on auth.identity_already_linked or auth.signup_token_invalid restart the login flow (05 §8.4).

signupToken: string
opts: Pick<RequestOptions, "signal">

Default: {}

logout

logout(credential: { scheme: "Bearer" | "Bot"; token: string }, body?: { revocation?: string }, opts?: Pick<RequestOptions, "signal">): Promise<void>

Sign out this device (05 §14, scope current): revokes it with reason signed_out. Answers 204 whatever the state of the token (03 §3.2 rule 8(b)), so no refresh is attempted. credential is the access token or bot token.

credential: { scheme: "Bearer" | "Bot"; token: string }
body: { revocation?: string }

Default: {}

opts: Pick<RequestOptions, "signal">

Default: {}

logoutOthers

logoutOthers(accessToken: string, opts?: Pick<RequestOptions, "signal">): Promise<LogoutOthersResponse>

Sign out every other device of the account (05 §14, scope others), reason signed_out_elsewhere. Needs fresh authentication (auth.reauth_required); bots get bot.not_allowed.

accessToken: string
opts: Pick<RequestOptions, "signal">

Default: {}

beginSignIn

beginSignIn(options: BeginSignInOptions, opts?: Pick<RequestOptions, "signal">): Promise<PendingAuthorization>

Start a sign-in (05 §6, intent login): make PKCE and state, push the parameters (unless pushed: false), and return what to open and keep.

opts: Pick<RequestOptions, "signal">

Default: {}

beginReauth

beginReauth(accessToken: string, options: BeginReauthOptions, opts?: Pick<RequestOptions, "signal">): Promise<PendingAuthorization>

Start a re-authentication (05 §9.2): a pushed request with intent=reauth carrying the session's access token. The browser leg runs with prompt=login, max_age=0 at the provider (05 §6.3).

accessToken: string
opts: Pick<RequestOptions, "signal">

Default: {}

completeAuthorization

completeAuthorization(pending: PendingAuthorization, callbackUrl: string | URL, device?: SignInDeviceInfo, opts?: Pick<RequestOptions, "signal">): Promise<AuthorizationResult>

Finish an authorization: check the redirect (05 §6.6), redeem the code at /v1/auth/token (05 §7.3) and classify the answer. For intent login, device is required (the server needs platform and client_software when the login creates a device).

  • session: a new home session; build a HomeSession from it.
  • signup: unknown external identity; show "Choose your name" (M2) and call signup.
  • reauth: a new access token and authAt; the refresh token is unchanged.
  • link: a new access token and the ProviderLink.
callbackUrl: string | URL
opts: Pick<RequestOptions, "signal">

Default: {}

Source: auth/oauth.ts:566

BackupApi class

KeyBackup endpoints (08 §5.5). Every one is a home-server endpoint; a bot token is accepted where 08 says so.

class BackupApi

constructor

new BackupApi(http: HttpClient)

meta

meta(opts?: RequestOptions): Promise<KeyBackupMeta>

The active KeyBackup without nonce and ct, plus downloadAllowed and phraseChangePending. GET /v1/me/backup?part=meta (08 §5.5.1). Not counted against download limits. 404 backup.not_found when there is none.

get

get(opts?: RequestOptions): Promise<KeyBackup>

The full active KeyBackup. GET /v1/me/backup (08 §5.5, §5.7). Counted: an unenrolled device needs fresh authentication within the hour (403 auth.reauth_required, data.maxAgeMs 3600000), and rate limits apply (429 with data.policy backup.download).

put

put(body: KeyBackupWrite, opts?: RequestOptions): Promise<KeyBackup>

Stage (stage: true, 201) or replace (prevVer, 200) the KeyBackup. PUT /v1/me/backup (08 §5.6). Conflicts: backup.version_conflict (re-read the metadata, 08 §4.6 step 3 or §5.6.4), backup.stale_generation, backup.phrase_change_required, backup.identity_mismatch.

stage

stage(content: KeyBackupContent, opts?: RequestOptions): Promise<KeyBackup>

Stage a KeyBackup for an identity about to be registered or reset (08 §5.6.1): its igen is the account's current igen + 1 and its vgen is 1 (otherwise backup.identity_mismatch). Answers 201 with state: "staged".

update

update(content: KeyBackupContent, prevVer: number, opts?: RequestOptions): Promise<KeyBackup>

Replace the active KeyBackup whose ver is prevVer (08 §5.6.2).

prevVer: number

Source: api/backup.ts:524

BansApi class

Bans of one community (10 §9). Scope community needs ban_members; scope server (address targets only) needs the admin role (10 §9.3).

class BansApi

constructor

new BansApi(http: HttpClient)
http: HttpClient

The community server's HTTP client.

create

create(body: CreateBanRequest, opts?: RequestOptions): Promise<Ban>

Ban an address or a domain. POST /v1/bans (10 §9.6). The target may be in any form canonicalize() accepts; the server canonicalizes it (10 §9.2). Answers 201 with the new Ban, or 200 with the existing (possibly updated) Ban of the same target and scope. Carries an Idempotency-Key (10 §8.2 rule 6), generated unless opts.idempotencyKey is given.

list

list(params?: BanListParams, opts?: RequestOptions): Pager<Ban, CollectionPage<Ban>>

List bans, newest first, paging automatically; filter by targetType, scope, address, domain. GET /v1/bans (10 §9.6). Server-scope bans are listed only for admins.

params: BanListParams

Default: {}

get

get(banId: string, opts?: RequestOptions): Promise<Ban>

Read one ban. GET /v1/bans/{banId} (10 §9.6).

banId: string

update

update(banId: string, body: UpdateBanRequest, opts?: RequestOptions): Promise<Ban>

Change a ban's reason, showReason or expiresAt (a timestamp, or null for permanent; at least 1 hour after the ban's createdAt, 10 §9.1). PATCH /v1/bans/{banId} (10 §9.6).

banId: string

lift

lift(banId: string, opts?: RequestOptions): Promise<void>

Lift a ban early. The membership becomes left (reason unbanned); roles, overwrites, deleted messages and MLS leaves aren't restored. DELETE /v1/bans/{banId} (10 §9.5, §9.6).

banId: string

Source: api/bans.ts:24

BotsApi class

Bot management (05 §15.2–§15.4).

class BotsApi

constructor

new BotsApi(http: HttpClient)

create

create(body: CreateBotRequest, opts?: RequestOptions): Promise<CreateBotResponse>

Create a bot owned by the caller, with its first token. POST /v1/bots (05 §15.2). Needs manage_bots and fresh authentication. The token is in this response only.

list

list(params?: ListBotsParams, opts?: RequestOptions): Pager<Bot, CollectionPage<Bot>>

Bots the caller owns, or with all every bot on the server. GET /v1/bots (05 §15.3).

params: ListBotsParams

Default: {}

get

get(local: string, opts?: RequestOptions): Promise<Bot>

One bot. GET /v1/bots/{local} (05 §15.3).

local: string

update

update(local: string, body: UpdateBotRequest, opts?: RequestOptions): Promise<Bot>

Change a bot's name, about or owner. PATCH /v1/bots/{local} (05 §15.3). A change of owner needs fresh authentication.

local: string

setAvatar

setAvatar(local: string, image: AvatarBody, contentType: AvatarContentType, opts?: RequestOptions): Promise<Account>

Upload a bot's avatar. PUT /v1/bots/{local}/avatar (05 §15.3, as §11.7).

local: string
image: AvatarBody
contentType: AvatarContentType

deleteAvatar

deleteAvatar(local: string, opts?: RequestOptions): Promise<Account | undefined>

Remove a bot's avatar. DELETE /v1/bots/{local}/avatar (05 §15.3). Resolves with the body, if any.

local: string

delete

delete(local: string, opts?: RequestOptions): Promise<void>

Delete the bot account (05 §16, reason owner). DELETE /v1/bots/{local} (05 §15.3); fresh authentication.

local: string

createToken

createToken(local: string, body?: CreateBotTokenRequest, opts?: RequestOptions): Promise<BotTokenResponse>

Create another token (one more device record) for a bot. POST /v1/bots/{local}/tokens (05 §15.4). Owner only; fresh authentication; at most maxBotTokens active tokens.

local: string
body: CreateBotTokenRequest

Default: {}

listTokens

listTokens(local: string, opts?: RequestOptions): Pager<DeviceRecord, CollectionPage<DeviceRecord>>

A bot's token devices. GET /v1/bots/{local}/tokens (05 §15.4).

local: string

rotateToken

rotateToken(local: string, did: string, body?: RotateBotTokenRequest, opts?: RequestOptions): Promise<RotateBotTokenResponse>

Issue a new token for the same device record; the old one keeps working for graceMs (0–86,400,000). POST /v1/bots/{local}/tokens/{did}/rotate (05 §15.4). For a suspected leak, revoke and create instead.

local: string
did: string
body: RotateBotTokenRequest

Default: {}

revokeToken

revokeToken(local: string, did: string, opts?: RequestOptions): Promise<void>

Revoke one bot token (05 §13, reason bot_token_revoked). DELETE /v1/bots/{local}/tokens/{did} (05 §15.4).

local: string
did: string

Source: api/bots.ts:42

CallContinuity class

The client's auto-rejoin and transmit-state machine for one participation (15 §10.4–§10.9, 16 §7.8). See the module comment.

class CallContinuity

constructor

new CallContinuity(opts: CallContinuityOptions)

ctx

readonly ctx: string

ctxKind

readonly ctxKind: CallContextKind

state

get state(): ContinuityState

The state of 15 §10.4.

callId

get callId(): string | null

The current call ID, or null.

pid

get pid(): number | null

This participation's pid, or null.

rejoinToken

get rejoinToken(): string | null

The current rejoin token (kept in memory only; deleted when the participation ends, 15 §10.2 item 5).

droppedAt

get droppedAt(): number | null

When the current drop was detected (t0), or null.

attempts

get attempts(): number

Attempts started since t0.

mode

get mode(): TransmitMode

The current mic mode.

selfMuted

get selfMuted(): boolean

The user's own mute (16 §7.2 userMuted).

muteReason

get muteReason(): MuteReason | null

Why selfMuted was set, or null.

pttDown

get pttDown(): boolean

The observed PTT control state.

screenShare

get screenShare(): "off" | "on" | "held"

The screen share: off, sending, or held (capture kept, nothing sent) after a drop.

webcam

get webcam(): boolean

Whether the webcam is on.

audioBlockedBy

get audioBlockedBy(): AudioBlockedBy | null

The newest VoiceLease's audioBlockedBy.

callState

get callState(): AudioCallState

The callState input of the audio engine's gate (16 §7.2): ended; migrating during a security_upgraded/group_restarted migration; reconnecting while rejoining after an unexpected drop; joining from the user's join until the first relay tick; connected in in_call and in restoring once the new relay connection's first tick has arrived (16 §7.2 callState table; missing send keys show in keysOk).

gateInputs

gateInputs(): { mode: TransmitMode; pttDown: boolean; userMuted: boolean; muteReason: MuteReason | null; callState: AudioCallState; voiceLease: VoiceLeaseAudio | null }

The inputs of evaluateTransmitGate that this machine owns. Combine with the audio engine's routeUp, leaseState, keysOk, captureOk and vadActive.

wakeAt

wakeAt(): number | null

The next instant at which advance has something to do, or null.

join

join(opts?: { ring?: boolean; video?: boolean; takeOver?: boolean; create?: boolean }): ContinuityEffect[]

The user joins (15 §3.3). ring and video apply to DM calls; takeOver resolves a one-call conflict (15 §2.3). The machine must be idle.

opts: { ring?: boolean; video?: boolean; takeOver?: boolean; create?: boolean }

Default: {}

leave

leave(): ContinuityEffect[]

The user pressed Leave or the call screen closed (15 §3.4, §10.4 last row): send leave if a seat might exist, stop auto-rejoin.

setPtt

setPtt(down: boolean): ContinuityEffect[]

The PTT control was pressed or released. Nothing else changes: transmission follows the control (15 §10.6 rule 3).

down: boolean

setPttObservable

setPttObservable(_observable: boolean): ContinuityEffect[]

The PTT control became unobservable (focus lost without a global mechanism) or observable again. Unobservable counts as released, and on return it stays released until a new press is seen (16 §7.7).

_observable: boolean

setSelfMuted

setSelfMuted(muted: boolean): ContinuityEffect[]

The user muted or unmuted deliberately. Reported to call control while a seat exists (16 §7.8).

muted: boolean

setSelfDeafened

setSelfDeafened(deafened: boolean): ContinuityEffect[]

The user changed self-deafen. Carried in later joins.

deafened: boolean

setMode

setMode(mode: TransmitMode): ContinuityEffect[]

The user changed the mic mode. During an outage a change to voice activation or open mic mutes (16 §7.8, reason rejoin); while the lease blocks audio it mutes with reason user (15 §10.6 rule 6).

setWebcam

setWebcam(on: boolean): ContinuityEffect[]

The user started or stopped the webcam.

on: boolean

setScreenShare

setScreenShare(on: boolean, opts?: { audio?: boolean }): ContinuityEffect[]

The user started or stopped a screen share (audio: with its sound). Stopping a held share ends it.

on: boolean
opts: { audio?: boolean }

Default: {}

osInterruptionEnded

osInterruptionEnded(durationMs: number): ContinuityEffect[]

An operating-system audio interruption ended (16 §7.9): after more than 2 s, voice activation and open mic come back muted (reason interruption).

durationMs: number

joinSucceeded

joinSucceeded(res: JoinResponse): ContinuityEffect[]

A join or rejoin answered 200 (15 §3.3.3).

joinFailed

joinFailed(error: unknown): ContinuityEffect[]

A join or rejoin failed (15 §10.5).

error: unknown

sessionRenewed

sessionRenewed(result: "ok" | "terminal" | "transient"): ContinuityEffect[]

The session renewal asked for by renew_session finished (15 §10.5): ok resends in the same attempt; transient waits for the next scheduled attempt; terminal (for example a revoked device) ends.

result: "ok" | "terminal" | "transient"

dmSecurityChanged

dmSecurityChanged(): ContinuityEffect[]

dm.security_changed arrived (12): after dm.upgrade_in_progress, retry now rather than at the next scheduled time (15 §10.5).

relayUp

relayUp(): ContinuityEffect[]

relay.welcome arrived on the new relay session (15 §6.2 item 4).

relayTick

relayTick(): ContinuityEffect[]

The first lease tick arrived on the new relay connection. Together with installed send keys (secure calls) it completes the rejoin (15 §10.4).

setSendKeysReady

setSendKeysReady(ready: boolean): ContinuityEffect[]

Secure calls: send keys for the sending epoch 18 §6.3 selects are (not) installed (15 §3.3.4).

ready: boolean

relayConnectFailed

relayConnectFailed(error: unknown): ContinuityEffect[]

POST {relayUrl}/connect failed (15 §6.2 item 3).

error: unknown

relayFailed

relayFailed(): ContinuityEffect[]

The relay connection failed (15 §6.7: control silence, ICE failed or disconnected for 5 s, transport closed). That is an unexpected drop: auto-rejoin (15 §6.7 rule 4, §10.1).

relayClosing

relayClosing(reason: RelayClosingReason, opts?: { openedReplacement?: boolean }): ContinuityEffect[]

relay.closing arrived (15 §6.6). openedReplacement: the client opened the session that replaced it.

opts: { openedReplacement?: boolean }

Default: {}

migrate

migrate(): ContinuityEffect[]

call.migrate (15 §6.9): rejoin with planned: true and connect to the new relay without closing the old one.

moved

moved(): ContinuityEffect[]

call.moved for this device (15 §11): stop at once, don't rejoin.

participantLeft

participantLeft(ev: CallParticipantLeftEvent): ContinuityEffect[]

call.participant_left (15 §15). Only this device's current seat matters.

callEnded

callEnded(ev: CallEndedEvent): ContinuityEffect[]

call.ended for the current call (15 §2.4, §10.1, §12).

leaseChanged

leaseChanged(lease: VoiceLease): ContinuityEffect[]

The VoiceLease changed (call.lease_changed, 15 §4.10).

lease: VoiceLease

networkUp

networkUp(): ContinuityEffect[]

The operating system reports that the network came back: start the next attempt now (15 §10.4).

abort

abort(reason: ContinuityEndReason, code?: string | null): ContinuityEffect[]

End the participation for a reason found by the driver, such as the security check of 15 §2.1 item 4 failing before an automatic rejoin.

code: string | null

Default: null

advance

advance(): ContinuityEffect[]

Run timers due at the current time (15 §10.4).

Source: calls/continuity.ts:297

CallsApi class

Calls (15 §3, §8, §13, §14). All paths are on the context's hosting server; {ctx} is one path segment. Every method acts for the session's own device; the server never takes an address, did or pid from the body as proof of who is asking (15 §3.1).

class CallsApi

constructor

new CallsApi(http: HttpClient)

get

get(ctx: string, opts?: RequestOptions): Promise<GetCallResponse>

The current call of a context, or null. GET /v1/contexts/{ctx}/call (15 §3.2). Any member of the context may read it.

ctx: string

join

join(ctx: string, body: JoinRequest, opts?: JoinOptions): Promise<JoinResponse>

Join, rejoin, switch or Move voice here. POST /v1/contexts/{ctx}/call/join (15 §3.3). An Idempotency-Key is always sent: the given one, or a fresh UUIDv7 for this call (15 §3.3.1: a fresh key for every new join, including every auto-rejoin attempt; reuse a key only to resend the same request after losing its response). features must include voice-dc/1.

ctx: string
opts: JoinOptions

Default: {}

leave

leave(ctx: string, body: LeaveRequest, opts?: RequestOptions): Promise<void>

Leave the call. POST /v1/contexts/{ctx}/call/leave (15 §3.4). Idempotent: 204 even if the device holds no seat or the callId is unknown. Close the relay connection and SFU session after sending it, and stop auto-rejoin. Never call it because of network trouble.

ctx: string

updateParticipant

updateParticipant(ctx: string, pid: number, patch: ParticipantPatch, opts?: RequestOptions): Promise<Participant>

Update the device's own mute, deafen and source state. PATCH /v1/contexts/{ctx}/call/participants/{pid} (15 §3.5). The pid MUST be the device's own. Returns the updated Participant. The state is for display only; leases decide what is forwarded.

ctx: string
pid: number

listMutes

listMutes(ctx: string, params?: CollectionParams, opts?: RequestOptions): Pager<Mute, CollectionPage<Mute>>

List current Mutes for everyone, paging automatically. GET /v1/contexts/{ctx}/call/mutes (15 §3.6).

ctx: string
params: CollectionParams

Default: {}

getMute

getMute(ctx: string, addr: string, opts?: RequestOptions): Promise<Mute>

Read one Mute. GET /v1/contexts/{ctx}/call/mutes/{addr} (15 §3.6); 404 core.not_found if none.

ctx: string
addr: string

putMute

putMute(ctx: string, addr: string, body?: PutMuteRequest, opts?: RequestOptions): Promise<Mute>

Mute an account for everyone in a voice channel's calls until removed. PUT /v1/contexts/{ctx}/call/mutes/{addr} (15 §3.6). Needs mute_members; idempotent; a PUT for an existing mute replaces its reason, showReason and reportId. An Idempotency-Key is sent as 10 §8.2 rule 6 requires (a fresh one unless given). addr is a canonical address.

ctx: string
addr: string
body: PutMuteRequest

Default: {}

deleteMute

deleteMute(ctx: string, addr: string, opts?: RequestOptions): Promise<void>

Remove a Mute for everyone. DELETE /v1/contexts/{ctx}/call/mutes/{addr} (15 §3.6). Idempotent; 204.

ctx: string
addr: string

epochReady

epochReady(ctx: string, body: EpochReadyRequest, opts?: RequestOptions): Promise<void>

Post call.epoch_ready: this device has installed SFrame keys for epoch. POST /v1/contexts/{ctx}/call/epoch-ready (15 §3.7, §9.2). Secure calls only; 204.

ctx: string

ring

ring(ctx: string, body: RingRequest, opts?: RequestOptions): Promise<void>

Ring again in a DM call. POST /v1/contexts/{ctx}/call/ring (15 §13.3); 202. At most once every 10 s and 5 times per call.

ctx: string

decline

decline(ctx: string, body: DeclineRequest, opts?: RequestOptions): Promise<void>

Decline a ring from any device of a target account. POST /v1/contexts/{ctx}/call/decline (15 §13.2); 204. A decline after the ring ended is accepted and ignored.

ctx: string

createSfuSession

createSfuSession(ctx: string, body: SfuCreateSessionRequest, opts?: RequestOptions): Promise<SfuCreateSessionResponse>

Create this device's SFU session. POST /v1/contexts/{ctx}/call/sfu/session (15 §8.2); 201. Only while videoRoute is sfu (409 sfu.not_active).

ctx: string

sfuOffer

sfuOffer(ctx: string, sfuSessionId: string, body: SfuOfferRequest, opts?: RequestOptions): Promise<SfuOfferResponse>

Client-initiated SFU renegotiation (for example starting or stopping the webcam). POST …/call/sfu/session/{sfuSessionId}/offer (15 §8.2). Fails with 409 sfu.negotiation_conflict while a server offer is outstanding: answer it first (15 §8.3 item 1).

ctx: string
sfuSessionId: string

sfuAnswer

sfuAnswer(ctx: string, sfuSessionId: string, body: SfuAnswerRequest, opts?: RequestOptions): Promise<void>

Answer a server sfu.offer within 10 s. POST …/call/sfu/session/{sfuSessionId}/answer (15 §8.2, §8.3 item 3); 204.

ctx: string
sfuSessionId: string

setSfuSubscriptions

setSfuSubscriptions(ctx: string, sfuSessionId: string, body: SfuSubscriptionsRequest, opts?: RequestOptions): Promise<void>

Replace the set of SFU tracks and layers this device receives. PUT …/call/sfu/session/{sfuSessionId}/subscriptions (15 §8.2); 202. The server follows with sfu.offer if transceivers must change.

ctx: string
sfuSessionId: string

deleteSfuSession

deleteSfuSession(ctx: string, sfuSessionId: string, opts?: RequestOptions): Promise<void>

Close this device's SFU session. DELETE …/call/sfu/session/{sfuSessionId} (15 §8.2); 204.

ctx: string
sfuSessionId: string

sendDiagnostics

sendDiagnostics(report: DiagnosticReport, opts?: RequestOptions): Promise<DiagnosticsResponse>

Upload a diagnostic report. POST /v1/diagnostics (15 §14.3); 202. Idempotent on reportId (a UUIDv7). The caller honours the user's diagnostics setting (15 §14.2): with off nothing is uploaded. Bodies over 64 KiB are refused locally; use fitDiagnosticReport first.

connectRelay

connectRelay(relayUrl: string, ticket: string, body: RelayConnectRequest, opts?: RequestOptions): Promise<RelayConnectResult>

Open a relay session: POST {relayUrl}/connect with Authorization: Bearer <RelayTicket> (15 §6.2, §6.10.1). relayUrl is the join response's relay.url. Answers 201 with the SDP answer, or 200 with TURN iceServers and an iceServersId to gather relayed candidates and re-POST with the same ticket. On any failure the client rejoins for a fresh ticket (see relayConnectFailureAction); the request is never retried automatically, and gives up after 10 s (15 §6.2 item 3).

relayUrl: string
ticket: string

Source: api/calls.ts:85

ChannelsApi class

Channels (09 §6). {id} arguments take a UUIDv7 or ch:<UUIDv7>.

class ChannelsApi

constructor

new ChannelsApi(http: HttpClient)

list

list(opts?: RequestOptions): Promise<ChannelList>

Every channel the caller can view, plus categories. GET /v1/channels (09 §6.6). Never paginated. For a non-member it holds the channels whose previewVisible is true.

create

create(body: CreateChannelRequest, opts?: RequestOptions): Promise<Channel>

Create a channel. POST /v1/channels (09 §6.4); needs manage_channels. Sent with an Idempotency-Key (SHOULD, 09 §6.4): the one in opts, or a fresh UUIDv7. A secure channel is created without an MLS group; the creator's enrolled device SHOULD open it at once to bootstrap it (13 §7.4).

get

get(id: string, opts?: RequestOptions): Promise<Channel>

One channel. GET /v1/channels/{id} (09 §6.4). A channel the caller can't view is 404 core.not_found; a deleted one 410 channel.deleted with the tombstone in data (09 §6.4 step 7), which settles pins (09 §13.5).

id: string

update

update(id: string, patch: ChannelPatch, opts?: RequestOptions): Promise<Channel>

Change channel settings. PATCH /v1/channels/{id} (09 §6.4); needs manage_channels. Upgrade members are refused here (use planUpgrade and upgrade); kind is immutable.

id: string

planUpgrade

planUpgrade(id: string, opts?: RequestOptions & { ifVersion?: number }): Promise<ChannelUpgradePlan>

Channel-upgrade dry run: PATCH /v1/channels/{id} with { "security": "secure", "dryRun": true } (09 §10.2). Changes nothing and returns the UpgradePlan for W5. Allowed to an insecure admin.

id: string
opts?: RequestOptions & { ifVersion?: number }

upgrade

upgrade(id: string, confirm: ChannelUpgradeOptions, opts?: RequestOptions): Promise<Channel>

Confirm the channel upgrade (09 §10.4): PATCH /v1/channels/{id} with security: "secure", planVersion and the caller's GroupBootstrap. Irreversible (D-018). Always carries an Idempotency-Key (MUST): the one in opts, or a fresh UUIDv7; pass your own to repeat a confirmation after a lost response. Answers the updated Channel. Errors include 409 channel.upgrade_plan_stale (data.plan: show W5 again), 409 channel.already_secure (see alreadySecureIsOwnGroup), 400 channel.bootstrap_required and 13's mls.* bootstrap errors.

id: string

delete

delete(id: string, opts?: RequestOptions): Promise<void>

Delete a channel. DELETE /v1/channels/{id} (09 §6.4); needs manage_channels. 204.

id: string

join

join(id: string, opts?: RequestOptions): Promise<JoinChannelResponse>

Become a channel member. POST /v1/channels/{id}/join with {} (09 §4.5). Clients call it silently the first time the person opens the channel; it is idempotent. Gate errors: 09 §9.3, client reactions 09 §9.5.

id: string

leave

leave(id: string, opts?: RequestOptions): Promise<void>

Leave a channel. POST /v1/channels/{id}/leave (09 §4.5); 204, also when the account isn't a member (so it is safe to retry).

id: string

listMembers

listMembers(id: string, params?: ListChannelMembersParams, opts?: RequestOptions): Pager<ChannelMember, CollectionPage<ChannelMember>>

List channel members, paging automatically. GET /v1/channels/{id}/members (09 §4.7). left needs manage_channels.

id: string
params: ListChannelMembersParams

Default: {}

getMember

getMember(id: string, addr: string, opts?: RequestOptions): Promise<ChannelMember>

One channel member. GET /v1/channels/{id}/members/{addr} (09 §4.7); member.not_found otherwise.

id: string
addr: string

Source: api/channels.ts:218

CommunityApi class

The community API (09 §3, §4, §6.5, §11). One instance per server; the community is named by the server, so no method takes a community ID.

class CommunityApi

constructor

new CommunityApi(http: HttpClient)

get

get(opts?: PublicReadOptions): Promise<Community>

The public Community object. GET /v1/community (09 §3.5). Needs no authentication: auth defaults to 'none', since a session in upgrade_required would be refused (09 §3.5); pass auth: 'session' to send it.

update

update(patch: CommunityPatch, opts?: RequestOptions): Promise<Community>

Change community settings. PATCH /v1/community (09 §3.6); needs manage_community. Name only the members to change. The server upgrade members are refused here: use planUpgrade and upgrade. A stale ifVersion fails with 409 community.version_conflict, whose data.current holds the current Community.

planUpgrade

planUpgrade(opts?: RequestOptions & { ifVersion?: number }): Promise<Community | ServerUpgradePlan>

Server-upgrade dry run: PATCH /v1/community with { "secure": true, "dryRun": true } (09 §11.2). Changes nothing and returns the ServerUpgradePlan to show in W5 (09 §11.3). Needs 10's admin role and a local account (09 §11.1). On a server that is already secure the server answers with the Community instead (09 §11.6); tell the two apart with isServerUpgradePlan.

opts?: RequestOptions & { ifVersion?: number }

upgrade

upgrade(confirm: ServerUpgradeOptions, opts?: RequestOptions): Promise<Community>

Confirm the server upgrade: PATCH /v1/community with secure: true, planVersion and confirmDomain (09 §11.4). Irreversible (D-073).

The request always carries an Idempotency-Key (required, 09 §11.4): the one in opts, or a fresh UUIDv7. Pass your own key to repeat the same logical confirmation after a lost response. The SDK waits up to 120 s for the answer (09 §11.4, §16). A changed plan fails with 409 community.upgrade_plan_stale whose data.plan holds the new plan. The SDK never offers a downgrade (09 §12 item 4).

fetchIcon

fetchIcon(icon?: CommunityIcon | null, opts?: RequestOptions): Promise<CommunityIconImage>

Download the community icon (09 §3.4). With a descriptor, fetches icon.url (never sending the session, 03 §3.2) and checks the SHA-256 the descriptor names, as clients MUST; a mismatch throws sdk.verification_failed. Without one, GET /v1/community/icon unchecked.

icon?: CommunityIcon | null

setIcon

setIcon(image: Uint8Array<ArrayBufferLike> | Blob, mediaType: "image/webp" | "image/jpeg" | "image/png", opts?: RequestOptions): Promise<Community>

Replace the icon. PUT /v1/community/icon with the raw image (09 §3.4); needs manage_community. PNG, JPEG or WebP, square, 16 to 1,024 px, at most maxCommunityIconBytes; otherwise 400 community.icon_invalid.

image: Uint8Array<ArrayBufferLike> | Blob
mediaType: "image/webp" | "image/jpeg" | "image/png"

deleteIcon

deleteIcon(opts?: RequestOptions): Promise<Community | null>

Remove the icon. DELETE /v1/community/icon (09 §3.4); needs manage_community. Resolves with the Community if the server returns one, otherwise null.

join

join(body?: JoinCommunityRequest, opts?: RequestOptions): Promise<JoinCommunityResult>

Join the community, or ask to. POST /v1/community/join (09 §4.3). invite is normalized (09 §8.2) when it is valid, and sent as given otherwise so the server applies its own rule (09 §9.2 C5, C8). Joining is idempotent; an existing member can record acceptRules this way. After 200 or 202 the client MUST record the community in the account's community list (09 §5.1). Gate errors are listed in 09 §9.5.

body: JoinCommunityRequest

Default: {}

leave

leave(opts?: RequestOptions): Promise<void>

Leave the community, or withdraw a pending request. POST /v1/community/leave (09 §4.6). Works even in upgrade_required. Afterwards the client removes the community from its list (09 §5.1).

listMembers

listMembers(params?: ListCommunityMembersParams, opts?: RequestOptions): Pager<CommunityMember, CollectionPage<CommunityMember>>

List members, paging automatically. GET /v1/community/members (09 §4.7), ordered by addr byte-wise. Callers must be members (member.not_member).

params: ListCommunityMembersParams

Default: {}

getMember

getMember(addr: string, opts?: RequestOptions): Promise<CommunityMember>

One member record. GET /v1/community/members/{addr} (09 §4.7); member.not_found otherwise.

addr: string

approve

approve(addr: string, opts?: RequestOptions): Promise<CommunityMember>

Approve a pending join request. POST /v1/community/members/{addr}/approve (09 §4.3); needs manage_invites, and for a bot also manage_bots. A record that isn't pending fails with member.not_pending.

addr: string

reject

reject(addr: string, opts?: RequestOptions): Promise<void>

Reject a pending join request. POST /v1/community/members/{addr}/reject (09 §4.3); 204.

addr: string

listCategories

listCategories(opts?: RequestOptions): Pager<Category, CollectionPage<Category>>

List categories (one page in practice). GET /v1/community/categories (09 §6.5).

createCategory

createCategory(body: CreateCategoryRequest, opts?: RequestOptions): Promise<Category>

Create a category. POST /v1/community/categories (09 §6.5); needs manage_channels. More than maxCategories fails with channel.limit_reached.

updateCategory

updateCategory(id: string, patch: CategoryPatch, opts?: RequestOptions): Promise<Category>

Rename or move a category. PATCH /v1/community/categories/{id} (09 §6.5).

id: string

deleteCategory

deleteCategory(id: string, opts?: RequestOptions): Promise<void>

Delete a category. DELETE /v1/community/categories/{id} (09 §6.5); its channels become uncategorized.

id: string

updateLayout

updateLayout(layout: CommunityLayoutRequest, opts?: RequestOptions): Promise<CommunityLayout | null>

Replace the order of categories and channels in one step. PATCH /v1/community/layout (09 §6.5). Every category and every channel must be listed exactly once (checked here for duplicates; completeness is the server's check). Resolves with the body the server returns, or null.

Source: api/community.ts:111

CpaceInitiator class

The CPace initiator: the entering device (04 §11.2, 08 §6.6.1). One run per credential.

class CpaceInitiator

message

readonly message: CpaceABody

The cpace_a body to send (04 §11.4 step 1).

start

static start(inputs: CpaceSessionInputs & { prsKind: PrsKind; prs: Uint8Array }, opts?: CpaceOptions): Promise<CpaceInitiator>

04 §11.4 step 1: compute g from the credential the user entered (prsKind 1 with the 16-byte QR secret, 2 with the 6 ASCII digits), draw ya, and build cpace_a.

inputs: CpaceSessionInputs & { prsKind: PrsKind; prs: Uint8Array }
opts: CpaceOptions

Default: {}

finish

finish(body: CpaceBBody): Promise<{ confirm: ConfirmABody; isk: Uint8Array }>

04 §11.4 step 3: check ADb, compute K, ISK and the confirmation keys, verify tb in constant time, and return confirm_a and the ISK. On a tag mismatch it throws crypto.pake_failed (confirmation): post abort with wrong_code and send no CPace message. Callable once.

Source: api/pairing.ts:372

CpaceResponder class

The CPace responder: the displayer (04 §11.2, 08 §6.6.1).

class CpaceResponder

message

readonly message: CpaceBBody

The cpace_b body to send (04 §11.4 step 2).

respond

static respond(inputs: CpaceSessionInputs & { secret: Uint8Array; code: string } | { credentials: PairingDisplayCredentials }, msg: CpaceABody, opts?: CpaceOptions): Promise<CpaceResponder>

04 §11.4 step 2 on a received cpace_a: check cred and ADa, select the PRS for cred from the credentials this displayer showed, compute g, yb, Yb, K, ISK and tb. This uses the displayer's only attempt (08 §6.9): pass a PairingDisplayCredentials, which this consumes and erases before anything else, or discard raw secret and code yourself.

inputs: CpaceSessionInputs & { secret: Uint8Array; code: string } | { credentials: PairingDisplayCredentials }
opts: CpaceOptions

Default: {}

confirm

confirm(body: ConfirmABody): Promise<Uint8Array<ArrayBufferLike>>

04 §11.4 step 4: verify ta in constant time and return the ISK; the responder's run is confirmed. A mismatch throws crypto.pake_failed (confirmation): post abort with wrong_code. Callable once.

Source: api/pairing.ts:445

DevicesApi class

Device records (05 §12.9).

class DevicesApi

constructor

new DevicesApi(http: HttpClient)

list

list(params?: ListDevicesParams, opts?: RequestOptions): Pager<DeviceRecord, CollectionPage<DeviceRecord>>

List the account's devices: active ones newest lastSeenAt first, then, with includeRevoked, recently revoked ones. GET /v1/me/devices (05 §12.9).

params: ListDevicesParams

Default: {}

get

get(did: string, opts?: RequestOptions): Promise<DeviceRecord>

One device record; did may be the literal current. GET /v1/me/devices/{did} (05 §12.9).

did: string

rename

rename(did: string, name: string, opts?: RequestOptions): Promise<DeviceRecord>

Rename a device. PATCH /v1/me/devices/{did} (05 §12.9); emits device.updated.

did: string
name: string

revoke

revoke(did: string, body?: RevokeDeviceRequest, opts?: RequestOptions): Promise<RevokeDeviceResponse>

Revoke a device (05 §13). POST /v1/me/devices/{did}/revoke (05 §12.9). For the current device (or current) this is a sign-out; any other active device needs fresh authentication (auth.reauth_required, 05 §9). Idempotent: an already revoked device answers 200 with its record.

did: string
body: RevokeDeviceRequest

Default: {}

remove

remove(did: string, opts?: RequestOptions): Promise<void>

Body-less alias of revoke with reason: removed. DELETE /v1/me/devices/{did} (05 §12.9); answers 204, also for an already revoked device.

did: string

Source: api/devices.ts:36

DiscoveryResolver class

Resolves domains to servers for a client (02 §5), keeping the caches, negative entries and pins that 02 §10 and §13 require. One instance per client; it is safe to share between servers.

Server-only duties (the mandatory W-c check, SSRF target restrictions of 02 §5.6, suspended pin state and admin events) are out of scope; server software uses the building blocks in this module instead.

class DiscoveryResolver

constructor

new DiscoveryResolver(options: DiscoveryResolverOptions)

mode

get mode(): "web" | "native"

The resolution mode in use.

pinStore

get pinStore(): ServerPinStore | null

The pin store (02 §10.6), or null when pinning is off.

resolve

resolve(domain: string, opts?: ResolveOptions): Promise<DiscoveryResult>

resolve(D) (02 §5.2 for native clients, 02 §5.4 for web clients): validate the domain, answer from the cache when fresh (or from a negative entry), coalesce concurrent resolutions, obtain the delegation, fetch and validate /meta, check that D is in domains and that the canonical domain resolves back to the same base URL, apply client pinning, cache and return. After a temporary failure, an expired result is returned with stale: true for up to 7 days (02 §13.2). The whole resolution is bounded by 30 s (02 §5.5).

A pin conflict (02 §10.6) fails with discovery.peer_suspended (the server is treated as temporarily unreachable) and calls onPinConflict.

domain: string
opts: ResolveOptions

Default: {}

recheck

recheck(domain: string, opts?: Omit<ResolveOptions, "recheck">): Promise<DiscoveryResult>

A re-check of domain (02 §5.2 step 2): every cache bypassed.

domain: string
opts: Omit<ResolveOptions, "recheck">

Default: {}

cached

cached(domain: string): DiscoveryResult | null

The cached result for domain without any I/O, fresh or not, or null.

domain: string

invalidate

invalidate(domain: string): void

Drop every cached value for domain (an admin action or a local configuration change, 02 §13.4). Pins are kept.

domain: string

forget

forget(domain: string): Promise<void>

Forget the pin and every cached value for domain: the next contact is a first use.

domain: string

refreshAfterFailure

refreshAfterFailure(domain: string, opts?: { signal?: AbortSignal }): Promise<DiscoveryResult> | null

React to a failure that 02 §13.4 lists as a refresh trigger: a TLS failure or connection refusal on the server's base URL, a 404/410 on /meta or on a /v1/… endpoint without a registered problem code (what: 'delegation', which refreshes delegation then metadata), or discovery.domain_not_served for a domain the client believed the server served. At most once per 60 s per domain; returns null when the limit holds the refresh back.

domain: string
opts: { signal?: AbortSignal }

Default: {}

handleMetadataChanged

handleMetadataChanged(serverDomain: string, payload?: Pick<MetadataChangedPayload, "urgent">): () => void

React to discovery.metadata_changed received from the server reached through serverDomain (02 §16.1): after a random 0–30 s wait (0–5 s when urgent), refetch /meta with Cache-Control: no-cache and re-run validation and pinning. Refetches are limited to one per 60 s per domain (shared with unknown-kid refetches); a refetch the limit holds back is deferred to the end of the window, never dropped. No value of the payload is used except urgent. Returns a function that cancels the scheduled refetch.

serverDomain: string
payload?: Pick<MetadataChangedPayload, "urgent">

dispose

dispose(): void

Cancel every scheduled background refetch.

lookupViaHome

lookupViaHome(domain: string, opts?: { signal?: AbortSignal }): Promise<ResolveResult>

Resolve through the home server only, without contacting the target, creating or changing any pin or cache entry: for no-contact flows such as a message request before Accept (02 §5.8). The values are for display and the checks 07 §14.7 allows, never for a pin.

domain: string
opts: { signal?: AbortSignal }

Default: {}

recoverPin

recoverPin(domain: string, opts?: { signal?: AbortSignal }): Promise<{ previous: ServerPinRecord | null; pin: ServerPinRecord } | null>

Recover a rejected pin of a server other than the home server (02 §10.6): when the home server's /v1/resolve (which reflects its own pin, including admin acceptance) returns the new base URL and canonical domain with stale: false, and this client's own fetch of /meta at that base URL validates with the same canonical domain, the pin is replaced. The caller then discards any remote-session token for the old base URL and obtains a new remote session (06). Returns null when the home server's answer is stale. Never for the home server itself.

domain: string
opts: { signal?: AbortSignal }

Default: {}

serverKey

serverKey(iss: string, kid: string, opts: { iat: number; purpose?: ServerKeyPurpose; signal?: AbortSignal }): Promise<ServerKeyLookup>

serverKey(iss, kid, purpose, iat) (02 §11.6): the key to verify a JWS signed by server iss. The kid domain must equal iss (else discovery.unknown_key); iss must be the resolved canonical domain (else address.non_canonical); the key comes from the pin when one is kept, otherwise from validated metadata; an unknown kid causes at most one re-check per 60 s per domain; the key must pass the usability test (else discovery.key_unusable). The caller then verifies the JWS per 04 and the claims per their owner.

iss: string
kid: string
opts: { iat: number; purpose?: ServerKeyPurpose; signal?: AbortSignal }

jwsKeyResolver

jwsKeyResolver(opts?: { purpose?: ServerKeyPurpose; signal?: AbortSignal }): (ctx: JwsKeyContext) => Promise<Uint8Array<ArrayBufferLike>>

A key source for verifyJws (04 §6.8 step 9) that looks up server-signed JWSs with serverKey: kid domain = issuer (already checked by verifyJws), iat from the unauthenticated payload, used only to select the key (02 §11.6, 04 §6.8 item 2).

opts: { purpose?: ServerKeyPurpose; signal?: AbortSignal }

Default: {}

Source: discovery/resolver.ts:263

DmBlocksApi class

The account's DM blocks at its home server (12 §9.5). At most 10,000 per account.

class DmBlocksApi

constructor

new DmBlocksApi(http: HttpClient)

Wrap an HttpClient for the account's home server.

list

list(params?: { cursor?: string; limit?: number }, opts?: RequestOptions): Pager<DmBlock, CollectionPage<DmBlock>>

List blocks, paging automatically. GET /v1/me/dms/blocks (12 §9.5).

params: { cursor?: string; limit?: number }

Default: {}

block

block(addr: string, opts?: RequestOptions): Promise<DmBlock>

Block a canonical address: its requests are dropped silently, every 1:1 entry with it goes to blocked, and the home tells each hosting server. Idempotent. PUT /v1/me/dms/blocks/{addr} (12 §9.5).

addr: string

unblock

unblock(addr: string, opts?: RequestOptions): Promise<void>

Unblock; blocked 1:1 entries go back to declined with no quiet period. DELETE /v1/me/dms/blocks/{addr} (12 §9.5).

addr: string

Source: api/dms.ts:850

DmIndexApi class

The DM index at the account's home server (12 §9.1–§9.3). Requires a home session or the bot's token.

class DmIndexApi

constructor

new DmIndexApi(http: HttpClient)

Wrap an HttpClient for the account's home server.

list

list(params?: ListDmIndexParams, opts?: RequestOptions): Pager<DmIndexEntry, CollectionPage<DmIndexEntry>>

List index entries, paging automatically. GET /v1/me/dms (12 §9.3). Default states active,requested; ordered by lastActivityAt descending, then id.

params: ListDmIndexParams

Default: {}

get

get(id: string, opts?: RequestOptions): Promise<DmIndexEntry>

One entry, with pendingEvents. GET /v1/me/dms/{id} (12 §9.3).

id: string

register

register(body: RegisterDmRequest, opts?: RequestOptions): Promise<DmRegisterResult>

Register an outgoing DM, or set an existing entry for (host, ctx) to active (accepting any pending request). Idempotent. POST /v1/me/dms (12 §9.3). The home server checks only syntax and doesn't contact the hosting server.

update

update(id: string, body: UpdateDmIndexEntryRequest, opts?: RequestOptions): Promise<DmIndexEntry | undefined>

Hide or unhide an entry. PATCH /v1/me/dms/{id} (12 §9.3). Resolves with the updated entry, or undefined if the server answers without a body.

id: string

hide

hide(id: string, hidden?: boolean, opts?: RequestOptions): Promise<DmIndexEntry | undefined>

Hide (or unhide) an entry from the DM list (12 §9.3). Shorthand for update.

id: string
hidden: boolean

Default: true

delete

delete(id: string, opts?: RequestOptions): Promise<void>

Delete an entry in state declined, left or closed, or an outgoing entry whose lastSeq is 0 (the clean-up after a failed creation, 12 §7.1). Another entry fails with 409 dm.entry_active. DELETE /v1/me/dms/{id} (12 §9.3).

id: string

Source: api/dms.ts:746

DmRequestsApi class

Message requests (12 §10.3). Home session required: these endpoints exist only at the account's own home server.

Before the user accepts, a client talks only to its home server (12 §10.4, D-049): it renders the request from DmRequestsApi.get alone, without contacting the hosting server, the inviter's home or any server the sender chose (see assertMayContactBeforeAccept).

class DmRequestsApi

constructor

new DmRequestsApi(http: HttpClient)

Wrap an HttpClient for the account's home server.

list

list(params?: ListDmRequestsParams, opts?: RequestOptions): Pager<DmRequestListItem, CollectionPage<DmRequestListItem>>

List requests, newest first, paging automatically. GET /v1/me/dm-requests (12 §10.3). Default state pending. List items omit events and welcome and carry preview instead.

params: ListDmRequestsParams

Default: {}

get

get(id: string, opts?: RequestOptions): Promise<DmRequest>

The full DmRequest, with its events, Welcome, IdentityStates and relayed server keys. GET /v1/me/dm-requests/{id} (12 §10.3).

id: string

accept

accept(id: string, opts?: RequestOptions): Promise<DmIndexEntry>

Accept: the request becomes accepted, the entry active, and the home sends dm.response accept. Resolves with the DmIndexEntry. POST /v1/me/dm-requests/{id}/accept (12 §10.3). Only now may the client contact the hosting server (12 §10.5). A request that isn't pending fails with 409 dm.request_not_pending.

id: string

decline

decline(id: string, opts?: RequestOptions): Promise<void>

Decline quietly: the request becomes declined, the entry declined with declinedAt now (a 30-day quiet period), and the home sends dm.response decline. The sender isn't told. POST /v1/me/dm-requests/{id}/decline (12 §10.3).

id: string

block

block(id: string, opts?: RequestOptions): Promise<void>

Decline and block inviter.addr (12 §9.5). POST /v1/me/dm-requests/{id}/block (12 §10.3). This is the block half of "Report and block"; the report goes to the user's own home server through 10's message-request report path, never to the hosting server.

id: string

Source: api/dm-requests.ts:26

DmsApi class

Direct messages and group DMs (12). The methods on this class talk to a DM's hosting server (/v1/dms…, with a home or remote session); index, settings, blocks and requests talk to the account's home server (/v1/me/dms…, /v1/me/dm-requests…) and are only meaningful on the home ServerClient. Messages, timelines and read state of a DM use 11's APIs with its ctx.

class DmsApi

constructor

new DmsApi(http: HttpClient)

Wrap an HttpClient for one server.

index

readonly index: DmIndexApi

The DM index (12 §9.1–§9.3). Home server only.

settings

readonly settings: DmSettingsApi

DmSettings (12 §9.4). Home server only.

blocks

readonly blocks: DmBlocksApi

Blocks (12 §9.5). Home server only.

requests

readonly requests: DmRequestsApi

Message requests (12 §10.3). Home server only.

create

create(body: CreateDmRequest, opts?: RequestOptions): Promise<DmCreateResult>

Create a DM at its hosting server, or get the existing 1:1 DM. POST /v1/dms (12 §7.2). Send it to the rule host (planDirectDm, planGroupDm). A 1:1 creation is idempotent on ctx (12 §7.2 step 4), so the caller's outbox can simply send it again. For a group DM the SDK sends a fresh Idempotency-Key unless you pass idempotencyKey (12 §7.2); pass your own and reuse it when your outbox retries the creation later, so that the retry returns the group the first request created. The body is checked with validateCreateDmRequest first.

Errors to expect: dm.wrong_host (see nextWrongHostStep), dm.security_mismatch (refetch the IdentityStates in data.participants), dm.encryption_pending, dm.recipient_not_found, dm.invalid_participants, dm.too_many_participants, security.device_not_enrolled, federation.blocked, address.non_canonical, and 13's mls.* codes for a bad bootstrap.

get

get(ctx: DmCtx, opts?: RequestOptions): Promise<Dm>

The Dm object, filtered for the caller (12 §6.5). GET /v1/dms/{ctx} (12 §7.5).

ctx: DmCtx

update

update(ctx: DmCtx, body: UpdateDmRequest, opts?: RequestOptions): Promise<Dm>

Set or clear (null) a group DM's name; any active participant may. PATCH /v1/dms/{ctx} (12 §7.5). A 1:1 DM fails with 409 dm.not_group.

ctx: DmCtx

rename

rename(ctx: DmCtx, name: string | null, opts?: RequestOptions): Promise<Dm>

Rename a group DM, or clear its name with null (12 §7.5). Shorthand for update.

ctx: DmCtx
name: string | null

addParticipants

addParticipants(ctx: DmCtx, body: AddDmParticipantsRequest, opts?: RequestOptions): Promise<DmAddParticipantsResult>

Add 1 to 10 people to a group DM. POST /v1/dms/{ctx}/participants (12 §12.2). In an insecure group they become pending at once (200). In a secure group the answer is 202 and they are reserved for 60 s: the caller claims their KeyPackages and submits one commit adding them and listing them in sv_participants (13); a late commit fails with dm.reservation_expired.

ctx: DmCtx

removeParticipant

removeParticipant(ctx: DmCtx, addr: string, opts?: RequestOptions): Promise<void>

Remove a participant from a group DM, or leave it when addr is the caller. DELETE /v1/dms/{ctx}/participants/{addr} (12 §12.3). While the group has an owner only the owner may remove others (403 dm.not_owner); once it has none, any active participant may. A 1:1 DM can't be left (409 dm.not_group): hide it or block the peer instead.

ctx: DmCtx
addr: string

leave

leave(ctx: DmCtx, self: string, opts?: RequestOptions): Promise<void>

Leave a group DM: removeParticipant with the caller's own address (12 §12.3).

ctx: DmCtx
self: string

Source: api/dms.ts:885

DmSettingsApi class

The account's DmSettings at its home server (12 §9.4).

class DmSettingsApi

constructor

new DmSettingsApi(http: HttpClient)

Wrap an HttpClient for the account's home server.

get

get(opts?: RequestOptions): Promise<DmSettings>

GET /v1/me/dms/settings (12 §9.4).

put

put(settings: DmSettings, opts?: RequestOptions): Promise<DmSettings>

Replace the settings. PUT /v1/me/dms/settings (12 §9.4). Resolves with the stored settings, or with settings itself if the server answers without a body.

settings: DmSettings

Source: api/dms.ts:823

Emitter class

A typed emitter over an event map M (event type → payload type), such as SessionEvents (03 §11.3) or the composed EventMap. on, once and onAny return an unsubscribe function. Listeners added or removed during an emit don't affect that emit.

class Emitter<M extends object>

constructor

new Emitter<M extends object>(options?: EmitterOptions)
options: EmitterOptions

Default: {}

on

on<K extends string>(type: K, listener: Listener<M[K]>): () => void

Listen for type. Returns an unsubscribe function.

type: K
listener: Listener<M[K]>

off

off<K extends string>(type: K, listener: Listener<M[K]>): void

Stop listening.

type: K
listener: Listener<M[K]>

once

once<K extends string>(type: K, listener: Listener<M[K]>): () => void

Listen for the next type only. Returns an unsubscribe function.

type: K
listener: Listener<M[K]>

onAny

onAny(listener: AnyListener<M>): () => void

Listen for every event, including types not in M that are emitted through emitUnknown.

listener: AnyListener<M>

emit

emit<K extends string>(type: K, payload: M[K]): boolean

Emit payload to the listeners of type, then to onAny listeners. Returns whether any listener ran.

type: K
payload: M[K]

emitUnknown

emitUnknown(type: string, payload: unknown): boolean

Emit an event whose type isn't in M, for example an event type from a newer minor version (03 §12.3: receivers ignore unknown types, but an application may still want to see them).

type: string
payload: unknown

listenerCount

listenerCount(type?: keyof M & string): number

The number of listeners for type (or of all typed listeners when omitted, plus onAny ones).

type?: keyof M & string

clear

clear(): void

Remove every listener.

Source: core/emitter.ts:30

EventSocket class

The event WebSocket client (03 §5 to §7), for one client session at one server.

  • Handshake (03 §5.1): offers sloppyv.v1, closes with 1002 if the server selects no subprotocol or another one, and refuses permessage-deflate without both no-context-takeover parameters.
  • Hello and ready (03 §5.4, §5.5): sends session.hello with the token from the TokenProvider, the client string, protocol, features, resume positions, subscriptions, heads and the foreground state; waits 15 s for session.ready.
  • Subscriptions (03 §5.6, §5.7): subscribe, follow, watchHeads, unsubscribe; session.heads updates heads; session.subscription_ended removes the stream.
  • Sequencing (03 §7.3 to §7.5): per-stream positions with duplicate and gap detection, gap repair by resume, the client's own resync after three gaps in 5 minutes, withheld events, and session.resync_required surfaced as the resync lifecycle event the application acts on.
  • Heartbeat (03 §5.9): answers session.ping, closes with 4008 after 75 s of silence, ping with a 10 s pong deadline, and the faster in-call check while setCall names a call's context.
  • Re-authentication (03 §5.13): sends session.reauth whenever the provider's token changes and refreshes when the deadline is less than 120 s away.
  • Close codes and reconnecting (03 §5.10, §5.11): every close code gets the table's reaction; delays use ReconnectBackoff.

Wire events are delivered as whole envelopes (e.d is the payload, e.ctx the stream, e.seq the position of a durable event) through on; SDK-level events through lifecycle.

class EventSocket<M extends object = DefaultEventMap>

constructor

new EventSocket<M extends object = DefaultEventMap>(options: EventSocketOptions)

lifecycle

readonly lifecycle: Emitter<EventSocketLifecycleEvents>

SDK-level events: state changes, resyncs, refusals, diagnostics (see EventSocketLifecycleEvents).

state

get state(): EventSocketState

session

get session(): SessionReady | null

The session.ready payload of the current socket, or null when not ready (03 §5.5).

features

get features(): string[]

The effective feature set of the current socket (03 §12.2 item 3), or [] when not ready.

authDeadline

get authDeadline(): number | null

The socket's authentication deadline in Unix ms, or null (03 §5.13 item 1).

setBaseUrl

setBaseUrl(baseUrl: string): void

Point the socket at a new base URL after the server moved and the client's pin accepted the move (02 §10.2, §15.6). Takes effect on the next connection attempt; a socket that is open stays open.

baseUrl: string

position

position(stream: StreamName): number | null

The position P of a stream (03 §7.3), or null.

stream: StreamName

subscriptions

subscriptions(): Map<StreamName, SubscriptionLevel>

The desired subscription set: stream → level (03 §5.6, §5.11 item 4).

heads

heads(): Map<CtxRef, Head>

The latest session.heads value of each heads stream (03 §5.7).

isResyncing

isResyncing(stream: StreamName): boolean

Whether a stream is resyncing (03 §7.5).

stream: StreamName

on

on<K extends string>(type: K, listener: (envelope: ServerEnvelope<K, M[K]>) => void): () => void

Listen for envelopes of type type (03 §6.1, §11.3). The listener gets the whole envelope: d is the payload, ctx the stream, seq the position of a durable event. Durable events arrive at most once each, in seq order per stream; withheld events (03 §7.2 D4a) and duplicates are not delivered. Returns an unsubscribe function.

type: K
listener: (envelope: ServerEnvelope<K, M[K]>) => void

once

once<K extends string>(type: K, listener: (envelope: ServerEnvelope<K, M[K]>) => void): () => void

Listen for the next envelope of type type only.

type: K
listener: (envelope: ServerEnvelope<K, M[K]>) => void

off

off<K extends string>(type: K, listener: (envelope: ServerEnvelope<K, M[K]>) => void): void

Stop listening.

type: K
listener: (envelope: ServerEnvelope<K, M[K]>) => void

onAny

onAny(listener: (type: string, envelope: ServerEnvelope) => void): () => void

Listen for every envelope, including types unknown to M (03 §12.3).

listener: (type: string, envelope: ServerEnvelope) => void

connect

connect(): Promise<void>

Start the socket ("the app needs this server", 03 §5.3) and resolve at the next session.ready. Reconnects happen by themselves; the promise rejects only if the socket stops (see EventSocketStopReason) or is closed first. Called again while running, it returns the wait for the next ready (or resolves at once if ready).

close

close(options?: EventSocketCloseOptions): Promise<void>

Close the socket with 1000 and go idle ("the app no longer needs this server, or the user signs out", 03 §5.3). Pending waits reject with sdk.closed. With discardPositions, every stream position is forgotten (03 §7.3 rule 5).

options: EventSocketCloseOptions

Default: {}

networkChanged

networkChanged(): void

The operating system reports that the network came back or changed. In backoff the socket reconnects at once, counting as retry 0, at most once per 5 s (03 §5.11 item 3); in ready it checks the connection with ping (03 §5.9 item 5).

setForeground

setForeground(foreground: boolean): void

Report whether the user can see the app (03 §5.8). Sends session.state when ready: false at once, true at most once per 5 s. Returning to the foreground while in backoff reconnects at once (03 §5.11 item 3).

foreground: boolean

ping

ping(): boolean

Send a client session.ping (03 §5.9 item 5), for example after the device wakes up. At most once per 5 s; returns whether a ping was sent. Without a session.pong within 10 s the connection is treated as dead: closed with 4008 and reopened at once.

setCall

setCall(ctx: CtxRef | null): void

Declare the call this client participates in on this server, or null when it leaves (03 §5.9 item 6, §5.10, §7.6). While set: the call's context is kept at level full and never moved to heads; the socket sends session.ping whenever no call.tick has arrived for 3 s (at most once per 3 s) and treats a missing pong after 3 s as a dead connection; and a server_shutdown reconnect waits at most 2 s.

ctx: CtxRef | null

subscribe

subscribe(request: SessionSubscribe): Promise<SubscriptionResult[]>

Add or change subscriptions with exactly the members of session.subscribe (03 §5.6). A stream named in several lists counts only in the first of resume, subscribe, heads; me in subscribe or heads is ignored; community can't be at level heads. When ready the request is sent at once (split to stay within maxEventBytes, 03 §16.2 rule 4); otherwise it goes in the next session.hello. Resolves with one SubscriptionResult per stream named, when the server answers; a refused result is a result, not an error. Throws sdk.invalid_argument if the set would exceed maxSubscriptions (03 §5.4: clients SHOULD stay within it).

follow

follow(streams: readonly StreamName[]): Promise<SubscriptionResult[]>

Follow streams at level full: resume from the known position where there is one, otherwise subscribe from the current head (03 §5.4, §7.3).

streams: readonly StreamName[]

watchHeads

watchHeads(ctxs: readonly CtxRef[]): Promise<SubscriptionResult[]>

Subscribe context references at level heads for unread indicators (03 §5.7).

ctxs: readonly CtxRef[]

unsubscribe

unsubscribe(streams: readonly StreamName[]): Promise<StreamName[]>

Remove subscriptions (03 §5.6). me and streams that aren't subscribed are ignored. The streams leave the desired set at once; when ready, resolves with the streams the server removed (session.unsubscribed), otherwise with the streams removed locally.

streams: readonly StreamName[]

forget

forget(stream: StreamName): Promise<void>

Forget a stream's position, so it is subscribed fresh rather than resumed. Required when the client lost its cached state for the stream (03 §7.3 rule 4: it subscribes fresh and refetches the state over HTTP). If the stream is followed at full on a ready socket, the fresh session.subscribe is sent at once and P becomes the result's headSeq (03 §5.6, §7.3 rule 1); otherwise the next session.hello subscribes it fresh. me can't be subscribed fresh on a ready socket (the server ignores me in subscribe, 03 §5.4), so for me only the stored position is deleted and live events keep being applied from the socket's current position. The app refetches the state over HTTP either way.

stream: StreamName

Source: events/socket.ts:452

FederationApi class

Federation: assertions, remote sessions, policy and blocks (06 §4, §6, §12).

class FederationApi

constructor

new FederationApi(http: HttpClient)

http is the client of the server the calls go to: the home server for assertions, the remote server for sessions.

createAssertion

createAssertion(body: AssertionRequest, opts?: RequestOptions): Promise<AssertionResponse>

Obtain a HomeAssertion for the remote server aud from the home server. POST /v1/federation/assertions (06 §4.1). Authenticated with the home session or a bot token; a remote session token gets 403 auth.home_session_required. Each call returns a new single-use assertion.

The endpoint is exempt from Idempotency-Key replay (06 §4.1, 03 §14.2 item 8), so no key is sent even if one is passed.

createSession

createSession(body: CreateSessionRequest, opts?: CreateSessionOptions): Promise<RemoteSessionWithToken>

Create (no renewToken) or renew (renewToken set) a remote session. POST /v1/federation/sessions (06 §6.1). Answers 201 for a new session and 200 for a renewal, both with a RemoteSession including token.

The endpoint is public (03 §3.2 rule 6): creation sends no Authorization, and it is exempt from Idempotency-Key replay (06 §4.1). Send renewToken only while that token is unexpired by your clock; after a 401 (core.token_expired, federation.session_ended, core.unauthenticated) resend the same body at once without it (06 §6.1).

getCurrentSession

getCurrentSession(opts?: CurrentSessionOptions): Promise<RemoteSession>

The current remote session, without token: learn expiresAt and state after a restart. GET /v1/federation/sessions/current (06 §6.5).

deleteCurrentSession

deleteCurrentSession(opts?: CurrentSessionOptions): Promise<void>

End the current remote session (reason signed_out); 204. DELETE /v1/federation/sessions/current (06 §6.5). Call it on every remote server when the user signs out of the device. Memberships are unchanged.

extendCurrentSession

extendCurrentSession(opts?: CurrentSessionOptions): Promise<RemoteSession>

Ask the remote server to extend the session because the home server is unreachable. POST /v1/federation/sessions/current/extend (06 §6.6). Answers 200 with the RemoteSession (without token; the token is unchanged), or 409 core.conflict (more than 900 s remain), federation.extension_limit, federation.home_reachable, or 503 discovery.peer_suspended.

getPolicy

getPolicy(opts?: RequestOptions): Promise<FederationPolicy>

The server's federation policy. GET /v1/federation/policy (06 §12.4). Requires the admin system role (10 §4.2); others get 403 core.forbidden.

updatePolicy

updatePolicy(body: UpdateFederationPolicyRequest, opts?: RequestOptions): Promise<FederationPolicy>

Change the policy mode or allowlist. PATCH /v1/federation/policy (06 §12.4). A server without allowlist mode answers 501 core.unsupported_feature (data.feature: "federation_allowlist").

listBlocks

listBlocks(params?: { limit?: number; cursor?: string }, opts?: RequestOptions): Pager<FederationBlock, CollectionPage<FederationBlock>>

List federation blocks, paging automatically. GET /v1/federation/blocks?cursor=&limit= (06 §12.4, 00 §7.10).

params: { limit?: number; cursor?: string }

Default: {}

putBlock

putBlock(domain: string, body?: PutFederationBlockRequest, opts?: RequestOptions): Promise<FederationBlock>

Create (201) or update (200) the block of domain. PUT /v1/federation/blocks/{domain} (06 §12.4). An alias is accepted and stored under the canonical domain it resolves to; blocking one of the server's own domains fails with 400 core.invalid_request.

domain: string
body: PutFederationBlockRequest

Default: {}

deleteBlock

deleteBlock(domain: string, opts?: RequestOptions): Promise<void>

Remove the block of domain (an alias is accepted); 204, or 404 core.not_found if absent. DELETE /v1/federation/blocks/{domain} (06 §12.4).

domain: string

Source: api/federation.ts:72

FetchHttpClient class

The default HttpClient: fetch with the rules of 03 §2 (base URL, media types, status codes, retries), §3 (one Authorization header, tokens only to the issuing server, 401 recovery), §10 (problem objects), §14 (Idempotency-Key) and §15 (Retry-After, RateLimit).

Retries (03 §2.7): a request is retried automatically only if it is idempotent (GET, PUT, DELETE, or POST/PATCH with idempotencyKey or idempotent: true) and failed with a network error, a timeout, a problem with retryable: true, or a bare 429/502/503/504; retry narrows this per request (RetryMode). The delay is full jitter over min(30 s, 500 ms × 2^n), never less than retryAfterMs/Retry-After. Two cases retry once regardless of method, because the request wasn't processed: a 401 after TokenProvider.recover succeeds (03 §3.3), and 425 core.too_early (03 §2.2 item 4). A retried DELETE that gets core.not_found or core.gone succeeds (03 §2.5).

class FetchHttpClient implements HttpClient

constructor

new FetchHttpClient(options: FetchHttpClientOptions)

homeServer

get homeServer(): boolean

Whether this client talks to the account's home server (see FetchHttpClientOptions.homeServer).

baseUrl

get baseUrl(): string

The server's base URL, https, without trailing slash (03 §2.1). Changes only through moveTo.

tokens

get tokens(): TokenProvider | null

The token provider used for auth: 'session', if any.

moveTo

moveTo(baseUrl: string): void

Follow a server move: send every later request, with the same credential, to baseUrl. Call it only after the client's pin accepted the new base URL (02 §10.2, §10.6 token binding, §15.6); otherwise the token MUST stay bound to the old one (03 §3.2 rule 3). Validated like the constructor's baseUrl.

baseUrl: string

isUnderBase

isUnderBase(url: string | URL): boolean

Whether url is under this client's base URL: same origin and path prefix (03 §3.2 rule 3).

url: string | URL

request

request<T = unknown>(req: HttpRequest): Promise<T>

Send req with the auth, retry, redirect and error rules described on the class (03 §2, §3, §10, §14, §15). Resolves with the parsed JSON body (undefined for 204 or expect: 'none', the Response for expect: 'response').

Source: core/http.ts:542

HistoryApi class

The /v1/contexts/{ctx}/history/ endpoints (14 §8). Insecure contexts answer history.disabled.

class HistoryApi

constructor

new HistoryApi(http: HttpClient)

state

state(ctx: string, opts?: RequestOptions): Promise<HistoryState>

The caller's visibility: visibleFromSeq, earlierWithheld and grants (14 §8.2). GET /v1/contexts/{ctx}/history.

ctx: string

createShare

createShare(ctx: string, share: HistoryShare, opts?: RequestOptions): Promise<HistoryShareCreated>

Post a HistoryShare built with createHistoryShare (14 §7.6, §8.3). POST /v1/contexts/{ctx}/history/shares. Idempotent by shareId (14 §7.7 step 6): a retry after an unknown outcome MUST resend the kept body unchanged; after sealed.not_in_group, mls.not_member or history.share_forbidden (recipient_not_in_group) the caller builds a new share with a new shareId (14 §7.6 step 7). The SDK therefore resends the same bytes by itself only after a network failure or timeout; every problem the server returns, retryable or not, reaches the caller. The shape is checked locally first (14 §7.7 step 5).

ctx: string

shares

shares(ctx: string, query?: HistorySharesQuery, opts?: RequestOptions): Pager<StoredHistoryShare, CollectionPage<StoredHistoryShare>>

The HistoryShares addressed to the caller's account in its current membership, oldest first (14 §8.4). GET /v1/contexts/{ctx}/history/shares, paging automatically; limit 1 to 10.

ctx: string
query: HistorySharesQuery

Default: {}

lookupCredentials

lookupCredentials(ctx: string, devices: ({ addr: string; did: string })[], opts?: RequestOptions): Promise<CredentialLookupResponse>

Fetch credential records for 1 to 100 devices (14 §5.6, §8.5). POST /v1/contexts/{ctx}/history/credentials/lookup. Every record must pass the local checks of 14 §6.2 before its DSK is used.

ctx: string
devices: ({ addr: string; did: string })[]

Source: api/history.ts:29

HomeSession class

The home session: one device record and its token family (05 §12.1). Implements TokenProvider with kind: 'home' and scheme: 'Bearer'.

  • token() refreshes first when the access token expires within refreshMarginMs (05 §7.5, 03 §5.13 item 5).
  • Refreshes are single-flight and run under lock (05 §7.7). A refresh whose response is lost is repeated with the same refresh token inside the 30 s retry window (05 §7.6 rule 2).
  • recover() follows 03 §3.3: core.token_expired and core.unauthenticated try one refresh; auth.session_revoked and auth.refresh_reused end the session (05 §14.1).
  • Listeners from onChange get every new access token (for session.reauth, 03 §5.13); listeners from onEnd learn when the session is over, and must then run 05 §14.1 (delete tokens, keys and cached content).
class HomeSession implements TokenProvider

constructor

new HomeSession(auth: AuthApi, state: HomeSessionState, options?: HomeSessionOptions)
auth: AuthApi
options: HomeSessionOptions

Default: {}

scheme

readonly scheme: "Bearer"

'Bearer' for home/remote sessions, 'Bot' for bot tokens at the bot's home server (03 §3.1).

kind

readonly kind: "home"

What kind of credential this is, which decides recovery (03 §3.3).

baseUrl

get baseUrl(): string | undefined

The base URL the token family is bound to (02 §10.6), or undefined for an unbound legacy state.

clientId

get clientId(): string

The client ID of the token family (05 §7.6).

did

get did(): string | undefined

This device's did, if known (05 §12.4).

authAt

get authAt(): string | null

The session's authAt (05 §9.1), or null.

ended

get ended(): HomeSessionEnded | null

Why the session ended, or null while it is usable.

fromTokenResponse

static fromTokenResponse(auth: AuthApi, clientId: string, response: SessionTokenResponse, options?: HomeSessionOptions): HomeSession

A session from the full token response of a login or sign-up (05 §7.3, §8.4). clientId must be the one used at /authorize.

auth: AuthApi
clientId: string
options: HomeSessionOptions

Default: {}

state

state(): HomeSessionState

A snapshot of the state to persist (05 §7.7). Contains secrets; never log it.

rebind

rebind(baseUrl: string): Promise<void>

Rebind the token family to baseUrl after the client's pin accepted a move of the home server (02 §10.2, §10.6 token binding), and persist the state. The AuthApi must already reach baseUrl.

baseUrl: string

isFresh

isFresh(maxAgeMs?: number): boolean

fresh(session, maxAgeMs) = (now − session.authAt) ≤ maxAgeMs (05 §9.1), from the device clock. The server decides; this only predicts whether an operation will get auth.reauth_required. Default limit 10 minutes.

maxAgeMs: number

Default: FRESH_AUTH_MAX_AGE.default

expiresAt

expiresAt(): Date | null

When the current access token expires (05 §7.5).

onChange

onChange(listener: (token: string) => void): () => void

Subscribe to new access tokens (03 §5.13: send session.reauth after each).

listener: (token: string) => void

onEnd

onEnd(listener: (info: HomeSessionEnded) => void): () => void

Subscribe to the end of the session (05 §14.1). Called once.

listener: (info: HomeSessionEnded) => void

token

token(signal?: AbortSignal): Promise<string>

The current access token, refreshed first if it expires within refreshMarginMs. If a refresh fails transiently while the old token is still valid, the old token is returned.

signal?: AbortSignal

refresh

refresh(signal?: AbortSignal): Promise<string>

Refresh now (05 §7.6), joining a refresh already in flight. Resolves with the new access token. Terminal failures (auth.refresh_reused, auth.session_revoked, auth.invalid_grant, …) end the session. account.suspended fails without ending it (05 §7.6 rule 5).

signal?: AbortSignal

recover

recover(problem: Problem | null, signal?: AbortSignal): Promise<boolean>

Called after a 401 or a 4001 socket close (03 §3.3). Home-session column: core.token_expired → refresh silently, retry once; core.unauthenticated → try one refresh, else the user signs in again. auth.session_revoked and auth.refresh_reused end the session (05 §14.1).

Resolves false only for a definitive outcome: the session has ended, or the refresh endpoint answered 401 or userAction: sign_in. A transient failure of the refresh (network, timeout, 5xx, 429, account.suspended) is rethrown, so a socket keeps reconnecting and an HTTP caller sees the real cause.

problem: Problem | null
signal?: AbortSignal

applyAccessToken

applyAccessToken(response: ReauthTokenResponse | LinkTokenResponse): Promise<void>

Apply a re-authentication or link answer (05 §7.3): a new access token and, for reauth, a new authAt. The refresh token is unchanged (05 §9.2 step 4).

beginReauth

beginReauth(options: Omit<BeginReauthOptions, "clientId">, opts?: Pick<RequestOptions, "signal">): Promise<PendingAuthorization>

Start fresh authentication for this session (05 §9.2 step 2): a pushed request with intent=reauth and the current access token. Open authorizeUrl, then call completeReauth.

options: Omit<BeginReauthOptions, "clientId">
opts: Pick<RequestOptions, "signal">

Default: {}

completeReauth

completeReauth(pending: PendingAuthorization, callbackUrl: string | URL, opts?: Pick<RequestOptions, "signal">): Promise<ReauthTokenResponse | LinkTokenResponse>

Finish fresh authentication (05 §9.2 steps 4–5): redeem the code and adopt the new access token and authAt, then retry the original request. A link authorization (05 §10.3) is finished the same way.

callbackUrl: string | URL
opts: Pick<RequestOptions, "signal">

Default: {}

signOut

signOut(options?: { revocation?: string; signal?: AbortSignal }): Promise<void>

Sign out this device (05 §14, scope current): POST /v1/auth/logout, then end the session with reason signed_out. The access token is refreshed first if it has expired: the server answers 204 to an expired token as well (03 §3.2 rule 8(b)), so only a valid one makes sure the device record is really revoked (05 §12.1). The session ends locally even if the request fails (the server's expiry still applies); network errors are rethrown so the caller knows the server may not have heard. revocation is an optional DeviceRevocation for this device (07).

options: { revocation?: string; signal?: AbortSignal }

Default: {}

signOutOnPageHide

signOutOnPageHide(options?: { revocation?: string; fetch?: (url: string, init: RequestInit) => Promise<Response> }): void

The best-effort sign-out of a shared-computer web client on pagehide (05 §12.6, §22.7): sends POST /v1/auth/logout with fetch(…, {keepalive: true}) without waiting, and ends the session at once. Synchronous, so it can run inside a pagehide handler. If the request is lost, the server's 12 h shared-computer expiry still applies. It uses the current access token as it is, without refreshing; the request goes only to this session's own server (03 §3.2 rule 3).

options: { revocation?: string; fetch?: (url: string, init: RequestInit) => Promise<Response> }

Default: {}

signOutOthers

signOutOthers(opts?: Pick<RequestOptions, "signal">): Promise<LogoutOthersResponse>

Sign out every other device (05 §14, scope others). Needs fresh authentication: on auth.reauth_required run beginReauth first. Recovers once from an expired access token (03 §3.3).

opts: Pick<RequestOptions, "signal">

Default: {}

Source: auth/session.ts:148

IdentityApi class

Identity endpoints (07 §11).

class IdentityApi

constructor

new IdentityApi(http: HttpClient)

get

get(local: string, opts?: RequestOptions): Promise<IdentityResponse>

Read any account's public identity. GET /v1/users/{local}/identity (07 §11.2). No authentication. 404 identity.not_found, 410 identity.account_deleted (positive evidence, 07 §11.9), 400 address.invalid_local_part.

local: string

getIfChanged

getIfChanged(local: string, etag: string | null, opts?: RequestOptions): Promise<ConditionalIdentityResponse>

Conditional read with If-None-Match (07 §11.2: the server answers 304 when nothing changed). Returns notModified: true on 304.

local: string
etag: string | null

getVerified

getVerified(address: string, opts: Omit<VerifyIdentityStateOptions, "expectedSub"> & { purpose?: FreshnessPurpose }, reqOpts?: RequestOptions): Promise<VerifiedIdentityResponse>

Fetch an account's identity from its home server and verify it (07 §11.2, §7.4, §11.1). The state counts as validated (07 §1.4), so validated defaults to true. address is the canonical address; its local part is the path segment. The http client must be the subject's home server.

address: string
opts: Omit<VerifyIdentityStateOptions, "expectedSub"> & { purpose?: FreshnessPurpose }
reqOpts?: RequestOptions

me

me(opts?: RequestOptions): Promise<MeIdentityResponse>

The caller's own identity and this device's status. GET /v1/me/identity (07 §11.3). Clients MUST call it at every start and after every reconnect of the home event WebSocket.

enableEncryption

enableEncryption(body: EnableEncryptionRequest, opts?: RequestOptions): Promise<IdentityResponse>

Turn on encryption (first upgrade or re-upgrade). PUT /v1/me/identity (07 §11.4). Needs a provider sign-in within 24 h (403 auth.reauth_required, data.maxAgeMs 86400000), and for a user account a staged KeyBackup (409 backup.required). A replay with identical certificates answers 200.

registerDevice

registerDevice(body: RegisterDeviceRequest, opts?: RequestOptions): Promise<IdentityResponse>

Register this device's DeviceCertificate under the current identity, making it enrolled. POST /v1/me/identity/devices (07 §11.5); 201. Before calling, fetch me and check that the IdentityCertificate received by pairing or backup is byte-identical to the current idc. A byte-identical repeat answers 200, so the request is naturally idempotent.

registerDeviceChecked

registerDeviceChecked(receivedIdc: string, body: RegisterDeviceRequest, opts?: RequestOptions): Promise<IdentityResponse>

registerDevice with the check 07 §11.5 requires first: fetch me and compare the IdentityCertificate received by pairing or from the KeyBackup (receivedIdc) byte for byte with the current idc, and body.expectedIgen with the current igen. On a mismatch it throws sdk.verification_failed (data.reason identity_outdated) and registers nothing: the client MUST discard the received identity key and tell the user the pairing or recovery key belongs to an earlier setup (08, 20). The comparison needs no signature check, because the home server verifies the DeviceCertificate under its own current idc anyway.

receivedIdc: string

reset

reset(body: ResetIdentityRequest, opts?: RequestOptions): Promise<IdentityResponse>

Reset the identity (new_key) or turn encryption off (downgrade). POST /v1/me/identity/reset (07 §11.6). Takes effect at once; needs fresh authentication (600 s) or the bot token. A replay of the last generation change answers 200.

uploadRevocation

uploadRevocation(body: UploadRevocationRequest, opts?: RequestOptions): Promise<IdentityResponse>

Upload a DeviceRevocation. POST /v1/me/identity/revocations (07 §11.7). Revoking another active device needs fresh authentication; attaching a rev to an already revoked device or revoking the calling device doesn't. Repeats change nothing.

Source: api/identity.ts:114

InvitesApi class

Invites (09 §8).

class InvitesApi

constructor

new InvitesApi(http: HttpClient)

create

create(body?: CreateInviteRequest, opts?: RequestOptions): Promise<Invite>

Create an invite. POST /v1/invites (09 §8.3); needs create_invites in the target channel (or defaultChannel, or at community level). Fails with invite.not_allowed under joinPolicy: closed and invite.limit_reached at maxActiveInvites.

body: CreateInviteRequest

Default: {}

list

list(params?: ListInvitesParams, opts?: RequestOptions): Pager<Invite, CollectionPage<Invite>>

List invites, paging automatically. GET /v1/invites (09 §8.3): every invite for manage_invites holders, otherwise the caller's own.

params: ListInvitesParams

Default: {}

preview

preview(code: string, opts?: PublicReadOptions): Promise<InvitePreview>

The public preview of an invite. GET /v1/invites/{code} (09 §8.4). Needs no authentication; the code may be in any input form and is sent canonical. An invalid code throws sdk.invalid_argument without a request. A code that isn't active fails with its invite.* error. A secure statement in the preview creates a secure-state pin (09 §13.3): feed it to applyChannelStatement via channelStatementFromInvitePreview. auth defaults to 'none'; 09 §8.6 step 3 fetches it again with auth: 'session'.

code: string

get

get(code: string, opts?: PublicReadOptions): Promise<InvitePreview>

Same as preview: GET /v1/invites/{code} (09 §8.4).

code: string

revoke

revoke(code: string, opts?: RequestOptions): Promise<Invite>

Revoke an invite. DELETE /v1/invites/{code} (09 §8.3); creator or manage_invites. Resolves with the Invite in state revoked.

code: string

Source: api/invites.ts:128

KeyPackagesApi class

KeyPackage publication and claiming (13 §9). Needs a home session of an enrolled device, or a secure bot's device token.

class KeyPackagesApi

constructor

new KeyPackagesApi(http: HttpClient)

upload

upload(body: KeyPackageUpload, opts?: RequestOptions): Promise<KeyPackageStatus>

Upload up to 100 KeyPackages and optionally the last-resort KeyPackage (13 §9.2). POST /v1/me/keypackages. Errors: mls.keypackage_invalid (nothing stored), mls.keypackage_limit. Re-uploading a stored KeyPackageRef is ignored, so the call is idempotent.

status

status(opts?: RequestOptions): Promise<KeyPackageStatus>

This device's KeyPackage status (13 §9.2). GET /v1/me/keypackages.

deleteAll

deleteAll(opts?: RequestOptions): Promise<KeyPackageStatus>

Delete every KeyPackage of this device, the last-resort one included, e.g. when the MLS key store is discarded (13 §9.2). DELETE /v1/me/keypackages.

claim

claim(body: KeyPackageClaim, opts?: RequestOptions): Promise<KeyPackageClaimResult>

Claim KeyPackages through the home server, which claims locally or over S2S (13 §9.4). POST /v1/keypackages/claim. Per-target failures are statuses in results; a retry of a claim whose answer was lost MUST reuse its claimId. Each claimed KeyPackage must pass 13 §9.6 before it is added (see checkKeyPackage in ../mls/provider.ts).

Source: api/keypackages.ts:19

LeaseTracker class

The client's lease-tick stream for its current call (15 §4.4, §4.6; 16 §12.1–§12.3). Ticks from the relay, the WebSocket and the join response are processed as one stream:

  1. Keep the tick with the highest seq; ignore any whose seq isn't higher.
  2. Tick state belongs to one callId; ticks of other calls are ignored. Joining a new call starts afresh with the join response's tick.
  3. When the newest tick is 3,000 ms old or older, the next tick of the same call that arrives over the WebSocket is accepted whatever its seq.

Coverage: a sender is covered for a list while it is in that list of the newest tick and that tick is less than 3,000 ms old. When the newest tick omits a sender, it is uncovered at once.

class LeaseTracker

constructor

new LeaseTracker()

callId

get callId(): string | null

The call this tracker follows, or null.

newest

get newest(): LeaseSnapshot | null

The newest accepted tick, or null.

receivedAt

get receivedAt(): number | null

When the newest accepted tick was received (its rxAt), or null.

reset

reset(): void

Forget everything (after Leave or the end of the call).

acceptJoinTick

acceptJoinTick(tick: LeaseSnapshot, sentAt: number): TickResult

Take the tick of a join or rejoin response (15 §3.3.3, 16 §12.1 item 1). sentAt is when the first join request carrying this request's Idempotency-Key was sent, not when the response arrived. A tick for a different call than the one tracked discards all old tick state first (15 §4.4 item 2). Within the same call the usual seq rule applies.

sentAt: number

receive

receive(tick: unknown, source: TickSource, now: number): TickResult

Offer a tick received at now from the relay's sv-control channel or the event WebSocket (15 §4.4). Before any join has set the call, the first valid tick's callId is adopted.

tick: unknown
source: TickSource
now: number

age

age(now: number): number | null

Age of the newest tick at now, or null if none.

now: number

fresh

fresh(now: number): boolean

Whether the newest tick is fresh (less than 3,000 ms old) at now (15 §4.6).

now: number

covered

covered(pid: number, list: LeaseList, now: number): boolean

Whether pid is covered for list at now (15 §4.6). No tick: nobody is covered (16 §12.2 item 4).

pid: number
list: LeaseList
now: number

coveredForSource

coveredForSource(pid: number, sourceId: number, now: number): boolean

Whether pid is covered for the list that covers sourceId at now (15 §4.1, §4.6). Reserved sources (4–15) are never covered.

pid: number
sourceId: number
now: number

leaseState

leaseState(ownPid: number, now: number): LeaseState

The client's own leaseState for audio (16 §12.3).

ownPid: number
now: number

mayListen

mayListen(ownPid: number, now: number): boolean

Listening authority (16 §12.3): the client stops rendering call audio unless the newest tick is fresh and lists its own pid in listeners.

ownPid: number
now: number

expiresAt

expiresAt(): number | null

The instant at which the newest tick stops being fresh, for scheduling, or null.

Source: calls/lease.ts:109

MeApi class

The caller's account (05 §11, §16).

class MeApi

constructor

new MeApi(http: HttpClient)

get

get(opts?: RequestOptions): Promise<MeResponse>

The caller's account, its own device record and authAt (absent for bot tokens). GET /v1/me (05 §11.5). Allowed even while suspended (05 §11.4).

update

update(body: UpdateAccountRequest, opts?: RequestOptions): Promise<Account>

Change the display name (spacing and capitalization only) or about. PATCH /v1/me (05 §11.6). Answers the Account; profileVersion increases if anything changed.

setAvatar

setAvatar(image: AvatarBody, contentType: AvatarContentType, opts?: RequestOptions): Promise<Account>

Upload a new avatar as raw image bytes. PUT /v1/me/avatar (05 §11.7). The server re-encodes it and strips metadata; at most maxAvatarBytes (05 §20).

image: AvatarBody
contentType: AvatarContentType

deleteAvatar

deleteAvatar(opts?: RequestOptions): Promise<Account | undefined>

Remove the avatar. DELETE /v1/me/avatar (05 §11.7). Resolves with the Account if the server returns one, undefined for a 204.

delete

delete(confirm: string, opts?: RequestOptions): Promise<void>

Delete the account, immediately and finally (D-091). DELETE /v1/me?confirm=… (05 §16.1). confirm must be the account's canonical address exactly (account.confirmation_mismatch otherwise). Needs fresh authentication (auth.reauth_required, 05 §9); bots get bot.not_allowed. Answers 204.

confirm: string

Source: api/me.ts:38

MemoryJtiStore class

A simple in-memory JtiStore.

class MemoryJtiStore implements JtiStore

constructor

new MemoryJtiStore()

add

add(jti: string, forgetAt: number, now: number): boolean

Record jti until forgetAt (seconds). Returns false if it was already present.

jti: string
forgetAt: number
now: number

Source: calls/relay-ticket.ts:116

MemorySeqStore class

A SeqStore in memory: positions survive reconnects but not a restart (03 §7.3, §7.4).

class MemorySeqStore implements SeqStore

constructor

new MemorySeqStore(initial?: StreamPositions)

Start with initial positions, for example ones the app saved itself.

initial: StreamPositions

Default: {}

load

load(): StreamPositions

Every stored position. Read once, before the socket's first connection.

set

set(stream: StreamName, position: number): void

Record P for a stream.

stream: StreamName
position: number

delete

delete(stream: StreamName): void

Forget a stream's position (resync replaced it, or the cached state is gone).

stream: StreamName

clear

clear(): void

Forget every position: the user signed out or the account was deleted (03 §7.3 rule 5).

get

get(stream: StreamName): number | undefined

The stored position of one stream, or undefined.

stream: StreamName

Source: events/seq-store.ts:42

MemoryServerPinStore class

A ServerPinStore in memory (tests, or clients that accept first-use on every start).

class MemoryServerPinStore implements ServerPinStore

constructor

new MemoryServerPinStore()

get

get(domain: string): Promise<ServerPinRecord | null>

Read the pin for domain.

domain: string

set

set(pin: ServerPinRecord): Promise<void>

Store (replace) a pin.

delete

delete(domain: string): Promise<void>

Forget a pin; the next contact is a first use (02 §10.3).

domain: string

list

list(): Promise<ServerPinRecord[]>

Every pin.

Source: discovery/pins.ts:300

MessagesApi class

Messages and the timeline of a context (11 §4, §7). Edits, reactions and deletes are entries of their own posted to the same endpoint (11 §3.1); see also ReactionsApi.

class MessagesApi

constructor

new MessagesApi(http: HttpClient, options?: MessagingApiOptions)
options: MessagingApiOptions

Default: {}

maxMessageBytes

get maxMessageBytes(): number

The maxMessageBytes this API validates against (11 §2.3).

maxAttachmentBytes

get maxAttachmentBytes(): number

The maxAttachmentBytes this API validates against (11 §2.3).

newMid

newMid(): string

A new mid for an entry: a UUIDv7 generated when the user creates it (11 §2.4, §13.2).

post

post(ctx: string, entry: PostEntry, opts?: RequestOptions): Promise<EntryAck>

Post any PostEntry, insecure or secure, unchanged (11 §4.1). Use it to resend an outbox item's lastBody byte for byte (11 §13.4 rule 3).

ctx: string
entry: PostEntry

send

send(ctx: string, content: string | MessageContent, opts?: SendOptions): Promise<EntryAck>

Send a message in an insecure context (11 §4.3 insecure carrier). Text is turned into a MessageContent with mentions and mentionAll computed from its tokens (11 §3.4); a MessageContent is sent as given. Content is validated against 11 §3 and maxMessageBytes (JCS, 11 §3.8) first. POST /v1/contexts/{ctx}/messages.

ctx: string
content: string | MessageContent
opts: SendOptions

Default: {}

sendSealed

sendSealed(ctx: string, input: SealedEntryInput, opts?: RequestOptions): Promise<EntryAck>

Post a secure entry (11 §4.3 secure carrier): a SealedMessage built by the 14 module, with the cleartext kind, target, mention hint and attachmentIds. The SealedMessage header must match the carrier. POST /v1/contexts/{ctx}/messages.

ctx: string

secureEntry

secureEntry(params: SecureEntryParams): Promise<SealedPostEntry>

Build a secure carrier with buildSecureEntry, using this API's maxMessageBytes, maxAttachmentBytes and canonical-address check unless the params give their own (11 §2.3, §4.3). Store the result in the outbox, then send it with MessagesApi.post (11 §13.4 rule 3).

edit

edit(ctx: string, target: string, content: string | EditContent, opts?: RequestOptions & { mid?: string; previous?: MessageContent | EditContent }): Promise<EntryAck>

Edit one's own root message in an insecure context (11 §3.7.1, §6.2): an edit entry whose EditContent completely replaces the content. Pass an EditContent, or new text together with previous (the message's current content), from which replyTo is copied and the attachments are kept. POST /v1/contexts/{ctx}/messages.

ctx: string
target: string
content: string | EditContent
opts: RequestOptions & { mid?: string; previous?: MessageContent | EditContent }

Default: {}

delete

delete(ctx: string, target: string, opts?: RequestOptions & { mid?: string }): Promise<EntryAck>

Delete one's own root message, or remove one's own reaction by its entry mid, in an insecure context (11 §3.7.3, §6.3). Deleting someone else's message is a moderation action (10). A queued delete that gets message.target_deleted is done (11 §6.3). POST /v1/contexts/{ctx}/messages.

ctx: string
target: string
opts: RequestOptions & { mid?: string }

Default: {}

page

page(ctx: string, params?: MessagePageParams, opts?: RequestOptions): Promise<MessagePage>

One timeline page (11 §7.1): before, after, around, the newest page (none of them) or the changes feed (changedAfter, through, 11 §7.4). GET /v1/contexts/{ctx}/messages.

ctx: string
params: MessagePageParams

Default: {}

history

history(ctx: string, params?: { before?: number; after?: number; limit?: number }, opts?: RequestOptions): Pager<TimelineItem, MessagePage>

Walk the timeline (11 §7.1), paging automatically: newest first and backwards without parameters or with before, forwards with after. The page objects (pages(), page()) carry ranges, grants, withheldBeforeSeq and purgedThroughSeq. GET /v1/contexts/{ctx}/messages.

ctx: string
params: { before?: number; after?: number; limit?: number }

Default: {}

list

list(ctx: string, params?: { before?: number; after?: number; limit?: number }, opts?: RequestOptions): Pager<TimelineItem, MessagePage>

Same as MessagesApi.history, under the resource-API name list.

ctx: string
params: { before?: number; after?: number; limit?: number }

Default: {}

around

around(ctx: string, seq: number, opts?: RequestOptions & { limit?: number }): Promise<MessagePage>

The items around seq: up to floor(limit / 2) before it, the item at it and the rest after (11 §7.1). Used to jump to a message after get(). GET /v1/contexts/{ctx}/messages?around=.

ctx: string
seq: number
opts: RequestOptions & { limit?: number }

Default: {}

changes

changes(ctx: string, params: { changedAfter: number; through?: number; limit?: number }, opts?: RequestOptions): Pager<TimelineItem, MessagePage>

The changes feed (11 §7.4): items whose updatedSeq > changedAfter (and seq ≤ through), in ascending updatedSeq, paging with the last item's updatedSeq (a SystemItem's seq) as the next changedAfter. A 410 message.changes_expired means: discard the cache and reload (11 §7.6 step 3). GET /v1/contexts/{ctx}/messages?changedAfter=.

ctx: string
params: { changedAfter: number; through?: number; limit?: number }

get

get(ctx: string, mid: string, opts?: RequestOptions): Promise<Message>

One root message or its tombstone (11 §7.2). 404 message.target_not_found if it isn't visible, has expired or its tombstone was dropped. GET /v1/contexts/{ctx}/messages/{mid}.

ctx: string
mid: string

Source: api/messages.ts:260

MlsApi class

The MLS Delivery Service endpoints of one hosting server (13 §7).

class MlsApi

constructor

new MlsApi(http: HttpClient)

keyPackages

readonly keyPackages: KeyPackagesApi

KeyPackage endpoints (13 §9); they live on the caller's home server, so use the home server's client.

status

status(ctx: string, opts?: RequestOptions): Promise<MlsGroupStatus>

Group status: whether to join, bootstrap, catch up or resync (13 §7.2). GET /v1/contexts/{ctx}/mls.

ctx: string

groupInfo

groupInfo(ctx: string, query?: GroupInfoQuery, opts?: RequestOptions): Promise<GroupInfoResponse>

The current GroupInfo with its pending proposals (13 §7.3). GET /v1/contexts/{ctx}/mls/groupinfo. Pass intent: "join" when building an external commit (join queue, 13 §11.5); a queued joiner gets 425 mls.commit_busy with retryAfterMs. 404 mls.group_not_found in state none, 410 mls.generation_retired, 503 core.unavailable while the stored GroupInfo is stale. These problems reach the caller at once, without automatic retries (retry: 'transport'): mls.group_not_found with bootstrapAllowed means bootstrap now (13 §10.1, §16).

ctx: string
query: GroupInfoQuery

Default: {}

groupInfoIfChanged

groupInfoIfChanged(ctx: string, query?: GroupInfoQuery & { ifNoneMatch?: string }, opts?: RequestOptions): Promise<ConditionalGroupInfo>

Conditional GroupInfo fetch with If-None-Match (13 §7.3, §11.5 item 3): resolves with notModified: true on 304. The ETag covers the generation, epoch, pending proposal refs and include.

ctx: string
query: GroupInfoQuery & { ifNoneMatch?: string }

Default: {}

bootstrap

bootstrap(ctx: string, body: BootstrapRequest, opts?: RequestOptions): Promise<BootstrapResult>

Create the group of the current generation (13 §7.4). POST /v1/contexts/{ctx}/mls/bootstrap. DMs may carry the first commit in the same request. Resubmitting the byte-identical body after an unknown outcome returns the original 201 (13 §7.4 idempotency), so the SDK resends the same bytes after a network failure or timeout; every problem the server returns, retryable or not, goes to the caller's state machine at once (13 §16). Errors include 409 mls.group_exists (whose data.bootstrap says whether this device's own request won).

ctx: string

submitCommit

submitCommit(ctx: string, body: CommitSubmission, opts?: RequestOptions): Promise<CommitResult>

Submit a commit (13 §7.5). POST /v1/contexts/{ctx}/mls/commits. A resubmission of the same CommitSubmission returns the original CommitResult (13 §6.4 V2a), so the caller resubmits the same body after an unknown outcome (13 §11.2 item 4) or after mls.commit_busy (13 §11.4); mls.epoch_conflict and mls.proposals_changed need a rebuilt commit (13 §11.3). Keep the commit pending until this resolves (13 §11.2). The SDK resends the same bytes by itself only after a network failure or timeout (13 §11.2 item 4, inside the 24 h commit-hash index); every problem the server returns, including the retryable mls.commit_busy, reaches the caller.

ctx: string

handshakes

handshakes(ctx: string, query: HandshakesQuery, opts?: RequestOptions): Pager<HandshakeRecord, HandshakePage>

The handshake log from fromEpoch, in epoch order (13 §7.6). GET /v1/contexts/{ctx}/mls/handshakes. Iterating continues with fromEpoch = the last record's newEpoch while hasMore. 410 mls.log_truncated (with data.oldestEpoch) means: resync (13 §10.5).

ctx: string

proposals

proposals(ctx: string, opts?: RequestOptions): Promise<PendingProposals>

Pending server proposals of the current epoch (13 §7.7). GET /v1/contexts/{ctx}/mls/proposals.

ctx: string

epochAck

epochAck(ctx: string, body: EpochAck, opts?: RequestOptions): Promise<EpochAckResult>

Acknowledge an epoch (mls.epoch_ack, 13 §7.8, §14.2). POST /v1/contexts/{ctx}/mls/epoch-ack. 200 match or ignored, 202 pending (don't repeat it); 409 mls.fork_detected means resync (13 §15.5); 403 mls.not_member carries data.removedFor. Unknown status: match.

ctx: string
body: EpochAck

welcome

welcome(ctx: string, opts?: RequestOptions): Promise<PendingWelcome>

This device's pending Welcome (13 §7.9). GET /v1/contexts/{ctx}/mls/welcome. 404 mls.welcome_not_found when there is none.

ctx: string

report

report(ctx: string, body: MlsReport, opts?: RequestOptions): Promise<void>

Post an MlsReport (13 §7.10). POST /v1/contexts/{ctx}/mls/reports, answered 202 with no body; at most 10 per device per group per hour. detail MUST NOT contain content or keys.

ctx: string
body: MlsReport

Source: api/mls.ts:46

MlsProviderError class

An error from an MlsProvider.

class MlsProviderError extends Error

constructor

new MlsProviderError(kind: MlsProviderErrorKind, reason: string, message?: string)
reason: string
message?: string

kind

readonly kind: MlsProviderErrorKind

reason

readonly reason: string

A short machine reason for MlsReports (13 §7.10), at most 64 characters.

Source: mls/provider.ts:1282

MlsReader class

A cursor over TLS-encoded bytes (RFC 9420 §2.1). Every read throws sdk.protocol_violation past the end.

class MlsReader

constructor

new MlsReader(bytes: Uint8Array, offset?: number)
bytes: Uint8Array
offset: number

Default: 0

offset

get offset(): number

Current offset.

remaining

get remaining(): number

Bytes left.

bytes

bytes(n: number): Uint8Array

Read n raw bytes.

n: number

u8

u8(): number

uint8.

u16

u16(): number

uint16, big-endian.

u32

u32(): number

uint32, big-endian.

u64

u64(): bigint

uint64, big-endian, as a bigint.

opaqueV

opaqueV(): Uint8Array

opaque x<V>.

vectorV

vectorV<T>(item: (r: MlsReader) => T): T[]

T items<V>: a varint byte length, then items read by item until exactly that many bytes are consumed.

item: (r: MlsReader) => T

end

end(): void

Throw unless every byte was consumed.

Source: mls/provider.ts:78

ModerationApi class

Moderation actions of one community (10 §8) and its anti-spam policy (10 §12.2). Targets name people by address and messages by ID; no action reads content, so none passes through a security door (10 §8.2 rule 9).

class ModerationApi

constructor

new ModerationApi(http: HttpClient)
http: HttpClient

The community server's HTTP client.

deleteMessages

deleteMessages(body: MessageDeletionRequest, opts?: RequestOptions): Promise<MessageDeletionResult>

Delete messages by ID (ctx + 1–100 mids), or an author's recent messages (author + withinMs, optionally allChannels). POST /v1/moderation/message-deletions (10 §8.3). Messages by authors at or above the caller's top position are skipped and listed in protected. An author deletion answers more: true when it stopped at 10,000 messages; repeat it (see deleteAllMessages).

deleteAllMessages

deleteAllMessages(body: MessageDeletionRequest & { author: string; withinMs: number }, opts?: { signal?: AbortSignal }): Promise<MessageDeletionResult[]>

Delete an author's recent messages, repeating the request while the server answers more: true (10 §8.3). Each request gets its own Idempotency-Key. Resolves the results of every request, in order.

body: MessageDeletionRequest & { author: string; withinMs: number }
opts?: { signal?: AbortSignal }

kick

kick(body: KickRequest, opts?: RequestOptions): Promise<KickResult>

Kick a member: their membership becomes left (reason kicked), roles and member overwrites go, leases are revoked and MLS removal starts. POST /v1/moderation/kicks (10 §8.4). Needs kick_members.

timeout

timeout(body: TimeoutRequest, opts?: RequestOptions): Promise<Timeout>

Time a member out, or replace their timeout. durationMs 60,000 (1 min) to 2,419,200,000 (28 days); clients SHOULD offer 1 min, 10 min, 1 h, 1 day and 1 week (TIMEOUT_PRESETS_MS). POST /v1/moderation/timeouts (10 §8.5).

timeouts

timeouts(params?: { limit?: number; cursor?: string }, opts?: RequestOptions): Pager<Timeout, CollectionPage<Timeout>>

List active timeouts, paging automatically. GET /v1/moderation/timeouts (10 §8.5). Needs timeout_members.

params: { limit?: number; cursor?: string }

Default: {}

getTimeout

getTimeout(address: string, opts?: RequestOptions): Promise<Timeout>

Read one member's timeout; a member may read their own ('me'). GET /v1/moderation/timeouts/{address} (10 §8.5).

address: string

liftTimeout

liftTimeout(address: string, opts?: RequestOptions): Promise<void>

Lift a timeout early. DELETE /v1/moderation/timeouts/{address} (10 §8.5).

address: string

serverMute

serverMute(body: ServerMuteRequest, opts?: RequestOptions): Promise<ServerMute>

Server-mute a member in every voice channel of the community, or replace the mute. durationMs 60,000 to 2,419,200,000, or absent for "until lifted". POST /v1/moderation/server-mutes (10 §8.6). Needs community-level mute_members.

serverMutes

serverMutes(params?: { limit?: number; cursor?: string }, opts?: RequestOptions): Pager<ServerMute, CollectionPage<ServerMute>>

List current server mutes, paging automatically; any member may. GET /v1/moderation/server-mutes (10 §8.6).

params: { limit?: number; cursor?: string }

Default: {}

getServerMute

getServerMute(address: string, opts?: RequestOptions): Promise<ServerMute>

Read one member's server mute. GET /v1/moderation/server-mutes/{address} (10 §8.6).

address: string

liftServerMute

liftServerMute(address: string, opts?: RequestOptions): Promise<void>

Lift a server mute. DELETE /v1/moderation/server-mutes/{address} (10 §8.6).

address: string

member

member(address: string, opts?: RequestOptions): Promise<ModerationStatus>

What a moderator needs to know about one member, filtered by the caller's permissions. GET /v1/moderation/members/{address} (10 §8.9).

address: string

policy

policy(opts?: RequestOptions): Promise<AntiSpamPolicy>

The community's anti-spam policy, filtered for the caller. GET /v1/moderation/policy (10 §12.2).

updatePolicy

updatePolicy(patch: AntiSpamPolicyPatch, opts?: RequestOptions): Promise<AntiSpamPolicy>

Change the anti-spam policy with a JSON Merge Patch: nested objects merge, null deletes a member (it takes its default again), e.g. { slowMode: { 'ch:…': null } }. Optional ifVersion (409 moderation.version_conflict). PATCH /v1/moderation/policy (10 §12.2). Needs manage_community. The patch is checked with checkPolicyPatch first.

Source: api/moderation.ts:90

MyCommunitiesApi class

The community list (09 §5.1). Home session only (bots MAY use it). The home server maintains the local: true entry; the client maintains every other one. Every change emits community.list_changed on the account stream.

class MyCommunitiesApi

constructor

new MyCommunitiesApi(http: HttpClient)

list

list(opts?: RequestOptions): Pager<CommunityListEntry, CollectionPage<CommunityListEntry>>

The whole list, ordered by position. GET /v1/me/communities (09 §5.1).

put

put(domain: string, entry: PutCommunityListEntryRequest, opts?: RequestOptions): Promise<CommunityListEntry>

Add or update an entry. PUT /v1/me/communities/{domain} (09 §5.1); domain must be canonical. Fails with core.invalid_request for the home server's own entry and community.list_full at maxCommunitiesPerAccount.

domain: string

remove

remove(domain: string, opts?: RequestOptions): Promise<void>

Remove an entry. DELETE /v1/me/communities/{domain} (09 §5.1); 204. A client MUST do this after leaving, member.removed or member.rejected.

domain: string

reorder

reorder(order: readonly string[], opts?: RequestOptions): Promise<CollectionPage<CommunityListEntry>>

Reorder the list. PATCH /v1/me/communities with { "order": [...] } listing every domain once (09 §5.1). Resolves with the list.

order: readonly string[]

Source: api/my-communities.ts:65

NotificationsApi class

Notification settings and records at the account's home server (19 §7, §8), and the event-ticket endpoint every server serves in its hosting role (19 §8.6).

Settings and records exist only at the home server: a remote session gets 403 push.home_only and a bot token 403 core.forbidden (19 §7, §8.3, §9.5). Every settings change emits notification.settings_changed on me (19 §7).

class NotificationsApi

constructor

new NotificationsApi(http: HttpClient)

http is the home server's client (or, for NotificationsApi.fetchEvents, any client).

getSettings

getSettings(opts?: RequestOptions): Promise<NotificationSettings>

The account's global NotificationSettings. GET /v1/me/notifications/settings (19 §7.1).

updateSettings

updateSettings(body: PutNotificationSettingsRequest, opts?: RequestOptions): Promise<NotificationSettings>

Replace the global settings: every writable member is required, ifVersion optional (409 core.conflict when it differs). A level outside its allowed set is 400 notification.level_unsupported. PUT /v1/me/notifications/settings (19 §7.1).

listCommunitySettings

listCommunitySettings(params?: { cursor?: string; limit?: number }, opts?: RequestOptions): Pager<CommunityNotificationSettings, CollectionPage<CommunityNotificationSettings>>

List per-community entries, paging automatically. GET /v1/me/notifications/settings/communities (19 §7.2).

params: { cursor?: string; limit?: number }

Default: {}

getCommunitySettings

getCommunitySettings(host: string, opts?: RequestOptions): Promise<CommunityNotificationSettings>

One community's settings; the defaults (level: "default", others null) with 200 when there is no entry. host is the canonical domain from that server's ServerMetadata. GET /v1/me/notifications/settings/communities/{host} (19 §7.2).

host: string

updateCommunitySettings

updateCommunitySettings(host: string, body: PutCommunityNotificationSettingsRequest, opts?: RequestOptions): Promise<CommunityNotificationSettings>

Set one community's settings (at most 1,000 entries; muteUntil at most 366 days ahead). PUT /v1/me/notifications/settings/communities/{host} (19 §7.2).

host: string

deleteCommunitySettings

deleteCommunitySettings(host: string, opts?: RequestOptions): Promise<void>

Restore one community's defaults (204). DELETE /v1/me/notifications/settings/communities/{host} (19 §7.2).

host: string

getContextSettings

getContextSettings(ctx: CtxRef, query?: ContextSettingsQuery, opts?: RequestOptions): Promise<ContextNotificationSettings>

One context's settings, served by the home server for contexts on any host; the defaults with 200 when there is no entry. GET /v1/contexts/{ctx}/notification-settings?host= (19 §7.3).

ctx: CtxRef
query: ContextSettingsQuery

Default: {}

updateContextSettings

updateContextSettings(ctx: CtxRef, body: PutContextNotificationSettingsRequest, query?: ContextSettingsQuery, opts?: RequestOptions): Promise<ContextNotificationSettings>

Set one context's settings. level: "all" is allowed only for dm: and gdm: contexts, and calls MUST be null for channels (19 §7.3): the SDK refuses both for a ch: context with sdk.invalid_argument before sending (the server would answer 400 notification.level_unsupported and 400 core.invalid_request). PUT /v1/contexts/{ctx}/notification-settings?host= (19 §7.3).

ctx: CtxRef
query: ContextSettingsQuery

Default: {}

deleteContextSettings

deleteContextSettings(ctx: CtxRef, query?: ContextSettingsQuery, opts?: RequestOptions): Promise<void>

Restore one context's defaults (204). DELETE /v1/contexts/{ctx}/notification-settings?host= (19 §7.3).

ctx: CtxRef
query: ContextSettingsQuery

Default: {}

listContextSettings

listContextSettings(params?: { host?: string; cursor?: string; limit?: number }, opts?: RequestOptions): Pager<ContextNotificationSettings, CollectionPage<ContextNotificationSettings>>

List per-context entries (optionally for one host), paging automatically; used to show muted icons in the context list (19 §7.4). GET /v1/me/notifications/settings/contexts (19 §7.3).

params: { host?: string; cursor?: string; limit?: number }

Default: {}

list

list(params?: ListNotificationsParams, opts?: RequestOptions): Pager<NotificationRecord, NotificationListPage>

Records visible to the calling device, newest createdAt first, paging automatically; each page carries the device's badge. Default state is unread. ctx requires host. GET /v1/me/notifications (19 §8.3). For reconciliation (19 §8.5) iterate up to 1,000 records.

params: ListNotificationsParams

Default: {}

get

get(id: string, opts?: FetchTokenRequestOptions): Promise<NotificationFetchResponse>

One record with the device's badge and the user's previews setting. Accepts a home session or, from a notification extension, a fetch token (opts.fetchToken). 404 core.not_found for a missing, deleted or other-device record. GET /v1/me/notifications/{id} (19 §8.3, §13.1 D4).

id: string

markRead

markRead(body: MarkNotificationsReadRequest, opts?: FetchTokenRequestOptions): Promise<MarkNotificationsReadResponse>

Change record states to read (default) or dismissed with exactly one selector: ids (1–100), host+ctx[+throughSeq], or all: true. With a fetch token only ids is allowed. IDs that don't exist or aren't unread are skipped. POST /v1/me/notifications/read (19 §8.3, §15.2). Clients send the read-through at most once per context every 2 s, plus once when the user leaves the context (19 §15.2).

fetchEvents

fetchEvents(ticket: string, opts?: FetchEventsOptions): Promise<NotifiedEventsResponse>

Fetch the events an event ticket names from the hosting server, in their current form, with the recipient's readSeq. Authenticated only by the ticket; every failure is 401 notify.ticket_invalid (never a sign-out), 403 notify.access_ended when access ended, 429 core.rate_limited over 30 uses a minute. GET {host}/v1/me/notifications/events (19 §8.6, §13.1 D8). In a secure context the items carry SealedMessages only.

ticket: string
opts: FetchEventsOptions

Default: {}

Source: api/notifications.ts:148

PairingApi class

Pairing endpoints (08 §6.4). Home session of a secure user account only; bots get pairing.unsupported_client.

class PairingApi

constructor

new PairingApi(http: HttpClient)

create

create(body?: CreatePairingRequest, opts?: RequestOptions): Promise<PairingSession>

Create a session (201). POST /v1/me/pairing (08 §6.4.1). Supersedes the caller's other open session; prompts enrolled devices when the caller is the new device. pairing.role_mismatch for an enrolled creator asking for displayer: "new_device"; 429 with data.policy pairing.create or pairing.open.

body: CreatePairingRequest

Default: {}

list

list(opts?: RequestOptions): Promise<PairingSessionList>

Open sessions this device may join or takes part in (at most 3). GET /v1/me/pairing (08 §6.4.2). Call at start and on reconnect.

get

get(id: string, opts?: RequestOptions): Promise<PairingSession>

Read one session. GET /v1/me/pairing/{id} (08 §6.4.2).

id: string

join

join(id: string, opts?: RequestOptions): Promise<PairingSession>

Take the missing role. POST /v1/me/pairing/{id}/join (08 §6.4.3). Errors: pairing.expired, pairing.already_joined, pairing.ended, pairing.role_mismatch, pairing.not_found.

id: string

send

send(id: string, message: PairingMessageRequest, opts?: RequestOptions): Promise<PairingMessageAccepted>

Send one protocol message (202 { n }). POST /v1/me/pairing/{id}/messages (08 §6.4.4). A byte-identical repeat of the caller's latest message is answered with the original n, so the request is retried with exactly the same body; don't send the next message before a 202. A message not allowed in the current state fails the session (pairing.out_of_order).

id: string

messages

messages(id: string, after?: number, opts?: RequestOptions): Promise<PairingMessageList>

Messages addressed to this device with index above after (08 §6.4.4). Poll at most once per second while the WebSocket is down.

id: string
after: number

Default: 0

cancel

cancel(id: string, reason: "denied" | "cancelled", opts?: RequestOptions): Promise<PairingSession>

Cancel (cancelled, a participant, any non-terminal state) or deny (denied, a prompted enrolled device while waiting). POST /v1/me/pairing/{id}/cancel (08 §6.4.5). Cancelling a terminal session answers 200 unchanged.

id: string
reason: "denied" | "cancelled"

Source: api/pairing.ts:672

PairingDisplayCredentials class

The displayer's pairing credentials for one session (08 §6.3): a fresh 16-byte QR secret and a fresh 6-digit code, shown together and never sent to the home server. They allow exactly one CPace run (08 §6.9, 04 §11.7): CpaceResponder.respond consumes them, after which they are erased and every accessor throws. discard erases them when the session ends first.

class PairingDisplayCredentials

used

get used(): boolean

Whether the credentials were used or discarded.

code

get code(): string

The 6-digit code to show (formatPairingCode gives the display form).

generate

static generate(random?: RandomSource): PairingDisplayCredentials

Draw a new secret and code for a session (08 §6.3, §6.3.2).

random: RandomSource

Default: cryptoRandomBytes

qr

qr(session: { pairingId: string; displayer: PairingRole; addr: string }): string

The QR text for this session (08 §6.3.1).

session: { pairingId: string; displayer: PairingRole; addr: string }

consume

consume(): { secret: Uint8Array; code: string }

Hand out the credentials for the session's single CPace run and erase them (08 §6.9). Throws on a second call.

discard

discard(): void

Erase the credentials (the session ended, 08 §6.3).

Source: api/pairing.ts:174

PresenceApi class

One's own presence on one server (11 §11.2).

class PresenceApi

constructor

new PresenceApi(http: HttpClient, options?: { clock?: Clock })

clock is used for the 30-day bound on clearAt (11 §11.2). Default: the device clock.

options: { clock?: Clock }

Default: {}

get

get(opts?: RequestOptions): Promise<OwnPresence>

The chosen status, custom status, this session's idle flag and the effective status. GET /v1/me/presence (11 §11.2).

update

update(body: OwnPresenceUpdate, opts?: RequestOptions): Promise<OwnPresence>

Update presence with a raw body (11 §11.2), checked by checkPresenceUpdate. At most 10 per session per minute. PUT /v1/me/presence.

setStatus

setStatus(status: PresenceStatusUpdate, opts?: RequestOptions): Promise<OwnPresence>

Set the account-level status: all four members together, last write wins (11 §11.2). Copies to other servers omit idle (11 §11.6 rule 2). PUT /v1/me/presence.

setIdle

setIdle(idle: boolean, opts?: RequestOptions): Promise<OwnPresence>

Set only this session's idle flag (11 §11.2, §11.6 rule 1), never the account-level members. PUT /v1/me/presence.

idle: boolean

Source: api/presence.ts:60

ProfilesApi class

Public profiles (05 §17).

class ProfilesApi

constructor

new ProfilesApi(http: HttpClient)

get

get(local: string, opts?: RequestOptions): Promise<PublicProfile>

The public profile of a local part at this server. GET /v1/users/{local}/profile (05 §17.1). local is percent-encoded as UTF-8. Errors: 400 address.invalid_local_part, 404 core.not_found, 410 account.deleted.

local: string

getIfChanged

getIfChanged(local: string, etag: string | null, opts?: RequestOptions): Promise<ConditionalProfile>

Revalidate a cached profile with If-None-Match (05 §17.1, §17.3). The ETag is "<profileVersion>"; pass the one received earlier. Key the cache on (address, inc) too: a re-registered address restarts profileVersion at 1 (05 §11.1, §22.8).

local: string
etag: string | null

avatarUrl

avatarUrl(local: string, v?: number): string

The URL of a profile's avatar, {base}/v1/users/{local}/profile/avatar?v=… (05 §11.1, §17.2). With v equal to the current profileVersion it is cached immutably.

local: string
v?: number

avatar

avatar(local: string, params?: { v?: number }, opts?: RequestOptions): Promise<AvatarImage>

Download a profile's avatar image. GET /v1/users/{local}/profile/avatar (05 §17.2). No avatar: 404 core.not_found. Callers should compare the bytes with the Avatar's sha256 and must treat them as untrusted input.

local: string
params: { v?: number }

Default: {}

Source: api/profiles.ts:25

ProvidersApi class

Linked providers (05 §10).

class ProvidersApi

constructor

new ProvidersApi(http: HttpClient)

list

list(opts?: RequestOptions): Pager<ProviderLink, CollectionPage<ProviderLink>>

The account's ProviderLinks, ordered by linkedAt. GET /v1/me/providers (05 §10.2).

Source: api/providers.ts:22

PushApi class

Push registrations of the calling device (19 §9). These endpoints exist only at the account's home server: a remote session gets 403 push.home_only (19 §9.5), and bot or shared-computer devices get 403 push.device_not_eligible (19 §9.2 check 1). Push keys, fetch tokens and registration IDs MUST NOT be sent to any server other than the home server and the gateway.

class PushApi

constructor

new PushApi(http: HttpClient)

http is the home server's client.

create

create(body: CreatePushRegistrationRequest, opts?: RequestOptions): Promise<PushRegistration>

Create a registration, or update the device's registration with the same transport and pushKey (or webPush.endpoint), and get a fresh fetch token. POST /v1/me/push-registrations (19 §9.2). The response carries fetchToken; store it, the id and the home base URL in the storage the notification extension reads (19 §9.4, §13.2). A client that doesn't know its registration IDs MUST call PushApi.list first and update instead of creating (19 §9.2).

list

list(opts?: RequestOptions): Pager<PushRegistration, CollectionPage<PushRegistration>>

The calling device's registrations. GET /v1/me/push-registrations (19 §9.2). The server answers one page (nextCursor: null); the pager handles a cursor if one ever appears.

get

get(id: string, opts?: RequestOptions): Promise<PushRegistration>

One registration; 404 core.not_found if it belongs to another device. GET /v1/me/push-registrations/{id} (19 §9.2).

id: string

update

update(id: string, body: UpdatePushRegistrationRequest, opts?: RequestOptions): Promise<PushRegistration>

Replace types and the transport data; transport and gatewayUrl can't change. PUT /v1/me/push-registrations/{id} (19 §9.2). Set rotateFetchToken: true for the periodic re-registration (at least every 30 days, 19 §9.4) and after the extension found its fetch token refused (19 §9.3); the response then carries the new fetchToken.

id: string

delete

delete(id: string, opts?: RequestOptions): Promise<void>

Delete a registration and its fetch token; 204 also when it doesn't exist. DELETE /v1/me/push-registrations/{id} (19 §9.2). Clients SHOULD do this when the user turns notifications off in the operating system (19 §9.4).

id: string

test

test(id: string, opts?: RequestOptions): Promise<PushTestResponse>

Send a test push to this registration only, ignoring every setting: 202 with the test record's ID. At most 5 per registration per hour (core.rate_limited); wait up to 30 s for the push (19 §9.2). POST /v1/me/push-registrations/{id}/test.

id: string

registerWithGateway

registerWithGateway(gatewayUrl: string, body: GatewayRegisterRequest, opts?: RequestOptions): Promise<GatewayRegisterResponse>

Seal a platform token at the app's own gateway and get a push key bound to home. POST {gatewayUrl}/v1/register (19 §11.2). Unauthenticated: no credential is sent. Call it once per account (each home) and, on iOS, once per platform (apns, apns_voip). Platform tokens are app secrets: send them only to the app's own gateway and never log them (19 §11.2). Errors: 400 core.invalid_request, push.app_unknown, push.platform_unsupported; 429 core.rate_limited; 403 core.forbidden when the gateway requires app attestation.

gatewayUrl: string

Source: api/push.ts:140

ReactionsApi class

Reactions on root messages (11 §6.5, §7.3).

class ReactionsApi

constructor

new ReactionsApi(http: HttpClient, options?: Pick<MessagingApiOptions, "newMid">)
options: Pick<MessagingApiOptions, "newMid">

Default: {}

add

add(ctx: string, target: string, key: string, opts?: RequestOptions & { mid?: string }): Promise<EntryAck>

Add a reaction in an insecure context (11 §3.7.2, §6.5): a reaction entry with a ReactionContent. The key must be one emoji within 64 bytes. A queued reaction that gets 409 reaction.already_exists is done, and data.mid names the existing entry (11 §6.5). Secure contexts post a sealed reaction through MessagesApi.sendSealed. POST /v1/contexts/{ctx}/messages.

ctx: string
target: string
key: string
opts: RequestOptions & { mid?: string }

Default: {}

remove

remove(ctx: string, reactionMid: string, opts?: RequestOptions & { mid?: string }): Promise<EntryAck>

Remove one's own reaction (11 §6.5): a delete entry whose target is the reaction entry's mid (not the message's). Always allowed with access to the context. POST /v1/contexts/{ctx}/messages.

ctx: string
reactionMid: string
opts: RequestOptions & { mid?: string }

Default: {}

list

list(ctx: string, mid: string, params?: { key?: string; limit?: number }, opts?: RequestOptions): Pager<ReactionEntry, CollectionPage<ReactionEntry>>

The reaction entries of a root message, oldest first, paging by cursor (11 §7.3). With key (compared after removing U+FE0F), only plain entries are returned. Without it, this fetches sealed entries beyond the 100 inlined in the Message. GET /v1/contexts/{ctx}/messages/{mid}/reactions.

ctx: string
mid: string
params: { key?: string; limit?: number }

Default: {}

Source: api/reactions.ts:18

ReadMarker class

Client-side read-position reporting (11 §9.3 rule 1): advances readSeq to the newest root message seen in a focused window at most once every 2 s per context, and once more when the user leaves the context. Errors from the server are passed to onError and never thrown from seen().

class ReadMarker

constructor

new ReadMarker(api: ReadStateApi, ctx: string, opts?: { clock?: Clock; timers?: Timers; initialReadSeq?: number; onError?: (e: unknown) => void })
ctx: string
opts: { clock?: Clock; timers?: Timers; initialReadSeq?: number; onError?: (e: unknown) => void }

Default: {}

seen

seen(seq: number): void

Report that the root message at seq has been on screen in a focused window.

seq: number

leave

leave(): Promise<void>

The user left the context: send any pending position now.

Source: api/read-state.ts:82

ReadStateApi class

Read positions (11 §9).

class ReadStateApi

constructor

new ReadStateApi(http: HttpClient)

get

get(ctx: string, opts?: RequestOptions): Promise<ReadState>

The caller's ReadState for one context. GET /v1/contexts/{ctx}/read (11 §9.2).

ctx: string

update

update(ctx: string, body: ReadStateUpdate, opts?: RequestOptions): Promise<ReadState>

Set the read position (11 §9.2). Without markUnread the stored value becomes max(old, readSeq); values above headSeq are lowered to it. Returns the new ReadState; the server emits read.updated when it changed. PUT /v1/contexts/{ctx}/read.

ctx: string

markRead

markRead(ctx: string, readSeq: number, opts?: RequestOptions): Promise<ReadState>

Advance the read position to readSeq (never backwards) (11 §9.2). PUT /v1/contexts/{ctx}/read.

ctx: string
readSeq: number

markUnread

markUnread(ctx: string, readSeq: number, opts?: RequestOptions): Promise<ReadState>

"Mark as unread": set the read position to readSeq even if lower (11 §9.2). PUT /v1/contexts/{ctx}/read.

ctx: string
readSeq: number

list

list(params?: { limit?: number }, opts?: RequestOptions): Pager<ReadState, CollectionPage<ReadState>>

Every ReadState of the caller on this server, for every context it can currently see, ordered by ctx (11 §9.2). limit is 1 to 1,000 (default 200). Call it at start-up and after a resync of the me stream. GET /v1/me/read-states.

params: { limit?: number }

Default: {}

Source: api/read-state.ts:20

ReconnectBackoff class

The reconnect counter and delays of 03 §5.11, for one server and account.

  • Retry n waits uniformly in [0, min(30 s, 1 s × 2^n)], never less than the minimum the close code or retryAfterMs sets (item 1).
  • n resets only when a socket has stayed ready for 60 s — not at session.ready itself (item 2): call markReady and markClosed.
  • When the network comes back or the app returns to the foreground, the client reconnects at once, counting as n = 0, at most once per 5 s (item 3): call wake.
class ReconnectBackoff

constructor

new ReconnectBackoff(options?: ReconnectBackoffOptions)
options: ReconnectBackoffOptions

Default: {}

attempt

get attempt(): number

The current retry number n.

reset

reset(): void

Reset n to 0 (for example after the user signs in again).

markReady

markReady(): void

The socket reached ready now. Does not reset n (03 §5.11 item 2).

markClosed

markClosed(): void

The socket closed now: resets n if it had stayed ready for 60 s (03 §5.11 item 2).

wake

wake(): boolean

The network came back or the app returned to the foreground. Returns true if the client should reconnect at once (counting as n = 0), false if a wake reconnect already happened within the last 5 s (03 §5.11 item 3).

next

next(minDelayMs?: number): number

The next backoff delay: uniform in [0, bound(n)], raised to minDelayMs; then n increases (03 §5.11 item 1).

minDelayMs: number

Default: 0

delayFor

delayFor(plan: ReconnectPlan): number

The delay for a ReconnectPlan (only meaningful for the reconnecting actions).

Source: core/backoff.ts:155

RelayLiveness class

The client's relay keepalive and failure detector (15 §6.7). Pure: feed it events with times from your monotonic clock, call check (for example from a 100 ms timer), and send a relay.ping whenever pingDue says so.

The connection fails at the first instant at which any of these holds: 5,000 ms or more since the last control-channel message of any type; ICE failed; ICE disconnected for 5,000 ms or more; the DTLS or SCTP transport closed. An ICE recovery cancels only the disconnected condition, never the control-silence one. Once failed, it stays failed and later messages are ignored.

class RelayLiveness

constructor

new RelayLiveness(now: number)

Start watching at now, normally when the sv-control channel opens.

now: number

failed

get failed(): RelayFailureCause | null

Why the connection failed, or null while it hasn't.

messageReceived

messageReceived(now: number): void

Record a control-channel message (of any type) processed at now. A message at or after the failure instant is too late.

now: number

iceStateChanged

iceStateChanged(state: IceConnectionState, now: number): void

Record an ICE connection state change at now.

now: number

transportClosed

transportClosed(): void

The DTLS or SCTP transport (or the sv-control channel) closed.

check

check(now: number): RelayFailureCause | null

Evaluate the time-based conditions at now; returns the failure cause, or null.

now: number

pingDue

pingDue(now: number): { n: number } | null

If a relay.ping is due at now (every 5 s), returns its payload with an incrementing n and schedules the next one; otherwise null.

now: number

nextDeadline

nextDeadline(): number | null

The next instant at which check or pingDue can change its answer, for scheduling a timer.

Source: calls/relay.ts:268

RemoteSessionProvider class

A TokenProvider of kind remote for one remote server (06 §6, §6.10). It creates the session lazily on the first token() call, renews it silently at a random moment between expiresAt − 600 s and expiresAt − 300 s with a fresh HomeAssertion (and DeviceProof for an enrolled device), notifies onChange listeners so sockets can send session.reauth (03 §5.13), retries the home server every 60 s when it is down and then asks for an extension, and follows the error table of 06 §6.10 rule 7. Never more than one creation request is in flight.

Recovery (03 §3.3, "Remote session" column): after a 401 the provider creates a new session silently and the request is retried once. It never asks for sign-in itself: if the home server can't issue an assertion its error is thrown from recover() instead, so the caller sees the home server's core.unauthenticated (userAction: sign_in) only when the home session is really gone.

class RemoteSessionProvider implements TokenProvider

constructor

new RemoteSessionProvider(opts: RemoteSessionProviderOptions)

scheme

readonly scheme: "Bearer"

Remote session tokens are sent as Bearer (06 §6.4).

kind

readonly kind: "remote"

Recovery follows the remote-session column of 03 §3.3.

status

get status(): RemoteSessionStatus

The current status for status lines (06 §15).

lastError

get lastError(): unknown

The last error of any step, or null. Never show its code to users (06 §15).

audience

get audience(): string

The remote server's canonical domain this provider targets.

session

get session(): RemoteSession | null

The current session without its token, or null.

closed

get closed(): boolean

Whether close was called (and not undone by reset).

token

token(signal?: AbortSignal): Promise<string>

The current remote session token, creating the session first if there is none or it has expired (06 §6.10 rule 1). If a renewal is due it is started in the background and the still-valid token is returned.

signal?: AbortSignal

expiresAt

expiresAt(): Date | null

The current session's expiresAt, or null without a session.

recover

recover(problem: Problem | null, signal?: AbortSignal): Promise<boolean>

Recover after a 401 from the remote server (03 §3.3, 06 §6.10 rule 7):

  • federation.session_ended: follow data.retry; with retry: true create a new session silently (at most 3 times per 10 minutes, after which the error is thrown until the window allows another); otherwise resolve false so the caller gets the error, and stop creating sessions;
  • core.token_expired and other 401s: create a new session silently;
  • a sign-in answer (core.unauthenticated, userAction: sign_in, or a 401 without a problem): create a new session silently at most once per 60 s per server (03 §10.2 scope rule 2). Within that window the server is treated as unavailable: the session is kept and a retryable core.unavailable error with userAction: 'wait' is thrown, never the remote server's sign_in.

Resolves true when a new session is ready. If it can't be created, the underlying error is thrown (for example the home server's core.unauthenticated when the home session is gone, or federation.blocked), never the remote server's 401.

problem: Problem | null
signal?: AbortSignal

onChange

onChange(listener: (token: string) => void): () => void

Subscribe to new tokens (after creation and every renewal) to send session.reauth (03 §5.13, 06 §6.4).

listener: (token: string) => void

ensure

ensure(signal?: AbortSignal): Promise<RemoteSession>

Create the session if needed and return it (without token).

signal?: AbortSignal

renew

renew(signal?: AbortSignal): Promise<RemoteSession>

Renew now with a fresh assertion, whatever the schedule: call it when the device becomes enrolled, so the session gains secure access (06 §6.10 rule 6).

signal?: AbortSignal

extend

extend(signal?: AbortSignal): Promise<RemoteSession>

Ask the remote server to extend the session because the home server is unreachable. POST …/sessions/current/extend (06 §6.6). The token doesn't change. The provider calls this itself after failed renewals (06 §6.10 rule 5); errors are thrown as received.

signal?: AbortSignal

refresh

refresh(signal?: AbortSignal): Promise<RemoteSession>

Re-read the session (GET …/sessions/current, 06 §6.5), for example after a restart, and update state and expiresAt.

signal?: AbortSignal

signOut

signOut(signal?: AbortSignal): Promise<void>

End the session at the remote server (DELETE …/sessions/current, reason signed_out, 06 §6.5) and stop creating new ones until reset. Call it on every remote server when the user signs out of the device. A session that already expired or ended counts as signed out.

signal?: AbortSignal

handleSessionEnded

handleSessionEnded(event: SessionEndedPayload): void

Act on a federation.session_ended event from this server's WebSocket (06 §6.8). Events for another session are ignored. With retry: true a new session is created silently (at most 3 times per 10 minutes per server); otherwise the provider stops until reset.

reset

reset(): void

Clear a stop (blocked, stopped, ended) and back-off, for example after the user signs in again.

close

close(): void

Stop all background timers. The provider still works on demand.

Source: auth/remote.ts:1254

ReportsApi class

Reports (10 §10). Filing goes to the hosting server, except the two cases of 10 §10.10 (an unaccepted message request, and a DM hosted on the target's own home server), which go to the reporter's home server: use the ReportsApi of that server for them.

The evidence endpoints GET /v1/reports/{reportId}/evidence/{mid}… (10 §10.8, §10.9) are server-to-server only, authorized by a request-bound S2S token (06 §8.1): they are typed in S2S_ENDPOINTS (wire/federation.ts) and not callable here.

class ReportsApi

constructor

new ReportsApi(http: HttpClient)
http: HttpClient

The server's HTTP client.

file

file(body: FileReportRequest, opts?: RequestOptions): Promise<ReporterView>

File a report. POST /v1/reports (10 §10.3, §10.4). Answers 201 with the reporter view. Before sending, the client MUST show the disclosure line of 10 §10.11. A secure context's items carry kMsg (and fileKey per attachment of a reported item); never send copies of insecure messages.

The request carries an Idempotency-Key, which servers MUST honour on every client endpoint (03 §14.2 item 1), so a retry after a lost response returns the stored 201 rather than 409 report.duplicate. The key is generated unless opts.idempotencyKey is given; reuse your own key to resend the same report later. A different attempt at the same report still answers 409 report.duplicate with data.reportId (10 §10.4 step 3).

queue

queue(params?: ReportListParams, opts?: RequestOptions): Pager<Report, CollectionPage<Report>>

The report queue: reports the caller can see, oldest open first, paging automatically; filter by status, ctx, target, category, origin, assignee. GET /v1/reports (10 §10.8). Needs manage_reports or admin.

params: ReportListParams

Default: {}

mine

mine(params?: { limit?: number; cursor?: string }, opts?: RequestOptions): Pager<ReporterView, CollectionPage<ReporterView>>

The caller's own reports, reporter view, newest first. GET /v1/reports?mine=true (10 §10.8).

params: { limit?: number; cursor?: string }

Default: {}

get

get(id: string, opts?: RequestOptions): Promise<Report | ReporterView>

One report: the moderator view (evidence from a secure context only on a secure account's enrolled device, otherwise withheld), or the reporter view for its reporter. GET /v1/reports/{id} (10 §10.8).

id: string

update

update(id: string, body: UpdateReportRequest, opts?: RequestOptions): Promise<Report>

Change status, resolution, resolutionNote, assignee and (admins) preserveEvidence, optionally conditional on ifVersion (409 report.version_conflict). Invalid transitions fail with report.status_conflict. PATCH /v1/reports/{id} (10 §10.6, §10.8).

id: string

claim

claim(id: string, ifVersion?: number, opts?: RequestOptions): Promise<Report>

Claim an open report (status: "in_review") (10 §10.6).

id: string
ifVersion?: number

reopen

reopen(id: string, ifVersion?: number, opts?: RequestOptions): Promise<Report>

Unclaim an in_review report, or (admins, within 30 days) reopen a resolved one (status: "open") (10 §10.6).

id: string
ifVersion?: number

resolve

resolve(id: string, resolution: NonNullable<"duplicate" | "action_taken" | "no_action" | "invalid" | undefined>, extra?: { resolutionNote?: string; ifVersion?: number }, opts?: RequestOptions): Promise<Report>

Resolve an open or in_review report (10 §10.6).

id: string
resolution: NonNullable<"duplicate" | "action_taken" | "no_action" | "invalid" | undefined>
extra: { resolutionNote?: string; ifVersion?: number }

Default: {}

withdraw

withdraw(id: string, opts?: RequestOptions): Promise<void>

Withdraw one's own open report with no linked actions. DELETE /v1/reports/{id} (10 §10.6, §10.8).

id: string

attachment

attachment(id: string, attachmentId: string, opts?: RequestOptions): Promise<Response>

Download an evidence attachment blob, as stored (encrypted in secure contexts: decrypt it with the item's fileKey, 11). Resolves the raw Response so the body can be streamed. GET /v1/reports/{id}/attachments/{attachmentId} (10 §10.8).

id: string
attachmentId: string

forward

forward(id: string, opts?: RequestOptions): Promise<ForwardReportResponse>

Forward a report to the target's home server. Admins only; refused with 403 report.not_forwardable (data.reason) unless every condition of 10 §10.9 holds. POST /v1/reports/{id}/forward with an empty body (202, 10 §10.8). Carries an Idempotency-Key (03 §14.2), generated unless opts.idempotencyKey is given, so a retry doesn't fail with already_forwarded.

id: string

Source: api/reports.ts:78

ResolveApi class

The resolver endpoints of a server (02 §6, §10.5).

class ResolveApi

constructor

new ResolveApi(http: HttpClient)

resolve

resolve(domain: string, opts?: PublicReadOptions): Promise<ResolveResult>

Resolve a domain through this server's resolver, including its pin state. GET /v1/resolve?domain=… (02 §6). domain may be an A-label or U-label (the server converts it per 01). Failures are discovery.* errors (02 §6.4), core.invalid_request or core.rate_limited. Web clients use it for every resolution (02 §5.4); any client uses it for no-contact flows (02 §5.8) and pin recovery (02 §10.6).

domain: string
opts: PublicReadOptions

Default: {}

listPins

listPins(params?: ListPinsParams, opts?: RequestOptions): Pager<PeerPin, CollectionPage<PeerPin>>

List pins, optionally by state, paging automatically. GET /v1/resolve/pins (02 §10.5). Requires a home session of an account with the admin system role (else 403 core.forbidden).

params: ListPinsParams

Default: {}

getPin

getPin(domain: string, opts?: RequestOptions): Promise<PeerPin>

Read one pin. GET /v1/resolve/pins/{domain} (02 §10.5); 404 core.not_found if there is none. Admin only.

domain: string

acceptPin

acceptPin(domain: string, body: AcceptPinRequest, opts?: RequestOptions): Promise<PeerPin>

Accept the observed result of a suspended pin. POST /v1/resolve/pins/{domain}/accept (02 §10.5). The body must equal the pin's observed values (compare-and-set); 409 core.conflict if the pin isn't suspended, the body doesn't match, or the reason is key_unrevoked or secure_downgrade. Admin only.

domain: string

acceptBodyFor

static acceptBodyFor(pin: PeerPin): AcceptPinRequest

The compare-and-set body for acceptPin built from a suspended pin's observed values (02 §10.5), so the admin accepts exactly what they reviewed.

pin: PeerPin

deletePin

deletePin(domain: string, opts?: RequestOptions): Promise<void>

Forget a pin; the next resolution is a first use. DELETE /v1/resolve/pins/{domain} (02 §10.5). Admin only.

domain: string

Source: discovery/resolve-api.ts:19

RolesApi class

Roles and overwrites of one community (10 §7). Every call needs a home or remote session of an active or needs_encryption member. me in place of an address means the caller (10 §7).

class RolesApi

constructor

new RolesApi(http: HttpClient)
http: HttpClient

The community server's HTTP client.

list

list(params?: { limit?: number; cursor?: string }, opts?: RequestOptions): Pager<Role, CollectionPage<Role>>

List roles ordered by position ascending, paging automatically. GET /v1/roles (10 §7.2). limit 1–250 (default 250, so one page normally holds every role).

params: { limit?: number; cursor?: string }

Default: {}

all

all(opts?: RequestOptions): Promise<Role[]>

Fetch every role (all pages), ordered by position. GET /v1/roles (10 §7.2).

get

get(roleId: string, opts?: RequestOptions): Promise<Role>

Get one role. GET /v1/roles/{roleId} (10 §7.1).

roleId: string

create

create(body: CreateRoleRequest, opts?: RequestOptions): Promise<Role>

Create a role below the caller's top position (default position 1). POST /v1/roles (10 §7.3). Needs manage_roles; every permission named must be one the caller holds (10 §4.3 rule 2). Answers 201 with the Role. Carries an Idempotency-Key, which servers honour on every client endpoint (03 §14.2 item 1), so a retry after a lost response returns the same role instead of a second one; generated unless opts.idempotencyKey is given.

update

update(roleId: string, body: UpdateRoleRequest, opts?: RequestOptions): Promise<Role>

Edit a role. PATCH /v1/roles/{roleId} (10 §7.3). Prefer addPermissions/removePermissions, which preserve permissions this client doesn't know (10 §3.3). Pass ifVersion for a conditional edit (409 role.version_conflict with the current Role in data.current).

roleId: string

delete

delete(roleId: string, opts?: RequestOptions): Promise<void>

Delete an ordinary role; holders lose it and its overwrites go. DELETE /v1/roles/{roleId} (10 §7.3).

roleId: string

reorder

reorder(order: readonly string[], opts?: RequestOptions): Promise<ReorderRolesResponse>

Reorder the ordinary roles. order lists every ordinary role from lowest to highest; a stale list fails with core.conflict (refetch and retry). POST /v1/roles/reorder (10 §7.3). Carries an Idempotency-Key (03 §14.2), generated unless opts.idempotencyKey is given. Predict the answer with checkRoleReorder (10 §4.3 rule 5).

order: readonly string[]

members

members(roleId: string, params?: { limit?: number; cursor?: string }, opts?: RequestOptions): Pager<RoleHolder, CollectionPage<RoleHolder>>

List a role's holders, paging automatically. GET /v1/roles/{roleId}/members (10 §7.1).

roleId: string
params: { limit?: number; cursor?: string }

Default: {}

grant

grant(roleId: string, address: string, opts?: RequestOptions): Promise<RoleGrantResponse>

Grant a role to a member. Idempotent. PUT /v1/roles/{roleId}/members/{address} with an empty body (10 §7.4). Needs manage_roles and the hierarchy rules (plus manage_bots for a bot; only admins grant admin). Clients MUST confirm an admin grant naming the person by full address (10 §4.2 item 2).

roleId: string
address: string

revoke

revoke(roleId: string, address: string, opts?: RequestOptions): Promise<void>

Remove a role from a member. Idempotent. DELETE /v1/roles/{roleId}/members/{address} (10 §7.4). Anyone may remove an ordinary role from themselves (10 §4.3 rule 4).

roleId: string
address: string

stepDown

stepDown(roleId: string, opts?: RequestOptions): Promise<void>

Step down from one of the caller's own roles, admin included unless the caller is the last admin (role.last_admin). DELETE /v1/roles/{roleId}/members/me (10 §4.3 rule 4, §7.4).

roleId: string

memberRoles

memberRoles(address: string, params?: { ctx?: string }, opts?: RequestOptions): Promise<MemberRoles>

A member's roles, top position and effective permissions (and with ctx, those in that channel). GET /v1/roles/members/{address} (10 §7.2). Use 'me' for the caller. A channel the caller can't view answers 404.

address: string
params: { ctx?: string }

Default: {}

overwrites

overwrites(ctx: string, opts?: RequestOptions): Promise<PermissionOverwrite[]>

List a channel's overwrites (not paged). GET /v1/roles/overwrites/{ctx} (10 §7.5).

ctx: string

setRoleOverwrite

setRoleOverwrite(ctx: string, roleId: string, body: SetOverwriteRequest, opts?: RequestOptions): Promise<PermissionOverwrite | null>

Set (replace) a role's overwrite in a channel. Resolves null when both lists are empty and the overwrite was deleted (204). PUT /v1/roles/overwrites/{ctx}/role/{roleId} (10 §7.5). The admin role can't have one.

ctx: string
roleId: string

setMemberOverwrite

setMemberOverwrite(ctx: string, address: string, body: SetOverwriteRequest, opts?: RequestOptions): Promise<PermissionOverwrite | null>

Set (replace) a member's overwrite in a channel. Resolves null when both lists are empty and the overwrite was deleted (204). PUT /v1/roles/overwrites/{ctx}/member/{address} (10 §7.5). A holder of mute_members without manage_roles may change only speak_and_share in deny (10 §5.2).

ctx: string
address: string

deleteRoleOverwrite

deleteRoleOverwrite(ctx: string, roleId: string, opts?: RequestOptions): Promise<void>

Remove a role's overwrite. DELETE /v1/roles/overwrites/{ctx}/role/{roleId} (10 §7.5).

ctx: string
roleId: string

deleteMemberOverwrite

deleteMemberOverwrite(ctx: string, address: string, opts?: RequestOptions): Promise<void>

Remove a member's overwrite. DELETE /v1/roles/overwrites/{ctx}/member/{address} (10 §7.5).

ctx: string
address: string

denySpeakAndShare

denySpeakAndShare(ctx: string, address: string, opts?: RequestOptions): Promise<PermissionOverwrite | null>

"Stop them speaking and sharing here" (10 §8.7): add speak_and_share to the deny of the member's overwrite in ctx, keeping everything else in it, so the change is one a mute_members holder may make (10 §5.2). Reads the channel's overwrites first. Resolves the resulting overwrite.

ctx: string
address: string

restoreSpeakAndShare

restoreSpeakAndShare(ctx: string, address: string, opts?: RequestOptions): Promise<PermissionOverwrite | null>

Undo denySpeakAndShare: remove speak_and_share from the member overwrite's deny, keeping everything else (10 §8.7, §5.2). Resolves null when the overwrite became empty and was deleted.

ctx: string
address: string

Source: api/roles.ts:43

SampleRing class

The last 30 Samples of a call (5 minutes at one per 10 s), recorded every 10 s and once more when the call closes (15 §14.1).

class SampleRing

constructor

new SampleRing()

push

push(sample: CallSample): void

Add a sample, dropping the oldest beyond 30.

sample: CallSample

list

list(): CallSample[]

The samples, oldest first.

clear

clear(): void

Forget all samples.

Source: calls/diagnostics.ts:31

ServerClient class

One server (02, 03): its base URL, validated metadata, HTTP client and every resource API, plus its event socket. The HTTP client sends only the credential this server issued (03 §3.2 rule 3).

Resource APIs that only make sense at the home server (me, devices, bots, dms.index, notifications, push, …) are present on every server client; a remote server answers them with auth.home_session_required (05 §3.2). Use ServerClient.isHome to choose.

class ServerClient

constructor

new ServerClient(init: ServerClientInit)

domain

readonly domain: string

The server's canonical domain (02 §5.3).

isHome

readonly isHome: boolean

Whether this is the account's home server (00 §3).

http

readonly http: HttpClient

The HTTP client: base URL, credential, retries and problem mapping (03 §2, §3, §10).

tokens

readonly tokens: TokenProvider | null

The credential this server issued, or null when used anonymously (03 §3).

serverClock

readonly serverClock: ServerClock

The clock offset estimate for this server (03 §2.3 item 4).

me

readonly me: MeApi

The caller's account at its home server (05 §11).

devices

readonly devices: DevicesApi

The account's devices (05 §12).

bots

readonly bots: BotsApi

Bots owned by the account (05 §15).

profiles

readonly profiles: ProfilesApi

Public profiles (05 §16).

providers

readonly providers: ProvidersApi

Linked sign-in providers (05 §10).

addresses

readonly addresses: AddressesApi

Address lookups (01 §9).

community

readonly community: CommunityApi

The server's community: settings, joining, members, categories (09 §3, §4).

myCommunities

readonly myCommunities: MyCommunitiesApi

The account's community list at its home server (09 §5.1).

channels

readonly channels: ChannelsApi

Channels (09 §6).

invites

readonly invites: InvitesApi

Invites (09 §8).

roles

readonly roles: RolesApi

Roles and overwrites (10 §3 to §5).

moderation

readonly moderation: ModerationApi

Moderation actions (10 §6 to §9).

bans

readonly bans: BansApi

Bans (10 §9).

reports

readonly reports: ReportsApi

Reports (10 §10).

auditLog

readonly auditLog: AuditLogApi

The audit log (10 §11).

messages

readonly messages: MessagesApi

Messages and the timeline (11 §4, §7).

reactions

readonly reactions: ReactionsApi

Reactions (11 §6.5, §7.3).

readState

readonly readState: ReadStateApi

Read state (11 §9).

typing

readonly typing: TypingApi

Typing (11 §10).

presence

readonly presence: PresenceApi

Presence (11 §11).

attachments

readonly attachments: AttachmentsApi

Attachments (11 §14).

webhooks

readonly webhooks: WebhooksApi

Webhooks (11 §15).

dms

readonly dms: DmsApi

DMs and group DMs (12); dms.index, dms.settings, dms.blocks and dms.requests are home-server only.

identity

readonly identity: IdentityApi

Identity objects (07).

pairing

readonly pairing: PairingApi

Device pairing (08 §5).

backup

readonly backup: BackupApi

KeyBackup (08 §7).

vault

readonly vault: VaultApi

The AccountVault (08 §8).

mls

readonly mls: MlsApi

The MLS Delivery Service (13).

keyPackages

readonly keyPackages: KeyPackagesApi

KeyPackages (13 §9).

history

readonly history: HistoryApi

History sharing (14).

calls

readonly calls: CallsApi

Call control (15).

notifications

readonly notifications: NotificationsApi

Notifications (19).

push

readonly push: PushApi

Push registration (19).

federation

readonly federation: FederationApi

Federation: assertions at the home server, sessions and policy (06).

auth

readonly auth: AuthApi

OAuth endpoints of this server, for sign-in at the home server (05 §6, §7).

resolve

readonly resolve: ResolveApi

The server's resolver: GET /v1/resolve (02 §6) and the admin pin endpoints /v1/resolve/pins… (02 §10.5; home server, admin system role only).

baseUrl

get baseUrl(): string

The normalized base URL (02 §3.3, 03 §2.1). Changes only when the client follows an accepted move (02 §15.6).

discovery

get discovery(): DiscoveryResult

The latest discovery result for this server (02 §5.1).

metadata

get metadata(): ServerMetadata

The server's validated metadata (02 §7).

closed

get closed(): boolean

Whether close was called.

socket

get socket(): EventSocket<EventMap> | null

The event socket, if events created one.

events

events(options?: ServerEventsOptions): EventSocket<EventMap>

The event WebSocket of this client session at this server (03 §5), typed by EventMap: events().on('message.created', (e) => e.d.content). There is at most one socket per client session per server (03 §5.12 item 1), so later calls return the same socket and ignore options; use follow(), watchHeads() and unsubscribe() to change subscriptions. Call connect() on it to start.

The socket checks /meta before connecting and after repeated handshake failures (03 §5.1 item 5), forwards discovery.metadata_changed to the resolver (02 §16.1) and, for a remote session, federation.session_ended to the session provider (06 §6.8).

options: ServerEventsOptions

Default: {}

followAcceptedMove

followAcceptedMove(): Promise<boolean>

Follow a server move the client's pin accepted (02 §10.2, §15.6): when the pin of this server's domain now names another base URL, and that pin already existed when this client was built (so the change went through 02 §10.2 rather than a new first use), move the HTTP client, the event socket and the credential binding there. Users stay signed in. Never moves without a pin, or when the pin kept the old base URL: the token then stays bound to the old one (02 §10.6 token binding). Resolves whether it moved.

reportTransportFailure

reportTransportFailure(): void

Report a failure that 02 §13.4 lists as a refresh trigger on this server's base URL (connection refused, a TLS or network failure, a 404/410 without a problem code): the delegation is refreshed (at most once per 60 s per domain), and a move the pin accepts is followed. The HTTP client and the event socket call it.

close

close(options?: { discardPositions?: boolean }): Promise<void>

Close the event socket and stop background work for this server (03 §5.3: "the app no longer needs this server"). With discardPositions, stream positions are forgotten (sign-out, 03 §7.3 rule 5). A remote session is closed locally; call signOut() on its provider to end it at the server (06 §6.5).

options: { discardPositions?: boolean }

Default: {}

Source: client.ts:247

ServerClock class

A clock corrected by an estimated offset to one server's clock (03 §2.3 item 4). Device clocks are often minutes off, so signed objects built for a server (iat, nbf, exp) and, preferably, UUIDv7 time fields use the corrected time. The device clock itself is never changed.

Feed it the Date header of each response (ServerClock.observeDateHeader) and the ts of fresh control envelopes such as session.ping and session.ready (ServerClock.observeTimestamp); the latest sample wins. Never feed it the ts of a durable event: that is when the event was sequenced, which may be long ago on replay (03 §6.1).

class ServerClock implements Clock

constructor

new ServerClock(base?: Clock)
base: Clock

Default: systemClock

offsetMs

get offsetMs(): number

The estimated server time minus the device time, in milliseconds.

calibrated

get calibrated(): boolean

Whether at least one sample has been observed.

now

now(): number

The corrected time: device time plus the estimated offset.

observe

observe(serverMs: number, localMs?: number, resolutionMs?: number): void

Record that the server's clock read serverMs at device time localMs. resolutionMs is the precision of the server value (1,000 for Date headers); the midpoint of that interval is used.

serverMs: number
localMs: number
resolutionMs: number

Default: 0

observeDateHeader

observeDateHeader(value: string | null | undefined, localMs?: number): void

Record an HTTP Date header (IMF-fixdate, 1 s resolution). Invalid values are ignored.

value: string | null | undefined
localMs?: number

observeTimestamp

observeTimestamp(ts: string | null | undefined, localMs?: number): void

Record the ts of a freshly created control envelope (03 §6.1). Invalid values are ignored.

ts: string | null | undefined
localMs?: number

Source: core/time.ts:130

SloppyVoiceClient class

The entry point of the SDK: discovery (02), credentials (03 §3, 05, 06) and one ServerClient per server.

const sv = new SloppyVoiceClient({ client: 'my-bot/1.0', auth: botToken('svb_…'), home: 'sloppyvoice.com', txt: nodeTxtResolver() })
const home = await sv.home()
const lobby = await sv.serverFor('publiclobby@sloppyvoice.com')
  • home resolves the home domain and authenticates with the configured credential.
  • server resolves any domain (02 §5); for the home server (or one of its aliases) it returns the home client, for any other it creates a remote session silently (06 §6.10), bots included (03 §3.1).
  • Server clients are cached by canonical domain, and so are their remote sessions.
class SloppyVoiceClient

constructor

new SloppyVoiceClient(options: SloppyVoiceClientOptions)

clientName

readonly clientName: string

The client name (03 §5.4).

discovery

get discovery(): DiscoveryResolver

The discovery resolver this client uses (02 §5).

homeDomain

get homeDomain(): string | null

The configured home domain, from home or the domain of address (02 §5.1).

resolve

resolve(domain: string, options?: { signal?: AbortSignal }): Promise<DiscoveryResult>

Resolve a domain to a server without creating a client (02 §5.1).

domain: string
options: { signal?: AbortSignal }

Default: {}

home

home(options?: { signal?: AbortSignal }): Promise<ServerClient>

The home server's client (00 §3), authenticated with the configured credential (05). Resolved once and cached. signal stops only this caller's wait: concurrent callers share the work, which is bounded by the resolver's and the HTTP client's own timeouts.

options: { signal?: AbortSignal }

Default: {}

server

server(domain: string, options?: { signal?: AbortSignal }): Promise<ServerClient>

The client for the server of domain (02 §5). The home server (or one of its domains) gives the home client. Any other server gets its own remote session, created silently from a HomeAssertion (06 §4, §6.10) the first time a request needs it; without auth, the server is used anonymously. signal stops only this caller's wait (02 §5.2 step 3: concurrent resolutions are coalesced).

domain: string
options: { signal?: AbortSignal }

Default: {}

serverFor

serverFor(address: string, options?: { signal?: AbortSignal }): Promise<ServerClient>

The client for the server hosting address (01 §2.2): the server of the address's domain, as server. Works for accounts, bots and channels.

address: string
options: { signal?: AbortSignal }

Default: {}

servers

servers(): ServerClient[]

Every server client created so far, home first.

close

close(): Promise<void>

Close every server client (their sockets and remote-session timers) and the resolver's timers. Sessions are not ended at the servers: sign out through the providers for that (05 §14, 06 §6.5).

Source: client.ts:578

SloppyVoiceError class

An error carrying a problem object (03 §10.1, 00 §7.9). Every non-2xx HTTP response, every WebSocket error and every SDK-side failure becomes one.

Use code, never title or detail, to decide what to do; userAction decides what the user sees and retryable/retryAfterMs decide automatic retries (03 §10.3). title and detail are plain text, never markup (03 §10.1 rule 3).

class SloppyVoiceError extends Error

constructor

new SloppyVoiceError(problem: Problem, options?: SloppyVoiceErrorOptions)
problem: Problem
options: SloppyVoiceErrorOptions

Default: {}

code

readonly code: string

The registered error code (03 §10.4), or an sdk.* code.

status

readonly status: number

The HTTP status (0 for SDK-side and network errors).

title

readonly title: string

Short summary; plain text only.

detail

readonly detail: string | undefined

Human-readable detail; plain text only.

retryable

readonly retryable: boolean

Whether the same request may succeed later without any change.

retryAfterMs

readonly retryAfterMs: number | null

Minimum delay before retrying, or null for no hint.

userAction

readonly userAction: "none" | "retry" | "wait" | "sign_in" | "enable_encryption" | "set_up_device" | "update_app" | "contact_admin"

The one-tap fix, with unknown values mapped to none (03 §10.2). Scoped by the server that answered: a sign_in from any server other than the account's home server is reported as wait (03 §10.2 scope rules 1 and 2); problem.userAction keeps what the server sent.

data

readonly data: Record<string, unknown> | undefined

Code-specific structured data.

instance

readonly instance: string | undefined

urn:uuid:<UUIDv7> of this occurrence, for diagnostics (03 §10.1 rule 4).

problem

readonly problem: Problem

The problem object as received (or synthesized, 03 §10.3).

Source: core/errors.ts:71

SloppyVoiceNetworkError class

A network failure or timeout: no HTTP response was read (03 §2.7). Code sdk.network_error, retryable: true, userAction: "retry". A non-idempotent request that fails this way is never retried automatically, because it may have been processed (03 §2.7, §2.8).

class SloppyVoiceNetworkError extends SloppyVoiceError

constructor

new SloppyVoiceNetworkError(message: string, options?: NetworkErrorOptions)
message: string
options: NetworkErrorOptions

Default: {}

timedOut

readonly timedOut: boolean

The request timed out rather than failing outright.

ambiguous

readonly ambiguous: boolean

The request may have been processed by the server.

url

readonly url: string | undefined

The URL that was requested, if known.

Inherited: code, status, title, detail, retryable, retryAfterMs, userAction, data, instance, problem

Source: core/errors.ts:137

StreamTracker class

Positions and per-stream processing state for one socket's streams (03 §7.3 to §7.5). Positions survive resetConnection; queues, gap repairs and resyncs don't, because a new socket resumes from P anyway.

class StreamTracker

constructor

new StreamTracker(options?: StreamTrackerOptions)
options: StreamTrackerOptions

Default: {}

position

position(stream: StreamName): number | null

The position P of a stream (03 §7.3), or null if none is known.

stream: StreamName

positions

positions(): Map<StreamName, number>

Every known position.

setPosition

setPosition(stream: StreamName, position: number): void

Set a position, for example one loaded from a SeqStore.

stream: StreamName
position: number

forget

forget(stream: StreamName): void

Forget a stream's position and processing state.

stream: StreamName

clear

clear(): void

Forget everything (03 §7.3 rule 5).

isResyncing

isResyncing(stream: StreamName): boolean

Whether a stream is in a resync (03 §7.5 step 1) or waiting for the head of the client's own resync.

stream: StreamName

isRepairing

isRepairing(stream: StreamName): boolean

Whether a gap repair is in progress for a stream (03 §7.3 rule 2).

stream: StreamName

noteRequested

noteRequested(stream: StreamName, request: SubscriptionRequest): void

Record what the client is asking for a stream, so its SubscriptionResult can be read.

stream: StreamName

stopFollowing

stopFollowing(stream: StreamName): void

The stream is no longer followed at full (unsubscribed, ended or downgraded). Its position is kept.

stream: StreamName

resetConnection

resetConnection(): StreamName[]

The socket closed. Gap repairs and resyncs in progress end, their queues are dropped, and pending requests are forgotten; a new socket resumes from P (03 §5.11 item 4). Returns the streams whose resync was cancelled.

onSubscriptionResult

onSubscriptionResult(result: SubscriptionResult): ResultOutcome

Read a SubscriptionResult from session.ready or session.subscribed (03 §5.5, §5.6), using what was requested for the stream.

onDurable

onDurable(envelope: ServerEnvelope): DurableDecision

Decide what to do with a durable event of a stream (03 §7.3 rule 2). The caller applies events whose decision is apply (an event of an unknown type is applied by ignoring its payload, and still advances P).

envelope: ServerEnvelope

onResyncRequired

onResyncRequired(stream: StreamName, reason: string, headSeq: number): ResyncStart | null

Handle session.resync_required (03 §7.5 step 1): mark the stream as resyncing and queue its live events from now on. Returns null if the stream isn't followed at full.

stream: StreamName
reason: string
headSeq: number

isCurrentResync

isCurrentResync(stream: StreamName, generation: number): boolean

Whether generation is still the current resync of stream.

stream: StreamName
generation: number

completeResync

completeResync(stream: StreamName, generation: number, snapshotHeadSeq?: number | null): ResyncCompletion | null

Finish a resync after the client refetched its state (03 §7.5 steps 3 and 4). snapshotHeadSeq is the lowest headSeq among the owner responses it fetched, or null if none reported one; queued events not above it are skipped, the others are returned to be applied in order. P becomes the greater of the resync headSeq and the highest queued seq processed or skipped. A headSeq from HTTP never sets P directly (03 §2.8).

Returns null if generation was superseded or cancelled.

stream: StreamName
generation: number
snapshotHeadSeq: number | null

Default: null

Source: events/tracker.ts:143

TokenChangeListeners class

A small listener set for TokenProvider.onChange, shared by provider implementations. Listener errors are isolated so one bad listener can't stop the others or the refresh that triggered them.

class TokenChangeListeners

constructor

new TokenChangeListeners(onError?: (error: unknown) => void)

onError receives listener errors; by default they are rethrown asynchronously.

onError?: (error: unknown) => void

size

get size(): number

The number of listeners.

add

add(listener: (token: string) => void): () => void

Add a listener; returns its unsubscribe function.

listener: (token: string) => void

notify

notify(token: string): void

Call every listener with the new token.

token: string

Source: core/auth.ts:76

TurnIceRestartTracker class

Tracks TURN credential renewal ICE restarts (relay.ice_servers → relay.ice_restart → relay.ice_answer) with timeout and single retry (15 §6.10.3). Pure: callers pass monotonic timestamps.

class TurnIceRestartTracker

constructor

new TurnIceRestartTracker()

restarts

get restarts(): number

outstanding

get outstanding(): boolean

serversReceived

serversReceived(payload: unknown): { action: "restart"; iceServers: TurnIceServer[] } | null

Record a relay.ice_servers message; returns { action: 'restart', iceServers } when valid.

payload: unknown

offerSent

offerSent(now: number): void

Record that relay.ice_restart was sent at now.

now: number

answerReceived

answerReceived(): void

Record that relay.ice_answer was applied.

badOffer

badOffer(now: number): void

Record that the outstanding ICE restart failed (e.g. relay.bad_offer or local SDP error).

now: number

check

check(now: number): { action: "restart"; iceServers: TurnIceServer[] } | null

Evaluate timeout and retry timers at now.

now: number

reset

reset(): void

Source: calls/relay.ts:465

TypingApi class

The typing endpoint (11 §10.1).

class TypingApi

constructor

new TypingApi(http: HttpClient)

set

set(ctx: string, typing: boolean, opts?: RequestOptions): Promise<void>

Say the user is typing (true) or stopped without sending (false) (11 §10.1). Answers 204. typing: true needs what posting a message needs; excess true within 3 s are accepted and ignored (11 §10.2 rule 2). POST /v1/contexts/{ctx}/typing.

ctx: string
typing: boolean

start

start(ctx: string, opts?: RequestOptions): Promise<void>

typing: true (11 §10.1).

ctx: string

stop

stop(ctx: string, opts?: RequestOptions): Promise<void>

typing: false (11 §10.1).

ctx: string

Source: api/typing.ts:13

TypingNotifier class

The sender side of 11 §10.3: call draftChanged() on every draft change and left() when the user leaves the context. It sends typing: true on the first change to a non-empty draft and again every TYPING_REFRESH (6 s) while the draft keeps changing, typing: false when the draft becomes empty or the user leaves without sending, and nothing after sent() (the server clears the mark itself, 11 §10.2 rule 4). With enabled: false (the typing_indicators setting, 11 §10.3 rule 4) it never calls the endpoint.

class TypingNotifier

constructor

new TypingNotifier(api: TypingApi, ctx: string, opts?: { clock?: Clock; enabled?: boolean; onError?: (e: unknown) => void })
ctx: string
opts: { clock?: Clock; enabled?: boolean; onError?: (e: unknown) => void }

Default: {}

enabled

enabled: boolean

The typing_indicators setting (11 §10.3 rule 4): when false, the endpoint is never called.

draftChanged

draftChanged(draft: string): Promise<void>

The draft changed to draft.

draft: string

left

left(): Promise<void>

The user left the context without sending.

sent

sent(): void

The draft was sent as a message: the server clears the mark, so nothing is sent.

Source: api/typing.ts:50

TypingTracker class

The receiver side of 11 §10.3 rule 2: show a typing account until its typing.stopped, its message.created, or 10 s after its last typing.started. Feed it events; read active().

class TypingTracker

constructor

new TypingTracker(opts?: { clock?: Clock })
opts: { clock?: Clock }

Default: {}

started

started(e: TypingEvent): void

Apply typing.started (11 §10.2).

stopped

stopped(e: TypingEvent): void

Apply typing.stopped (11 §10.2).

messageFrom

messageFrom(sender: Sender): void

Apply message.created from sender, which ends that account's typing (11 §10.2 rule 4).

sender: Sender

active

active(): Sender[]

The accounts to show as typing now, in the order they started.

Source: api/typing.ts:112

UuidV7Generator class

A monotonic UUIDv7 generator (RFC 9562 §6.2, Method 1). Within one millisecond, rand_a is a 12-bit counter seeded randomly with its top bit clear; if the counter overflows, or the clock goes backwards, the embedded timestamp is advanced past the last one used, so every ID is strictly greater than the previous one from the same generator. rand_b (62 bits) is always fresh CSPRNG output (03 §8.2 item 2).

class UuidV7Generator

constructor

new UuidV7Generator(options?: UuidV7GeneratorOptions)
options: UuidV7GeneratorOptions

Default: {}

next

next(nowMs?: number, random?: RandomSource): string

Generate the next UUIDv7. nowMs overrides the clock for this call; random overrides the random source for this call.

nowMs?: number
random?: RandomSource

Source: core/uuidv7.ts:76

VaultApi class

AccountVault endpoints (08 §8.7, §10). Only enrolled devices (and a bot's token) may call them.

class VaultApi

constructor

new VaultApi(http: HttpClient)

summary

summary(opts?: RequestOptions): Promise<VaultSummary>

The vault summary; vgen 0 means uninitialized. GET /v1/me/vault (08 §8.7.1).

list

list(params?: VaultListParams, opts?: RequestOptions): Pager<VaultRecord, CollectionPage<VaultRecord>>

List records (not tombstones), ordered by rid, paging automatically. GET /v1/me/vault/records (08 §8.7.2): filter by type or bucket (a lazy per-context download, 08 §8.10), or read a retired vault with igen. limit 1 to 500.

params: VaultListParams

Default: {}

getRecord

getRecord(rid: string, params?: { igen?: number }, opts?: RequestOptions): Promise<VaultRecord>

Read one record; tombstones give 404 core.not_found. GET /v1/me/vault/records/{rid} (08 §8.7.2).

rid: string
params: { igen?: number }

Default: {}

putRecords

putRecords(records: VaultRecordWrite[], opts?: RequestOptions): Promise<VaultWriteResponse>

Write 1 to 100 records, each a compare-and-set on ver. PUT /v1/me/vault/records (08 §8.7.3). Per-record errors come back in results: vault.version_conflict (merge, 08 §8.9), vault.stale_generation, vault.rotation_required, vault.record_too_large, vault.quota_exceeded.

records: VaultRecordWrite[]

deleteRecord

deleteRecord(rid: string, ifVer: number, opts?: RequestOptions): Promise<VaultRecord>

Replace a record with a tombstone if its ver is ifVer. DELETE /v1/me/vault/records/{rid}?ifVer={n} (08 §8.7.4).

rid: string
ifVer: number

changes

changes(params: VaultChangesParams, opts?: RequestOptions): Pager<VaultRecord, VaultChangesPage>

The change feed from params.since, paging for you (08 §8.8). GET /v1/me/vault/changes?since={vseq}&limit={n}. Iterating yields records; page() fetches the first page and pages() walks pages while hasMore, each next request using the page's vseq (not the last item's), and never stopping on an empty page while hasMore. Store the last processed record's vseq (or read page.vseq through pages()) to continue later. 410 vault.changes_expired means relist (read the summary's vseq first).

changesFrom

changesFrom(since: number, params?: Omit<VaultChangesParams, "since">, opts?: RequestOptions): AsyncIterable<VaultChangesPage>

Deprecated

Use changes({ ...params, since }).pages(). Walks the change feed page by page (08 §8.8).

since: number
params: Omit<VaultChangesParams, "since">

Default: {}

keys

keys(params?: { igen?: number }, opts?: RequestOptions): Promise<VaultKeysState>

Generations, links and rotation state. GET /v1/me/vault/keys (08 §10.2); igen for a retired vault.

params: { igen?: number }

Default: {}

createGeneration

createGeneration(body: VaultGenerationCreate, opts?: RequestOptions): Promise<VaultKeysState>

Create a generation: 1 at initialization (201; idempotent for the same kcv), or g + 1 at a rotation. POST /v1/me/vault/keys (08 §10.5). 409 vault.generation_conflict when another device won.

putBoxKey

putBoxKey(body: BoxKeyUpload, opts?: RequestOptions): Promise<BoxKey>

Upload this device's box key. PUT /v1/me/vault/box-keys/{did} (08 §10.1).

boxKeys

boxKeys(opts?: RequestOptions): Promise<BoxKeyList>

Box keys of the devices listed active. GET /v1/me/vault/box-keys (08 §10.1). Verify each with verifyBoxKey.

grant

grant(opts?: RequestOptions): Promise<VaultKeyGrant>

The newest grant addressed to this device. GET /v1/me/vault/grants (08 §10.3). 404 vault.grant_not_found when there is none for the current generation (the server then asks other devices with vault.grant_needed).

postGrants

postGrants(body: VaultGrantsPost, opts?: RequestOptions): Promise<VaultGrantsPostResponse>

Post grants of the current generation for other devices. POST /v1/me/vault/grants (08 §10.3, §10.7).

Source: api/vault.ts:778

WebhooksApi class

Webhook management and execution (11 §15).

class WebhooksApi

constructor

new WebhooksApi(http: HttpClient, options?: { limits?: LimitsSource; isCanonicalAddress?: MentionAddressCheck })
options: { limits?: LimitsSource; isCanonicalAddress?: MentionAddressCheck }

Default: {}

create

create(ctx: string, body: CreateWebhookRequest, opts?: RequestOptions): Promise<Webhook>

Create a webhook (11 §15.3). The response carries the token, shown once. At most 15 per channel (409 message.webhook_limit); 403 security.context_secure_unsupported in a secure channel. POST /v1/contexts/{ctx}/webhooks.

ctx: string

list

list(ctx: string, params?: { limit?: number }, opts?: RequestOptions): Pager<Webhook, CollectionPage<Webhook>>

The channel's webhooks, paging by cursor (11 §15.3). GET /v1/contexts/{ctx}/webhooks.

ctx: string
params: { limit?: number }

Default: {}

get

get(ctx: string, id: string, opts?: RequestOptions): Promise<Webhook>

One webhook (11 §15.3). GET /v1/contexts/{ctx}/webhooks/{id}.

ctx: string
id: string

update

update(ctx: string, id: string, body: UpdateWebhookRequest, opts?: RequestOptions): Promise<Webhook>

Rename, enable or disable a webhook (11 §15.3). state: "disabled" sets disabledReason: "admin"; one disabled for secure_context can't be enabled. PATCH /v1/contexts/{ctx}/webhooks/{id}.

ctx: string
id: string

rotateToken

rotateToken(ctx: string, id: string, opts?: RequestOptions): Promise<Webhook>

Rotate the token: the old one stops working at once (11 §15.3). The response carries the new token. POST /v1/contexts/{ctx}/webhooks/{id}/token.

ctx: string
id: string

delete

delete(ctx: string, id: string, opts?: RequestOptions): Promise<void>

Delete a webhook; its messages stay (11 §15.3). DELETE /v1/contexts/{ctx}/webhooks/{id}.

ctx: string
id: string

execute

execute(ctx: string, id: string, token: string, body: ExecuteWebhookRequest, opts?: RequestOptions): Promise<EntryAck>

Execute a webhook (11 §15.4): post a root message as the webhook, with the webhook token as a Bearer token in Authorization (never in the URL). The content may hold only text, mentions and mentionAll. With a mid the request is idempotent and retried automatically; without one the server generates one and it isn't. Answers 201 with an EntryAck. POST /v1/contexts/{ctx}/webhooks/{id}/messages.

ctx: string
id: string
token: string

Source: api/webhooks.ts:47

Functions

accountKindOf function

function accountKindOf(kind: unknown): "bot" | "user"

kind for logic: an unknown value is bot, so it is never shown as a person (05 §11.1, §17.1).

kind: unknown

Source: auth/session.ts:664

accountStateOf function

function accountStateOf(state: unknown): "active" | "upgrade_required" | "suspended" | "deleted"

Account state for logic: an unknown value is suspended (05 §11.1).

state: unknown

Source: auth/session.ts:669

afterSignInScreen function

function afterSignInScreen(me: { account: Pick<Account, "state" | "security">; device: Pick<DeviceRecord, "enrolled"> }): AfterSignInScreen

The client logic after sign-in or refresh, normative for Full and Web clients (05 §11.5): upgrade_required → the blocking "Turn on encryption to continue" screen (A10, M4); a secure account on an unenrolled device → "Approve from your other device" (08), which the user may skip; otherwise the normal app.

me: { account: Pick<Account, "state" | "security">; device: Pick<DeviceRecord, "enrolled"> }

Source: auth/session.ts:738

aggregateTriggers function

function aggregateTriggers(triggers: readonly NotifyTrigger[]): NotifyAggregate

Aggregate the pending triggers of a window, oldest first (19 §4.5 "Aggregation"): the latest trigger's sender and at, the last 20 triggers as items, count = all of them, otherSenders = distinct senders other than the latest, kind = the highest priority. The preview, if any, is the latest trigger's (19 §4.8) and is the caller's to attach.

triggers: readonly NotifyTrigger[]

Source: api/notifications.ts:440

alreadySecureIsOwnGroup function

function alreadySecureIsOwnGroup(data: ChannelAlreadySecureData, mine: { generation: number; ekid: string; groupId?: string }): boolean

After a 409 channel.already_secure on an upgrade confirmation: whether the existing group is the caller's own (its confirmation succeeded but the response was lost), so it keeps its group; otherwise it discards it and joins the existing group (09 §10.4, 13 §10).

mine: { generation: number; ekid: string; groupId?: string }

Source: api/channels.ts:173

apnsPushBody function

function apnsPushBody(type: PushType, payload: string, locKey?: string): string

The APNs body for a push (19 §10.2), with the serialized payload copied byte for byte under sv: alert → {"aps":{"alert":{"loc-key":…},"mutable-content":1,"sound":"default"},"sv":…}; call (PushKit) → {"sv":…}; background → {"aps":{"content-available":1},"sv":…}. Gateway side. payload is the serialized form exactly as received (19 §11.3).

type: PushType
payload: string
locKey: string

Default: DEFAULT_ALERT_LOC_KEY

Source: api/push.ts:395

apnsPushHeaders function

function apnsPushHeaders(input: ApnsPushHeadersInput): Record<string, string>

The APNs request headers for a push (19 §10.2): apns-push-type and apns-priority by push type (alert 10, call as voip 10, background 5), apns-topic, apns-expiration from ttlMs (0, "deliver now or never", gives 0), and apns-collapse-id from collapseKey. Gateway side.

Source: api/push.ts:425

applyCallEvent function

function applyCallEvent<K extends keyof CallEvents>(call: Call | null, type: K, d: CallEvents[K]): Call | null

Apply one call event of 15 §15 to the known Call of a context, returning the new Call (or null). Events are ephemeral and may be missed: whenever a socket regains a full subscription the server sends call.state, which replaces everything (15 §3.1). Events for another callId are ignored, except call.state and call.started. Participants stay in ascending pid order. Targeted events that don't change the roster are ignored here.

call: Call | null
type: K

Source: calls/call.ts:142

applyChannelStatement function

function applyChannelStatement(pin: ChannelSecPin | null, community: CommunitySecPin | null, st: ChannelStatement, now: string): StatementPinUpdate<ChannelSecPin>

Apply one statement about channel X to the client's channel pin P and community pin S for its server (09 §13.3), and decide W9 triggers T1, T3 and T5 (09 §13.4).

  • A secure statement creates P or fills securedAt, upgradeSeq (only from a Channel object or channel.security_changed) and version once; pinned values never change afterwards, and nothing weakens a pin.
  • A Channel object whose address differs moves the old one into previousAddresses (09 §13.2 address tracking).
  • A statement whose version is lower than P.version is historical and changes nothing (09 §13.4).
  • An unknown security value never raises W9 (09 §6.1).
  • A conflicting cached statement asks for a refetch instead of W9.

T2 is checkPlaintextContent; T4 is applyCommunityStatement; T6 is t6CheckNeeded and decideT6.

pin: ChannelSecPin | null
community: CommunitySecPin | null
now: string

Source: api/channels.ts:666

applyCommunityStatement function

function applyCommunityStatement(pin: CommunitySecPin | null, st: CommunityStatement, now: string): StatementPinUpdate<CommunitySecPin>

Apply one statement about a server to its community pin S (09 §13.3) and decide T4 (09 §13.4): a current Community object or ServerMetadata saying secure: false, or a securedAt different from S.securedAt, raises W9 for the whole community and every channel of it. A Community object older than S.version is historical; a conflicting cached statement asks for a refetch. A community pin is never deleted (09 §13.3 rule 4).

pin: CommunitySecPin | null
now: string

Source: api/channels.ts:831

applyVisibilityChange function

function applyVisibilityChange(ranges: readonly VisibilityRange[], change: VisibilityChange): VisibilityRange[]

Apply one event to a member's visibility ranges, exactly as the table of 09 §7.2 says, and merge the result. Test vectors: 09 §17.3.

ranges: readonly VisibilityRange[]

Source: api/channels.ts:437

archiveRid function

function archiveRid(kVid: Uint8Array, groupId: string, epoch: number): Promise<string>

rid of an archive record: VID(lv("archive") || lv(groupId) || u64(epoch)) (08 §8.5).

kVid: Uint8Array
groupId: string
epoch: number

Source: api/vault.ts:79

assertMayContactBeforeAccept function

function assertMayContactBeforeAccept(input: { state: string; target: string; home: string; action: BeforeAcceptAction }): void

Guard for 12 §10.4: before the user accepts a message request, the client MUST NOT contact the hosting server, the inviter's home server or any other server the sender chose; it talks only to its own home server (D-049). Throws sdk.invalid_argument when target isn't the client's own home server and state (a DmIndexEntry or DmRequest state) isn't one in which the user has accepted. A requested, declined or blocked entry, or a pending, declined, blocked, expired or withdrawn request, was never accepted: contacting the hosting server for it would reveal the user's IP address and, by 12 §8.7, accept it implicitly. Unknown states are treated as not accepted. Use it around any I/O a request card could trigger.

input: { state: string; target: string; home: string; action: BeforeAcceptAction }

Source: api/dm-requests.ts:115

assertPermissionNames function

function assertPermissionNames(names: readonly unknown[], what?: string): void

Throw sdk.invalid_argument unless every name matches the grammar of 10 §3.3.

names: readonly unknown[]
what: string

Default: 'permissions'

Source: permissions.ts:765

assertValidContent function

function assertValidContent(kind: "message" | "edit" | "reaction" | "delete", content: unknown, opts?: ValidateOptions): void

Throw sdk.invalid_argument if a content object breaks 11 §3 (see contentIssues). data carries the first issue's field and reason, as message.invalid_content would, and every issue in issues.

kind: "message" | "edit" | "reaction" | "delete"
content: unknown
opts: ValidateOptions

Default: {}

Source: content.ts:721

attachmentIdsOf function

function attachmentIdsOf(content: Pick<MessageContent, "attachments">): string[]

The IDs of every attachment and thumbnail a content object references, in order: what a secure carrier sends as attachmentIds (11 §4.2, §4.3).

content: Pick<MessageContent, "attachments">

Source: content.ts:872

authEndpoints function

function authEndpoints(baseUrl: string): AuthEndpoints

The /v1/auth/* URLs under a base URL (05 §3.2). The authorization server's issuer is the base URL itself (05 §3.3).

baseUrl: string

Source: auth/oauth.ts:295

avatarBody function

function avatarBody(image: AvatarBody, contentType: AvatarContentType): BodyInit

Check an avatar's media type and wrap its bytes as a fetch body (05 §11.7). Shared with BotsApi.

image: AvatarBody
contentType: AvatarContentType

Source: api/me.ts:21

backupKeyFromArgon2 function

function backupKeyFromArgon2(a: Uint8Array, addr: string): Promise<Uint8Array<ArrayBufferLike>>

The HKDF step of 08 §5.3 alone, from the 32-byte Argon2id output A.

a: Uint8Array
addr: string

Source: api/backup.ts:379

base32Decode function

function base32Decode(text: string): Uint8Array<ArrayBufferLike> | null

RFC 4648 base32 without padding, accepting lowercase letters (08 §6.3.1). Returns null on any error, including non-zero tail bits.

text: string

Source: api/pairing.ts:73

base32Encode function

function base32Encode(bytes: Uint8Array): string

RFC 4648 base32 without padding.

bytes: Uint8Array

Source: api/pairing.ts:56

baseUrlHost function

function baseUrlHost(baseUrl: string): string

The host of a normalized base URL (lowercase, no port).

baseUrl: string

Source: discovery/base-url.ts:165

beginLink function

function beginLink(providers: ProvidersApi, issuer: string, options: BeginLinkOptions, opts?: Pick<RequestOptions, "signal"> & { random?: RandomSource; clock?: Clock }): Promise<PendingAuthorization>

Start linking a provider (05 §10.3): make PKCE and state, then POST /v1/me/providers with the session (fresh authentication needed). The server pushes the request itself and returns the authorizeUrl. Finish with AuthApi.completeAuthorization, which answers { type: 'link' }.

providers: ProvidersApi
issuer: string
opts: Pick<RequestOptions, "signal"> & { random?: RandomSource; clock?: Clock }

Default: {}

Source: auth/oauth.ts:874

botToken function

function botToken(token: string): TokenProvider

A provider for a bot token, sent as Authorization: Bot <token> (03 §3.1). Use it only with the bot's home server; elsewhere a bot uses a remote session (06). On 401 recovery is pointless: the token was revoked or rotated, so the error is reported to the bot operator (03 §3.3).

token: string

Source: core/auth.ts:160

botTokenHint function

function botTokenHint(token: string): string

The tokenHint a bot device shows for token: its last 4 characters (05 §12.2, §21.2). Owner tools use it to match a token they hold with its device record, for example after a lost response (05 §15.4).

token: string

Source: auth/bots.ts:48

botTokenProvider function

function botTokenProvider(token: string): TokenProvider

A TokenProvider for a bot token (kind: 'bot', scheme: 'Bot', 03 §3.1, 05 §15.4). The token must be a well-formed svb_ token: any other kind (an sva_ access token, an svs_ sign-up token) is refused, and an svb_ token must never be sent as Bearer (05 §15.4). Use it only with the bot's home server; elsewhere a bot uses a remote session (06).

token: string

Source: auth/bots.ts:32

boxKeyTbs function

function boxKeyTbs(addr: string, did: string, igen: number, pub: Uint8Array): Uint8Array

BoxKeyTBS = u8(1) || lv(addr) || did || u32(igen) || pub (08 §10.1).

addr: string
did: string
igen: number
pub: Uint8Array

Source: api/vault.ts:550

buildAuthorizeUrl function

function buildAuthorizeUrl(baseUrl: string, params: AuthorizationParams | { client_id: string; request_uri: string }): string

Build the GET /v1/auth/authorize URL the client opens in the system browser or by top-level navigation (05 §6.2). With a pushed request it carries only client_id and request_uri (RFC 9126 §4); otherwise the full parameter set.

baseUrl: string
params: AuthorizationParams | { client_id: string; request_uri: string }

Source: auth/oauth.ts:354

buildBoxKey function

function buildBoxKey(input: { addr: string; did: string; igen: number; pub: Uint8Array; devcert: string; dsk: Ed25519Signer }): Promise<BoxKeyUpload>

Build this device's BoxKey upload (08 §10.1), signed by its DSK with label vault-box-key.

input: { addr: string; did: string; igen: number; pub: Uint8Array; devcert: string; dsk: Ed25519Signer }

Source: api/vault.ts:556

buildDeleteContent function

function buildDeleteContent(target: string): DeleteContent

Build a DeleteContent (11 §3.7.3).

target: string

Source: content.ts:863

buildEditContent function

function buildEditContent(target: string, previous: MessageContent | EditContent, text: string, opts?: { keepAttachments?: (ref: AttachmentRef) => boolean; trim?: boolean; isCanonicalAddress?: MentionAddressCheck }): EditContent

Build an EditContent (11 §3.7.1): the complete new text with its mentions, the previous content's replyTo copied unchanged, and the attachments to keep (by default all of the previous ones; pass a subset to remove some).

target: string
text: string
opts: { keepAttachments?: (ref: AttachmentRef) => boolean; trim?: boolean; isCanonicalAddress?: MentionAddressCheck }

Default: {}

Source: content.ts:837

buildGroupId function

function buildGroupId(host: string, ctx: string, generation: number): string

Build the group_id string "sv1:" host-domain ":" ctx-ref ":" generation (13 §4.1, 00 §7.6). The MLS group_id is its UTF-8 encoding (groupIdBytes).

host: string
ctx: string
generation: number

Source: mls/provider.ts:192

buildKeyPackage function

function buildKeyPackage(params: BuildKeyPackageParams): Promise<{ keyPackage: Uint8Array; message: Uint8Array; ref: Uint8Array }>

Build and sign a KeyPackage with the 13 §9.1 profile: mls10, ciphersuite 0x0001, a LeafNode with source key_package, the sv_device credential, the DSK as signature_key, the sv1 capabilities, a lifetime, empty leaf and KeyPackage extensions, the LeafNode signed with "LeafNodeTBS" and the KeyPackage with "KeyPackageTBS". The caller (an MlsProvider) keeps the private keys of initKey and encryptionKey. Reproduces vector T-KPREF (13 §20.8).

Source: mls/provider.ts:1023

buildMessageContent function

function buildMessageContent(text: string, opts?: BuildMessageOptions): MessageContent

Build a MessageContent from text (11 §3.2): line endings become LF, the text is put in NFC and trimmed, and mentions and mentionAll are computed from the tokens in the text (11 §3.4), so they always agree with it.

text: string
opts: BuildMessageOptions

Default: {}

Source: content.ts:821

buildQuery function

function buildQuery(query: Record<string, QueryValue> | undefined): string

Serialize query parameters (03 §2.6 item 4): percent-encoded UTF-8 values, true/false booleans, decimal integers, lists comma-separated in one parameter, and repeatedQuery lists as one parameter per value. null, undefined and empty lists are omitted. Returns '' or a string starting with ?.

query: Record<string, QueryValue> | undefined

Source: core/http.ts:200

buildReactionContent function

function buildReactionContent(target: string, key: string): ReactionContent

Build a ReactionContent (11 §3.7.2), checking the key.

target: string
key: string

Source: content.ts:856

buildSecureEntry function

function buildSecureEntry(p: SecureEntryParams): Promise<SealedPostEntry>

Build the secure carrier of one entry (11 §4.2, §4.3): validate the content object for kind with the secure rules (11 §3, key and sha256 on every file reference), check its content JSON against maxMessageBytes before padding (11 §3.8), seal it with the 14 module (padding every kind to a multiple of 256 bytes, ref = target), and add the cleartext members: the mention hint for message and edit (11 §4.4, honouring mention_hints; mentionAll always truthful) and attachmentIds (11 §4.3). The outbox MUST store the result before the first send and resend it byte for byte within the same epoch (11 §13.4 rule 3, 04 §9.6); send it with MessagesApi.post.

Source: api/messages.ts:221

buildServerProposal function

function buildServerProposal(params: { groupId: string | Uint8Array<ArrayBufferLike>; epoch: number | bigint; body: ServerProposalBody; signer: Ed25519Signer }): Promise<{ message: Uint8Array; ref: Uint8Array }>

Build a server proposal MLSMessage exactly as 13 §6.3 profiles it: mls_public_message, sender external index 0, empty authenticated_data, a Remove or GroupContextExtensions proposal, signed by the external-sender key over FramedContentTBS without a GroupContext, and no membership_tag. Used by test servers; reproduces vector T-PREF (13 §20.7).

params: { groupId: string | Uint8Array<ArrayBufferLike>; epoch: number | bigint; body: ServerProposalBody; signer: Ed25519Signer }

Source: mls/provider.ts:820

buildVaultGeneration function

function buildVaultGeneration(input: { addr: string; igen: number; vgen: number; prevVgen: number; newKey: Uint8Array; linked?: { vgen: number; key: Uint8Array }; grants: VaultGrantInput[]; idStateVer: number; createdBy: string; devcert: string; dsk: Ed25519Signer; linkNonce?: Uint8Array<ArrayBufferLike> }): Promise<VaultGenerationCreate>

Build the body of POST /v1/me/vault/keys for a new generation, signed by this device (08 §10.5).

input: { addr: string; igen: number; vgen: number; prevVgen: number; newKey: Uint8Array; linked?: { vgen: number; key: Uint8Array }; grants: VaultGrantInput[]; idStateVer: number; createdBy: string; devcert: string; dsk: Ed25519Signer; linkNonce?: Uint8Array<ArrayBufferLike> }

Source: api/vault.ts:411

buildWebhookContent function

function buildWebhookContent(text: string): WebhookContent

Build webhook content from text, computing mentions and mentionAll from its tokens (11 §15.4, §3.4).

text: string

Source: api/webhooks.ts:131

bytesToUuid function

function bytesToUuid(bytes: Uint8Array): string

Format 16 bytes as a lowercase hyphenated UUID (03 §8.2 item 1).

bytes: Uint8Array

Source: core/uuidv7.ts:41

callCollapseTopic function

function callCollapseTopic(callId: string): string

The collapse topic of a call's key: call: + callId (19 §10.3).

callId: string

Source: api/push.ts:330

callContextKind function

function callContextKind(ctx: string): CallContextKind | null

The kind of a context reference (ch:…, dm:…, gdm:…), or null for anything else.

ctx: string

Source: calls/continuity.ts:58

callEndedAction function

function callEndedAction(reason: string): "unexpected_drop" | "restart_migration" | "terminal"

How a call.ended reason is handled by a participant (15 §2.4, §10.1): server_restart is an unexpected drop rejoined by a fresh join with create: true; security_upgraded and group_restarted are planned migrations into the new call; everything else, including unknown reasons, is terminal.

reason: string

Source: calls/continuity.ts:185

callFailureReport function

function callFailureReport(b: CallReportBase, data: CallFailureData): DiagnosticReport<CallFailureData>

Build a call_failure report (15 §14.3).

Source: calls/diagnostics.ts:89

callProblem function

function callProblem(code: "call.ended" | "call.moved" | "call.unsupported_context" | "call.not_active" | "call.already_in_call" | "call.full" | "call.rejoin_expired" | "call.rejoin_invalid" | "call.not_participant" | "call.not_permitted" | "call.mls_join_required" | "call.epoch_unknown" | "call.ring_not_allowed" | "call.relay_unavailable" | "relay.ticket_invalid" | "relay.ticket_expired" | "relay.ticket_replayed" | "relay.wrong_relay" | "relay.call_unknown" | "relay.bad_offer" | "relay.overloaded" | "relay.bad_message" | "sfu.not_active" | "sfu.unavailable" | "sfu.bad_sdp" | "sfu.negotiation_conflict" | "sfu.session_unknown", detail?: string, data?: Record<string, unknown>): SloppyVoiceError

Build (not throw) a SloppyVoiceError for a call.*, relay.* or sfu.* code with its registry status, retryable and userAction (15 §16.1). For server, relay and mock implementations.

code: "call.ended" | "call.moved" | "call.unsupported_context" | "call.not_active" | "call.already_in_call" | "call.full" | "call.rejoin_expired" | "call.rejoin_invalid" | "call.not_participant" | "call.not_permitted" | "call.mls_join_required" | "call.epoch_unknown" | "call.ring_not_allowed" | "call.relay_unavailable" | "relay.ticket_invalid" | "relay.ticket_expired" | "relay.ticket_replayed" | "relay.wrong_relay" | "relay.call_unknown" | "relay.bad_offer" | "relay.overloaded" | "relay.bad_message" | "sfu.not_active" | "sfu.unavailable" | "sfu.bad_sdp" | "sfu.negotiation_conflict" | "sfu.session_unknown"
detail?: string
data?: Record<string, unknown>

Source: calls/relay.ts:40

callSummaryReport function

function callSummaryReport(b: CallReportBase, data: CallSummaryData): DiagnosticReport<CallSummaryData>

Build a call_summary report (15 §14.3). Upload only with the full setting.

Source: calls/diagnostics.ts:94

chainAccepts function

function chainAccepts(pin: ChainPinView, metadata: ChainMetadataView, baseUrl: string, nowSec: number): Promise<ChainAcceptance>

chainAccepts(P, M, B) (02 §12.3, PD-02-9, PD-02-15): verify the candidate keyChain forwards from the pin's chain head. Each new element must be signed by a pinned next or active sign key (or a sign key vouched for earlier in the same run) whose kid and thumbprint match the header kid and prev; the run stops at the first element no eligible signer matches, and a bad signature or claim fails the chain. A different element at the pinned head's n is a fork; a chain ending before it is a rollback. Only the highest element's url can bind B.

nowSec is the verifier's time (NumericDate) for the iat ≤ now + 60 s check.

baseUrl: string
nowSec: number

Source: discovery/keychain.ts:163

changeSeqOf function

function changeSeqOf(item: TimelineItem): number

The updatedSeq of a changes-feed item: a Message's updatedSeq, or a SystemItem's seq (11 §7.4).

Source: api/messages.ts:177

channelMatchesPin function

function channelMatchesPin(pin: ChannelSecPin, channel: Pick<Channel, "security" | "securedAt" | "upgradeSeq">): boolean

Whether the server again presents the channel consistently with the pin, which clears a W9 (09 §13.6): security: "secure" with the pinned securedAt and upgradeSeq.

channel: Pick<Channel, "security" | "securedAt" | "upgradeSeq">

Source: api/channels.ts:961

channelSecurityStatus function

function channelSecurityStatus(security: ChannelSecurity | null | undefined): "insecure" | "secure" | "unavailable"

How a client treats a channel's security (09 §6.1): insecure, secure, or unavailable for an unknown value (no posting, no call, no lock, suggest updating the app; never W9).

security: ChannelSecurity | null | undefined

Source: api/channels.ts:154

channelStatementFromChannel function

function channelStatementFromChannel(host: string, channel: Channel, opts?: { cached?: boolean; addressChangedAt?: string | null }): ChannelStatement

A channel statement from a Channel object (response, list entry or channel.* event payload, 09 §13.3).

host: string
channel: Channel
opts: { cached?: boolean; addressChangedAt?: string | null }

Default: {}

Source: api/channels.ts:545

channelStatementFromInvitePreview function

function channelStatementFromInvitePreview(preview: InvitePreview, opts?: { cached?: boolean }): ChannelStatement | null

The channel statement of an invite preview (09 §8.4, §13.3), or null when the preview names no channel. host is the community's domain.

preview: InvitePreview
opts: { cached?: boolean }

Default: {}

Source: api/channels.ts:586

channelStatementFromSecurityChanged function

function channelStatementFromSecurityChanged(host: string, ev: ChannelSecurityChangedEvent, address: string): ChannelStatement

A channel statement from a channel.security_changed payload (09 §14.2). The event doesn't carry the address, so pass the channel's current one.

host: string
address: string

Source: api/channels.ts:569

channelToken function

function channelToken(addr: string): string

Format a channel-reference token for an already canonical channel address (11 §3.4).

addr: string

Source: content.ts:427

checkAbout function

function checkAbout(about: string): void

Count code points and line breaks of an about text against 05 §11.1 (0–190 code points, at most 4 line breaks).

about: string

Source: api/me.ts:30

checkArgon2idParams function

function checkArgon2idParams(kdf: Argon2idParams): Uint8Array

Check an Argon2idParams object against 04 §12.1 and §12.2 before running Argon2id. Throws crypto.unsupported_algorithm when alg isn't argon2id or v isn't 19, and crypto.kdf_params_rejected for any parameter outside the accepted ranges. Returns the salt.

Source: api/backup.ts:344

checkCallSecurity function

function checkCallSecurity(established: "insecure" | "secure", presented: CallSecurity | undefined): CallSecurityCheck

The client's own security check (15 §2.1 item 4, SM-12, D-056): the call's mode comes from the context's mode as the client established it itself (pinned channel/server state, computed DM mode, group DM pin), never from the Call object, a call.ended next or a RelayTicket's sec. Run it before joining and before every automatic rejoin, with every security or sec the server presents (pass 'insecure' for a lease tick without epoch). presented undefined means nothing was presented.

established: "insecure" | "secure"
presented: CallSecurity | undefined

Source: calls/call.ts:127

checkCpaceAd function

function checkCpaceAd(ad: Uint8Array, role: "init" | "resp", did: string): void

Check a received AD: role string, version = 1 and the did the session names for the peer (04 §11.3).

ad: Uint8Array
role: "init" | "resp"
did: string

Source: api/pairing.ts:288

checkCredential function

function checkCredential(credential: { scheme: "Bearer" | "Bot"; token: string }): void

Check a credential before it is put in an Authorization header: a sign-up token goes only to POST /v1/auth/signup (05 §8.2), a bot token only with the Bot scheme and every other Sloppy Voice token never with it (05 §15.4), and a refresh token or code never in a header (05 §7.6, §6.6). Throws sdk.invalid_argument. Tokens that aren't sv-tokens pass unchecked (03 §3.1).

credential: { scheme: "Bearer" | "Bot"; token: string }

Source: auth/oauth.ts:120

checkDeleteMessagesWithinMs function

function checkDeleteMessagesWithinMs(v: number | undefined): void

deleteMessagesWithinMs: absent or 0 for none, otherwise 60,000 to 604,800,000 (10 §8.4).

v: number | undefined

Source: api/moderation.ts:50

checkDeviceInfo function

function checkDeviceInfo(d: SignInDeviceInfo): void

Check SignInDeviceInfo as the server does before consuming a code (05 §7.3, §5.3, §12.6).

Source: auth/oauth.ts:475

checkDeviceName function

function checkDeviceName(name: string): void

Check a device name: 1–64 code points, no control characters (05 §12.2).

name: string

Source: api/devices.ts:25

checkExternalSender function

function checkExternalSender(senders: readonly ExternalSender[], groupHost: string, keys: readonly ExternalSenderKeyInfo[], opts?: { rotation?: boolean }): ExternalSenderCheck

The client check of 13 §6.2 item 2 on a group's external_senders: exactly one entry, whose identity domain equals the group_id's host and whose key equals the hosting server's mls-external-sender key with that ID, with status next, active or retired (or next / active only for the new key of a rotation proposal, 13 §6.2 item 6: pass rotation: true). The exception for a pending rotation proposal signed by an unlisted key is the caller's.

senders: readonly ExternalSender[]
groupHost: string
keys: readonly ExternalSenderKeyInfo[]
opts: { rotation?: boolean }

Default: {}

Source: mls/provider.ts:444

checkGroupContextExtensions function

function checkGroupContextExtensions(exts: readonly MlsExtension[], kind: MlsContextKind): string | null

Check a GroupContext's extension list against 13 §3.5: exactly required_capabilities, external_senders and, for DMs and group DMs only, sv_participants, in ascending type order, with the required_capabilities content of vector T-REQ. Returns null when it passes, else a short reason. The external sender itself is checked with checkExternalSender and sv_participants with decodeSvParticipants.

exts: readonly MlsExtension[]

Source: mls/provider.ts:565

checkGroupIdFor function

function checkGroupIdFor(groupId: string | Uint8Array<ArrayBufferLike>, expected: { host: string; ctx: string; minGeneration?: number }): boolean

The client check of 13 §4.1 rule 4 before using a GroupInfo or Welcome: the group_id must name the hosting server the client resolved itself, the context it asked for, and a generation at least the highest one pinned for that (host, context) pair (13 §4.4). Returns false on any mismatch, which the caller treats as a positive rejection (13 §15.4).

groupId: string | Uint8Array<ArrayBufferLike>
expected: { host: string; ctx: string; minGeneration?: number }

Source: mls/provider.ts:257

checkGroupInfoExtensions function

function checkGroupInfoExtensions(exts: readonly Pick<MlsExtension, "type">[]): string | null

Check a GroupInfo's own extension list against 13 §3.6: exactly ratchet_tree (0x0002) then external_pub (0x0004), nothing else. Returns null when it passes, else a short reason. A receiver MUST reject a GroupInfo that fails (13 §3.6); a Welcome's GroupInfo is no exception.

exts: readonly Pick<MlsExtension, "type">[]

Source: mls/provider.ts:581

checkGroupPin function

function checkGroupPin(pin: MlsGroupPin | null, seen: { generation: number; epoch: number | null }, opts?: { announcedGeneration?: number | null }): MlsGroupPinCheck

The client pin rules of 13 §4.4 for a GroupInfo, Welcome, handshake or GET …/mls status showing (generation, epoch): never a lower generation; a higher generation only after a mls.group_retired event or mls.generation_retired error named it (announcedGeneration, the nextGeneration it carried); and no rollback to a lower epoch within the pinned generation. With no pin yet (pin null) everything passes. The group_id itself is checked with checkGroupIdFor.

pin: MlsGroupPin | null
seen: { generation: number; epoch: number | null }
opts: { announcedGeneration?: number | null }

Default: {}

Source: mls/provider.ts:622

checkKeyPackage function

function checkKeyPackage(kp: ParsedKeyPackage, nowSec: number): Promise<string | null>

Check a KeyPackage against the 13 §9.1 profile at time nowSec (seconds), as the home server does at upload and a client must before adding a claimed KeyPackage (13 §9.6): version, ciphersuite, source key_package, an sv_device credential whose DeviceCertificate names the leaf signature_key as its dsk (07 L2), init_key ≠ encryption_key, neither of them the DeviceCertificate's box key dbk (13 §3.3 item 5), the §3.4 capabilities, empty leaf and KeyPackage extensions, the lifetime rules, and both signatures. Returns null when it passes, else a short reason. The credential chain itself is 07's check.

nowSec: number

Source: mls/provider.ts:1128

checkKeySet function

function checkKeySet(raw: unknown, canonicalDomain: string, nowSec: number): Promise<KeySetCheck>

Check ServerMetadata keys against 02 §11.5 at time nowSec (NumericDate): 1–16 valid keys (ignored keys don't count), no shared kid or thumbprint, every kid under canonicalDomain, exactly one active key per purpose and at most one next, every active key with nbf ≤ now + 60 s and exp > now, retiredAt/rvt where required. A key with d is private_key_published (02 §11.1). Returns the kept keys (unknown-purpose/status keys dropped) with their thumbprints.

raw: unknown
canonicalDomain: string
nowSec: number

Source: discovery/keys.ts:143

checkModeration function

function checkModeration(input: Omit<PermissionInput, "channel">, permission: Permission, target: MemberLike): Refusal | null

Predict the answer to a moderation action on target that needs the community-level permission (kick_members, ban_members, timeout_members, mute_members): checks a, b, c and d of 10 §6.3 with 10 §8.2 rule 1 as the hierarchy check.

input: Omit<PermissionInput, "channel">
permission: Permission
target: MemberLike

Source: permissions.ts:484

checkModerationTarget function

function checkModerationTarget(actor: MemberLike, target: MemberLike, roles: readonly RoleLike[]): Refusal | null

The common target rules of moderation actions (10 §8.2 rule 1): the target isn't the actor (moderation.self_target) and top(actor) > top(target) (moderation.target_protected, data.protected). A target without an active or needs_encryption membership has top 0. Admins are protected from everyone, other admins included.

actor: MemberLike
target: MemberLike
roles: readonly RoleLike[]

Source: permissions.ts:465

checkOverwriteChange function

function checkOverwriteChange(input: Omit<PermissionInput, "channel">, change: OverwriteChange): Refusal | null

Predict the server's answer to setting or removing a channel overwrite by input.member (10 §5, §7.5). input.channel is ignored; the channel is change.overwrites. Order: body rules (core.invalid_request, permission.not_overwritable), visibility (core.not_found), then 10 §6.3: timeout; missing manage_roles in the channel, except that a holder of mute_members there may change only speak_and_share in a member overwrite's deny (403 core.forbidden, data.permission: "manage_roles" otherwise); hierarchy (role.hierarchy) and no escalation (permission.not_held); the new-member restriction.

input: Omit<PermissionInput, "channel">

Source: permissions.ts:714

checkPairingPayload function

function checkPairingPayload(p: PairingPayloadPlaintext, state: VerifiedIdentityState): Promise<void>

The IdentityState checks of 08 §6.7.2 on a decrypted payload: igen is the state's, approverDid is listed active, idc is byte-identical to the state's idc and verifies, the key derived from ik is the certificate's, vaultKeys is non-empty, phrase is 10 bytes and phraseId 16. Throws sdk.verification_failed; on success persist the keys and run 08 §7 E1.

Source: api/pairing.ts:600

checkPermission function

function checkPermission(input: PermissionInput, permission: Permission): Refusal | null

Predict the server's answer to a request that needs permission, using the order of 10 §6.3: a hidden channel is 404 core.not_found; then (a) a timeout, for any permission other than view_channel, is moderation.timed_out; (b) a permission missing from Pbase is 403 core.forbidden with data.permission; (d) a permission removed only by the new-member restriction is moderation.new_member_restricted. Returns null if the request passes these checks. Hierarchy (check c) is checkModerationTarget, checkRoleAction and checkOverwriteChange.

mention_everyone is never refused: without it a post is accepted with mentionAll recorded as false (10 §3.5); use hasPermission for it. A community-scoped permission is tested against the community-level Pbase even when a channel is given (10 §3.2); the channel then only decides visibility.

permission: Permission

Source: permissions.ts:445

checkPlaintextContent function

function checkPlaintextContent(pin: ChannelSecPin | null, community: CommunitySecPin | null, seq: number): { decision: "ok" } | { decision: "fetch_channel" } | { decision: "w9"; w9: W9Finding }

T2 and 09 §13.3 rule 5 for one plaintext (insecure-carrier) content event at seq in channel X, delivered by its server or accepted from this client's own post. Also use it for a call join that returned an insecure call, with seq Infinity.

  • ok: no pin, or pre-upgrade plaintext (seq ≤ upgradeSeq), shown under K3.
  • w9: T2; the content is never shown (09 §13.6 step 3).
  • fetch_channel: a pin without upgradeSeq, or only a community pin: fetch the Channel object, apply it with applyChannelStatement, then call again. Show no plaintext of the channel until then (09 §17.4 #11).
pin: ChannelSecPin | null
community: CommunitySecPin | null
seq: number

Source: api/channels.ts:765

checkPolicyPatch function

function checkPolicyPatch(patch: AntiSpamPolicyPatch): void

Check the constraints of 10 §12.2 that a merge patch can break on its own: ranges of the members it sets, and channel-scoped newMember.restricted names without view_channel. null (delete, back to the default) is always allowed. The server checks the merged result and answers core.invalid_request.

Source: api/moderation.ts:61

checkPostEntry function

function checkPostEntry(ctx: string, entry: PostEntry): void

Check a PostEntry's shape before sending (11 §4.2): mid grammar, a known kind, target present exactly for operations, exactly one of content and sealed, hint members and attachmentIds only on secure carriers, and for a secure carrier the header bindings the server checks (sealed.ctx, sealed.mid, sealed.kind, sealed.ref, 11 §4.3). Throws sdk.invalid_argument.

ctx: string
entry: PostEntry

Source: api/messages.ts:74

checkPresenceUpdate function

function checkPresenceUpdate(body: OwnPresenceUpdate, nowMs?: number): void

Check a PUT /v1/me/presence body (11 §11.2): if any of status, statusText, statusEmoji and clearAt is present, all four are; the status is a known chosen status; statusText is at most 128 scalar values without line breaks; statusEmoji is one emoji; clearAt is a timestamp and, when nowMs is given, at most 30 days ahead. (A clearAt in the past isn't refused here: a copy of the home server's status to another server (11 §11.6 rule 2) may race with its clearing, and clocks differ.) Throws sdk.invalid_argument.

nowMs?: number

Source: api/presence.ts:35

checkQueriedDomain function

function checkQueriedDomain(domain: unknown, opts?: QueriedDomainOptions): string

Check a queried domain (02 §5.1); throws discovery.invalid_domain if it isn't valid.

domain: unknown
opts: QueriedDomainOptions

Default: {}

Source: discovery/domain.ts:66

checkRestoredBackup function

function checkRestoredBackup(payload: KeyBackupPayload, backup: Pick<KeyBackupContent, "phraseId" | "vgen">, state: VerifiedIdentityState, enteredEntropy: Uint8Array): Promise<void>

Restore step R6 (08 §5.8): check a decrypted payload against the account's freshly verified IdentityState and the entered phrase. Throws sdk.verification_failed ("the recovery key belongs to an earlier setup") when the payload's addr isn't the state's sub, its igen isn't current, idc isn't byte-identical to the state's idc or doesn't verify, the key from ik isn't the certificate's key, phrase isn't the entered E, phraseId isn't the object's, or vaultKeys lacks the object's vgen.

backup: Pick<KeyBackupContent, "phraseId" | "vgen">
enteredEntropy: Uint8Array

Source: api/backup.ts:500

checkRoleAction function

function checkRoleAction(input: Omit<PermissionInput, "channel">, action: RoleAction): Refusal | null

Predict the server's answer to a role create, edit, delete, grant or removal by input.member (10 §4.2–§4.4, §7.3, §7.4), in the order of 10 §6.3: timeout, missing manage_roles (and manage_bots for a bot target), then the hierarchy rules (role.hierarchy, permission.not_held), then the new-member restriction. Special cases: stepping down from one's own ordinary role needs no permission (rule 4); the last admin can't step down (role.last_admin, needs the admin role's memberCount); only admins grant admin (403 core.forbidden with data.missingRole); system roles refuse what 10 §4.2 forbids (role.system_role). Returns null when allowed.

The no-escalation rule (10 §4.3 rule 2) is checked against the actor's community-level Pbase.

input: Omit<PermissionInput, "channel">
action: RoleAction

Source: permissions.ts:527

checkRoleReorder function

function checkRoleReorder(input: Omit<PermissionInput, "channel">, order: readonly string[]): Refusal | null

Predict the server's answer to POST /v1/roles/reorder with order (every ordinary role, lowest to highest) by input.member (10 §4.3 rule 5, §7.3): an order whose set differs from the current ordinary roles is 409 core.conflict (refetch and retry); then, in the order of 10 §6.3, a timeout, missing manage_roles (403 core.forbidden), and role.hierarchy when a role at or above top(actor) would change position or a role below it would move to or above it; then the new-member restriction. After the reorder, ordinary roles take positions 1 to n − 2 in order's order. Returns null when allowed.

input: Omit<PermissionInput, "channel">
order: readonly string[]

Source: permissions.ts:652

checkServerKey function

function checkServerKey(raw: unknown, canonicalDomain: string): ServerKeyCheck

Check one element of ServerMetadata keys against the ServerKey profile of 02 §11.1: OKP Ed25519 with a canonical, non-small-order 32-byte x; a server-kid whose domain is canonicalDomain; a known purpose and status (otherwise the key is ignored); integer nbf < exp ≤ nbf + 63,158,400; retiredAt with nbf ≤ retiredAt < exp for a retired key; rvt for a revoked key; alg, if present, EdDSA. Members use, key_ops, x5c, x5t, x5u and jku are ignored and never followed. Returns a clean copy with only profile members.

raw: unknown
canonicalDomain: string

Source: discovery/keys.ts:75

clampFreshnessSec function

function clampFreshnessSec(sec: number): number

Clamp a freshness lifetime to [300 s, 86,400 s] (02 §13.1).

sec: number

Source: discovery/cache.ts:11

classifyEvidence function

function classifyEvidence(input: EvidenceInput): DelegationEvidence

Classify a delegation (02 §9.1): the first of dnssec, same-site, wellknown, dns-only whose test passes. A delegation with source wellknown is never dns-only.

Source: discovery/evidence.ts:198

classifyRejoinFailure function

function classifyRejoinFailure(error: unknown, opts: { ctxKind: CallContextKind; awaitingReadd?: boolean }): RejoinOutcome

Classify a failed join or rejoin by the outcomes table of 15 §10.5, whose rows are matched in order. Keys on code and data, not on retryable alone: call.ended is retryable: false but transient after empty or server_restart in a voice channel, and call.mls_join_required is retryable but terminal while waiting for a re-add.

error: unknown
opts: { ctxKind: CallContextKind; awaitingReadd?: boolean }

Source: calls/continuity.ts:136

classifyTokenResponse function

function classifyTokenResponse(intent: AuthIntent, response: TokenResponse): AuthorizationResult

Classify a code-exchange answer by the authorization's intent (05 §7.3, §8.2). Throws sdk.protocol_violation if the shape doesn't fit the intent.

intent: AuthIntent
response: TokenResponse

Source: auth/oauth.ts:843

classifyTxtRecord function

function classifyTxtRecord(record: TxtRecord): TxtRecordClass

Classify one TXT resource record (02 §3.2 rules 1–4): foreign (ignored), a valid sv1 record with its normalized base URL, or a malformed sv1 record (reason malformed or bad_url).

record: TxtRecord

Source: discovery/record.ts:65

clientUpdateRequired function

function clientUpdateRequired(metadata: Pick<ServerMetadata, "minClient">, implementedVersions?: readonly string[]): boolean

Whether a client that implements implementedVersions must show "update required" for this server (02 §7.4 step 6, 00 §7.8): it implements only versions lower than minClient. This isn't a validation failure; the metadata stays cached.

metadata: Pick<ServerMetadata, "minClient">
implementedVersions: readonly string[]

Source: discovery/metadata.ts:341

collection function

function collection<T>(http: HttpClient, path: string, params: CollectionParams, opts?: RequestOptions): Pager<T, CollectionPage<T>>

Page through a collection by opaque cursor (03 §13.2). Items are yielded in the owner's order; each next page passes the previous nextCursor unchanged, and iteration stops when it is null. Cursors are never built, changed or parsed (03 §13.2 rule 1). An expired cursor fails with 410 core.gone, after which the caller restarts from the first page (03 §13.2 rule 3).

path: string

Source: core/pagination.ts:147

commitSubmissionFor function

function commitSubmissionFor(pending: MlsPendingCommit): Promise<CommitSubmission>

Build the CommitSubmission for a pending commit (13 §7.5, §12.3): its epoch, commit, GroupInfo, Welcome if any, and ekid(epoch + 1) from the pending epoch's exporter (14 §3.1 "pending commits": the key is derived for the ekid only and never stored).

Source: mls/provider.ts:1398

communityListEntryFor function

function communityListEntryFor(community: Community, state: CommunityListState): PutCommunityListEntryRequest

The cached fields of a list entry for a community, from its Community object and the account's membership state (09 §5.1). Use it for the PUT a client MUST make after a join that returned 200 or 202, and to refresh the cache when the name, icon, secure or state changed.

community: Community

Source: api/my-communities.ts:27

communityListEntryFromJoin function

function communityListEntryFromJoin(result: Pick<JoinCommunityResponse, "member" | "community">): PutCommunityListEntryRequest

The list entry to PUT after POST /v1/community/join answered 200 or 202 (a MUST, 09 §5.1): the cached fields from the response's Community, and the state from its member record (active, needs_encryption or pending). Throws sdk.protocol_violation if the record is in any other state, which a 200 or 202 never carries (09 §4.3).

result: Pick<JoinCommunityResponse, "member" | "community">

Source: api/my-communities.ts:43

communityStatementFromCommunity function

function communityStatementFromCommunity(community: Community, opts?: { cached?: boolean }): CommunityStatement

A community statement from a Community object (09 §3.2).

community: Community
opts: { cached?: boolean }

Default: {}

Source: api/channels.ts:800

computeBadge function

function computeBadge(records: Iterable<Pick<NotificationRecord, "state" | "targets" | "silent">>, deviceId: string): number

The badge of an account for one device (19 §15.1): its unread, non-silent records visible to the device, capped at 9,999.

records: Iterable<Pick<NotificationRecord, "state" | "targets" | "silent">>
deviceId: string

Source: api/notifications.ts:919

computeBasePermissions function

function computeBasePermissions(input: PermissionInput): KnownPermission[]

Pbase(m, c): 10 §6.1 steps 1–7, without the state modifiers of step 8. 10 §6.3 tests missing permissions against this set. Result in registry order.

Source: permissions.ts:346

computeDmSecurity function

function computeDmSecurity(input: { kind: DmKind; participants: readonly (DmPartySecurity & { state?: DmParticipationState })[]; wasSecure?: boolean }): "insecure" | "secure"

The security a new or existing DM has, computed from its participants (12 §11.1, D-050). Never chosen.

  • 1:1: secure if both participants' sec is secure, whatever their participation state.
  • Group: secure if wasSecure (the client's secure-state pin, or the hosting server's own record: a group never downgrades, SM-9); otherwise secure if every current participant (reserved, pending, active) is secure. Participants without a state count as current.
input: { kind: DmKind; participants: readonly (DmPartySecurity & { state?: DmParticipationState })[]; wasSecure?: boolean }

Source: api/dms.ts:228

computeLeaseLists function

function computeLeaseLists(seats: readonly LeaseSeatInput[]): { audio: number[]; video: number[]; listeners: number[] }

Compute the lists of a LeaseSnapshot from the seats (15 §4.1): every seat in listeners, audio ⊆ listeners, video ⊆ listeners, ascending without duplicates. Combine with a seq (15 §4.3) to form a snapshot.

seats: readonly LeaseSeatInput[]

Source: calls/lease.ts:269

computePermissions function

function computePermissions(input: PermissionInput): KnownPermission[]

Effective permissions of a member in a channel, or in the community when no channel is given: the algorithm of 10 §6.1 with the state modifiers of 10 §6.2 (timeout: only view_channel remains; mutes: no change; new-member restriction: the policy's restricted names removed). Admins are never affected by modifiers. Unknown permission names are ignored (10 §3.3). The result is in registry order (10 §6.4).

Source: permissions.ts:358

computePlanVersion function

function computePlanVersion(scope: string, cannotFollow: readonly string[]): Promise<string>

Compute an upgrade plan version (09 §10.6): base64url(SHA-256("sv1 upgrade plan" || 0x00 || scope || 0x00 || A_1 || 0x0A || … || A_n || 0x0A)[0..16]). scope is the channel's ch: reference or the server's canonical domain; cannotFollow are the canonical addresses of every account that can't follow, in any order: they are de-duplicated and sorted by UTF-8 bytes here. Returns 22 base64url characters. Test vectors: 09 §17.2.

scope: string
cannotFollow: readonly string[]

Source: api/channels.ts:83

computeVoiceLease function

function computeVoiceLease(callId: string, seat: LeaseSeatInput): VoiceLease

Compute one seat's VoiceLease (15 §4.1). Every seat listens; audio needs speak_and_share and no Mute for everyone, ServerMute or timeout; video needs speak_and_share and no timeout. …BlockedBy names the first blocking input in the order timed_out, no_permission, muted_for_everyone, server_muted.

callId: string

Source: calls/lease.ts:244

contentIssues function

function contentIssues(kind: "message" | "edit" | "reaction" | "delete", content: unknown, opts?: ValidateOptions): ContentIssue[]

Every problem with a content object of kind under the rules of 11 §3 (text, mentions and tokens, reply reference, attachment and thumbnail references, reaction key, target) and, unless skipSize, the size limit of 11 §3.8: the JCS length in either mode, which for a secure carrier is the content JSON this SDK seals. Returns [] for valid content.

kind: "message" | "edit" | "reaction" | "delete"
content: unknown
opts: ValidateOptions

Default: {}

Source: content.ts:701

contentSize function

function contentSize(content: unknown): number

The measured size of an insecure content (11 §3.8): the byte length of its JCS serialization, whatever formatting the request used.

content: unknown

Source: content.ts:103

contextKindOf function

function contextKindOf(ctx: string): NotifyContextKind | null

The context kind a context reference implies: ch: channel, dm: direct, gdm: group (19 §5.2).

ctx: string

Source: api/notifications.ts:387

coreProblem function

function coreProblem(code: "core.invalid_request" | "core.unauthenticated" | "core.token_expired" | "core.forbidden" | "core.not_found" | "core.method_not_allowed" | "core.conflict" | "core.idempotency_conflict" | "core.gone" | "core.too_large" | "core.unsupported_media_type" | "core.too_early" | "core.rate_limited" | "core.unsupported_version" | "core.unsupported_feature" | "core.internal" | "core.unavailable", extra?: Partial<Pick<Problem, "title" | "detail" | "retryAfterMs" | "data" | "status" | "retryable">>): Problem

Build a problem from a core.* registry entry (03 §10.5).

code: "core.invalid_request" | "core.unauthenticated" | "core.token_expired" | "core.forbidden" | "core.not_found" | "core.method_not_allowed" | "core.conflict" | "core.idempotency_conflict" | "core.gone" | "core.too_large" | "core.unsupported_media_type" | "core.too_early" | "core.rate_limited" | "core.unsupported_version" | "core.unsupported_feature" | "core.internal" | "core.unavailable"
extra: Partial<Pick<Problem, "title" | "detail" | "retryAfterMs" | "data" | "status" | "retryable">>

Default: {}

Source: core/errors.ts:205

countScalarValues function

function countScalarValues(s: string): number

Number of Unicode scalar values in s (a lone surrogate counts as one).

s: string

Source: content.ts:40

cpaceAd function

function cpaceAd(role: "init" | "resp", did: string): Uint8Array

CPaceAD { role, 1, did } = 0x08 || role || 0x01 || did (26 bytes, 04 §11.3).

role: "init" | "resp"
did: string

Source: api/pairing.ts:279

cpaceChannelId function

function cpaceChannelId(prsKind: PrsKind, pairingId: string, address: string): Uint8Array

CI = lv_cat("sv1 pair ci", u8(prs_kind), pairing_id, address) (04 §11.3).

prsKind: PrsKind
pairingId: string
address: string

Source: api/pairing.ts:274

cpaceLvCat function

function cpaceLvCat(...parts: Uint8Array<ArrayBufferLike>[]): Uint8Array

lv_cat(...) of the CPace draft: each argument with its LEB128 length prefix.

...parts: Uint8Array<ArrayBufferLike>[]

Source: api/pairing.ts:269

createDeviceProof function

function createDeviceProof(input: CreateDeviceProofInput): Promise<string>

Create a DeviceProof (06 §5.2, §5.3): header {"alg":"EdDSA","typ":"sv-devproof+jwt","kid":<dkf>} and claims {aud, ajti, iat, exp} with exp = iat + 60, signed with the DSK. Create it immediately before the session request; it is used once.

Source: auth/remote.ts:559

createDeviceProofForAssertion function

function createDeviceProofForAssertion(claims: HomeAssertionClaims, resolvedAudience: string, signer: Ed25519Signer, now?: number | Date): Promise<string>

Create the DeviceProof for an assertion this client requested itself, with the checks of 06 §5.3: the assertion has enr: true, its aud equals the canonical domain the client resolved for the remote server, and the signer's key thumbprint equals the assertion's dkf. Throws sdk.invalid_argument otherwise.

resolvedAudience: string
now?: number | Date

Source: auth/remote.ts:576

createPin function

function createPin(candidate: PinCandidate, nowMs: number): Promise<ServerPinRecord>

Create a pin at first contact (02 §10.1): canonical domain, base URL, secure flag, evidence and keys of the result, and chainHead from the last keyChain element (trusted on first use). A first contact is always accepted, at any evidence level (D-074).

candidate: PinCandidate
nowMs: number

Source: discovery/pins.ts:96

createPkce function

function createPkce(random?: RandomSource): Promise<Pkce>

A fresh PKCE pair: the verifier is base64url of 32 random bytes (256 bits, 43 characters), as 05 §6.2 requires and 05 §21.1 shows.

random: RandomSource

Default: randomBytes

Source: auth/oauth.ts:162

createPushToken function

function createPushToken(input: CreatePushTokenInput): Promise<string>

Create the sv-push+jwt a home server sends as Authorization: Bearer on POST {gatewayUrl}/v1/push (19 §11.4, PD-19-3): header {"alg":"EdDSA","typ":"sv-push+jwt","kid":…}, claims iss, aud = normalize(gatewayUrl), htm POST, htu = normalize(gatewayUrl + "/v1/push") (computed from gatewayUrl, never by appending to aud), bh = base64url SHA-256 of the body, iat, exp = iat + 60, and a fresh 16-octet jti. Server side. Gateways verify it with verifyPushToken (19 §11.5 G1 to G10; G11 is theirs).

Source: api/push.ts:499

createS2SToken function

function createS2SToken(input: CreateS2STokenInput): Promise<string>

Create an sv-s2s+jwt request token (06 §8.2) bound to method, normalized target URI, body hash and destination, with exp = iat + 60 and a fresh 16-byte jti. Create a new one for every attempt, retries included (06 §8.6).

Source: auth/remote.ts:776

createState function

function createState(random?: RandomSource): string

A fresh OAuth state: base64url of 32 random bytes, well above the 128 bits 05 §6.2 requires.

random: RandomSource

Default: randomBytes

Source: auth/oauth.ts:168

currentDmHost function

function currentDmHost(entries: readonly Pick<DmIndexEntry, "state" | "host" | "ctx" | "dmState">[], ctx: DmCtx): string | null

Where a client sends requests for an existing DM (12 §4.5): the current host recorded in its non-closed DM index entry for ctx, never a freshly computed rule host. Returns null when it has no such entry (or only closed ones), in which case the client computes the rule (hostFor1to1, hostForGroup).

entries: readonly Pick<DmIndexEntry, "state" | "host" | "ctx" | "dmState">[]
ctx: DmCtx

Source: api/dms.ts:287

decideEpochSwitch function

function decideEpochSwitch(input: EpochSwitchInput): number | null

The server switch rule (15 §9.3). For each pending epoch e: the required set is every connected seat whose device has a leaf in e; e is ready when every required seat has posted epoch_ready for e or later, and due 2,000 ms after its commit was sequenced. Returns the highest ready or due epoch to switch to, or null. Call control evaluates it on every epoch_ready, every seat state change and when a deadline passes.

Source: calls/lease.ts:309

decideT6 function

function decideT6(pin: ChannelSecPin, address: string, answer: T6CheckAnswer, now: string): { pin: ChannelSecPin; w9: W9Finding | null; newConversation: boolean }

Decide T6 from the check's answer (09 §13.4, vectors 09 §17.4 #7, #8, #14, #15):

  • 410: set P.deletedSeenAt; the channel at the address is a new conversation.
  • 404: lost access; no W9.
  • 200 at the resolved address: two channels at one address; W9.
  • 200 and the resolved address is reserved for the pinned channel, or is in P.previousAddresses with a replacedAt less than 90 days ago: the reservation of 09 §6.3 was broken; W9.
  • 200 otherwise: the rename's reservation is over; no W9.

On 200 the pin follows the channel's current address (09 §13.2). The client MUST NOT present the new channel as the pinned one when w9 is set.

address: string
now: string

Source: api/channels.ts:927

decodeBase64Url function

function decodeBase64Url(s: string, byteLength?: number): Uint8Array

Decode strict base64url (00 §7.2, 03 §2.4 item 11). Rejects padding, characters outside the alphabet, white space, impossible lengths and non-canonical encodings whose unused trailing bits aren't zero (RFC 4648 §3.5). Throws SloppyVoiceError sdk.invalid_argument.

If byteLength is given, the decoded value must have exactly that length.

s: string
byteLength?: number

Source: core/base64url.ts:70

decodeDnsMessage function

function decodeDnsMessage(b: Uint8Array): DnsMessage

Decode a DNS response message (RFC 1035 §4.1). Throws on a malformed message.

b: Uint8Array

Source: discovery/doh.ts:104

decodeExtensions function

function decodeExtensions(bytes: Uint8Array): MlsExtension[]

Decode an Extension extensions<V> list (RFC 9420 §13.4).

bytes: Uint8Array

Source: mls/provider.ts:292

decodeExternalSenders function

function decodeExternalSenders(data: Uint8Array): ExternalSender[]

Decode an external_senders extension_data (RFC 9420 §12.1.8.1). Only basic credentials are decoded.

data: Uint8Array

Source: mls/provider.ts:411

decodeInviteCode function

function decodeInviteCode(code: string): bigint

Decode a canonical invite code back to its 60-bit value (inverse of encodeInviteCode).

code: string

Source: api/invites.ts:80

decodeMlsVarint function

function decodeMlsVarint(bytes: Uint8Array, offset?: number): { value: number; size: number }

Decode an RFC 9420 §2.1.2 variable-length integer at offset. Rejects the reserved prefix 11 and non-minimal encodings (RFC 9420 §2.1.2). Returns the value and the number of bytes read.

bytes: Uint8Array
offset: number

Default: 0

Source: mls/provider.ts:55

decodeRecoveryPhraseIndices function

function decodeRecoveryPhraseIndices(indices: readonly number[]): Promise<Uint8Array<ArrayBufferLike> | null>

Decode 8 word indices (08 §4.1 decoding). Returns E, or null when the checksum C = SHA-256(E)[0] fails.

indices: readonly number[]

Source: api/backup.ts:236

decodeSealedPlaintext function

function decodeSealedPlaintext<K extends "message" | "edit" | "reaction" | "delete">(plaintext: Uint8Array, kind: K): ContentByKind[K]

Parse a decrypted SealedMessage plaintext into the content object for kind (11 §3.8, §3.9): exactly one I-JSON object followed only by white space, with no duplicate member names, that is a valid content object for the kind under the receiver checks of 11 §3.9. Anything else throws sdk.verification_failed (shown as "This message can't be shown"). Unknown members are ignored (00 §7.2). Violating characters in text are replaced with U+FFFD (11 §3.2 rule 1).

plaintext: Uint8Array
kind: K

Source: content.ts:165

decodeSvDeviceCredential function

function decodeSvDeviceCredential(credential: Uint8Array): SvDeviceCredential

Decode an MLS Credential of type sv_device (07 §10.1): the same checks as parseSvDeviceCredential of @sloppyvoice/sdk/crypto (type 0xF5A0, minimal vector lengths, 1 to 2,048 bytes of base64url and ., no trailing bytes). Any failure is reported as sdk.protocol_violation with data.reason: 'malformed' (data.check holds the 07 §10.4 result, such as wrong_credential_type), as for every MLS decoder here.

credential: Uint8Array

Source: mls/provider.ts:670

decodeSvParticipants function

function decodeSvParticipants(data: Uint8Array, opts?: SvParticipantsOptions): SvParticipant[]

Decode and validate an sv_participants extension_data (13 §5.1). A receiver MUST reject a value that fails any constraint: this throws sdk.invalid_argument (or sdk.protocol_violation for a broken encoding).

data: Uint8Array
opts: SvParticipantsOptions

Default: {}

Source: mls/provider.ts:533

decodeTxtRdata function

function decodeTxtRdata(data: Uint8Array): Uint8Array<ArrayBufferLike>[]

Split TXT RDATA into its character-strings (RFC 1035 §3.3.14).

data: Uint8Array

Source: discovery/doh.ts:143

decryptKeyBackup function

function decryptKeyBackup(backup: KeyBackupContent, backupKey: Uint8Array): Promise<KeyBackupPayload>

Decrypt a KeyBackup (08 §5.4) and run the reader checks: the payload's addr, igen and phraseId and the thumbprint of the public key derived from ik equal the object's, and the largest vgen in vaultKeys equals the object's vgen. An AEAD failure throws crypto.decrypt_failed ("That recovery key didn't work", 08 §5.8 R5); a failed check throws sdk.verification_failed. An object v other than 1 is unusable (sdk.not_implemented).

backupKey: Uint8Array

Source: api/backup.ts:457

decryptVaultRecord function

function decryptVaultRecord(record: Pick<VaultRecord, "rid" | "type" | "bucket" | "igen" | "vgen" | "ver" | "deleted" | "nonce" | "ct">, keys: { kVid: Uint8Array; kVault: Uint8Array; addr: string; minVer?: number }): Promise<VaultPlaintext | null>

Decrypt a VaultRecord (08 §8.4) with the key of its vgen and run the reader checks: t equals type, rid recomputes from the plaintext, and for a record with a bucket, the bucket recomputes from host and ctx. Returns null for a tombstone or a type this SDK doesn't know (clients ignore unknown types). A failure throws sdk.verification_failed with data.check; the record is ignored and reported as a vault_integrity diagnostic, never shown.

record: Pick<VaultRecord, "rid" | "type" | "bucket" | "igen" | "vgen" | "ver" | "deleted" | "nonce" | "ct">
keys: { kVid: Uint8Array; kVault: Uint8Array; addr: string; minVer?: number }

Source: api/vault.ts:245

defaultWebSocket function

function defaultWebSocket(): WebSocketConstructor

The global WebSocket constructor, or a constructor that throws sdk.invalid_argument on runtimes without one (pass options.WebSocket).

Source: events/websocket.ts:81

deletionReasonOf function

function deletionReasonOf(reason: unknown): "user" | "admin" | "owner" | "unconfirmed"

account.deleted reason for logic: an unknown value is admin (05 §16.3).

reason: unknown

Source: auth/session.ts:710

deriveBackupKey function

function deriveBackupKey(entropy: Uint8Array, kdf: Argon2idParams, addr: string, argon2: Argon2idProvider): Promise<Uint8Array<ArrayBufferLike>>

BK = HKDF-Expand(A, "sv1 backup" || 0x00 || lv(addr), 32) with A = Argon2id(E, salt) (08 §5.3). The parameters are checked before Argon2id runs (04 §12.1 item 1). The caller MAY cache BK.

entropy: Uint8Array
addr: string

Source: api/backup.ts:370

deriveVaultKeys function

function deriveVaultKeys(state: Pick<VaultKeysState, "igen" | "generations">, vgen: number, key: Uint8Array, addr: string): Promise<Map<number, Uint8Array<ArrayBufferLike>>>

Derive older generations from the newest key by opening links downwards, checking each against its kcv (08 §10.2). Returns a map from vgen to key for every generation reachable.

state: Pick<VaultKeysState, "igen" | "generations">
vgen: number
key: Uint8Array
addr: string

Source: api/vault.ts:356

deviceAddedViaOf function

function deviceAddedViaOf(via: unknown): "signup" | "login" | "bot_token"

device.added via for logic: an unknown value is login (05 §18).

via: unknown

Source: auth/session.ts:705

deviceCertificateKeys function

function deviceCertificateKeys(cred: SvDeviceCredential): { dsk: Uint8Array<ArrayBufferLike> | null; dbk: Uint8Array<ArrayBufferLike> | null }

The raw public keys a DeviceCertificate names, read without verifying it: dsk (the Ed25519 DSK, which must equal the leaf signature_key, 13 §3.3 item 2) and dbk (the X25519 box key, which must never be a leaf or KeyPackage key, 13 §3.3 item 5). A missing or malformed JWK gives null. The credential chain itself is 07's check (07 §10.4).

Source: mls/provider.ts:686

devicePlatformOf function

function devicePlatformOf(platform: unknown): "bot" | "desktop" | "web" | "ios" | "android"

DeviceRecord platform for logic: an unknown value is desktop, shown with a generic icon (05 §12.2).

platform: unknown

Source: auth/session.ts:674

deviceStateOf function

function deviceStateOf(state: unknown): "active" | "revoked"

DeviceRecord state for logic: an unknown value is revoked (05 §12.2).

state: unknown

Source: auth/session.ts:679

diagnosticsAllowed function

function diagnosticsAllowed(setting: DiagnosticsSetting, kind: string): boolean

Whether a report of kind may be uploaded under the user's setting (15 §14.2, §14.4): nothing with off; call_summary only with full; every other kind (all of which describe failures) with failures or full.

kind: string

Source: calls/diagnostics.ts:56

discoveryError function

function discoveryError(code: "discovery.invalid_domain" | "discovery.not_found" | "discovery.record_invalid" | "discovery.delegation_conflict" | "discovery.dns_failure" | "discovery.server_unreachable" | "discovery.metadata_invalid" | "discovery.domain_not_served" | "discovery.canonical_mismatch" | "discovery.version_unsupported" | "discovery.forbidden_target" | "discovery.peer_suspended" | "discovery.unknown_key" | "discovery.key_unusable", data?: Record<string, unknown>, options?: DiscoveryErrorOptions): SloppyVoiceError

Build (not throw) a SloppyVoiceError for a discovery.* code with the status, retryable, userAction and retryAfterMs of the 02 §17 registry. data carries the members 02 §17 lists (domain, baseUrl, reason, …); undefined members are dropped.

code: "discovery.invalid_domain" | "discovery.not_found" | "discovery.record_invalid" | "discovery.delegation_conflict" | "discovery.dns_failure" | "discovery.server_unreachable" | "discovery.metadata_invalid" | "discovery.domain_not_served" | "discovery.canonical_mismatch" | "discovery.version_unsupported" | "discovery.forbidden_target" | "discovery.peer_suspended" | "discovery.unknown_key" | "discovery.key_unusable"
data: Record<string, unknown>

Default: {}

options: DiscoveryErrorOptions

Default: {}

Source: discovery/errors.ts:33

discoveryErrorPresentation function

function discoveryErrorPresentation(code: string): DiscoveryErrorPresentation

Map an error code to its user-facing category (02 §5.7, §17). Copy itself is owned by 20.

code: string

Source: discovery/errors.ts:115

discoveryRecordName function

function discoveryRecordName(domain: string): string

The owner name of the discovery record for domain (02 §3.1): _sloppyv.<domain>.

domain: string

Source: discovery/record.ts:25

dmCallPolicy function

function dmCallPolicy(kind: DmKind, _security: DmSecurity, state: DmState): DmCallPolicy

The call policy of a DM (12 §14, §6.2; 15 §7.2 item 1, 17 §13.1). The policy is the same in both security modes; security is accepted so callers can pass the DM as they hold it.

kind: DmKind
_security: DmSecurity
state: DmState

Source: api/dms.ts:664

dmPermissions function

function dmPermissions(opts: { secure: boolean; bot?: boolean }): KnownPermission[]

The permissions every participant has in a DM or group DM, which have no roles (10 §3.4): view_channel, send_messages, add_reactions, attach_files, mention_everyone, speak_and_share, and in a secure one share_history for participants other than bot accounts.

opts: { secure: boolean; bot?: boolean }

Source: permissions.ts:139

dmWarnings function

function dmWarnings(input: DmWarningsInput): DmWarning[]

The persistent DM warnings of 12 §11.6 that depend on a DM's current security: W3, W7 and W9. An insecure participant never sees W3 or W7, and a DM that is upgrading shows neither (it shows the "Setting up encryption…" status line instead, 12 §11.7). Event-driven warnings and markers (W2, W6, G1, G2, K1–K8) come from 07 and the timeline.

Source: api/dms.ts:621

dnsFreshnessSec function

function dnsFreshnessSec(ttlSec: number | undefined): number

Freshness of a TXT delegation (02 §3.5, §13.1): the smallest TTL in the answer, clamped. When the resolver can't report TTLs, the SDK uses the 300 s minimum, so it never caches longer than DNS allowed.

ttlSec: number | undefined

Source: discovery/cache.ts:21

dohTxtResolver function

function dohTxtResolver(options: DohResolverOptions): TxtResolver

A TxtResolver that sends RFC 8484 GET queries (dns parameter, application/dns-message). Network failures, timeouts and non-200 answers are temporary DNS failures (error / timeout).

Source: discovery/doh.ts:245

editMatchesPrevious function

function editMatchesPrevious(edit: Pick<EditContent, "replyTo" | "attachments">, previous: Pick<MessageContent, "replyTo" | "attachments">): boolean

The receiver check of an edit against the message's previous content (11 §3.9, §3.7.1), for when the client still holds that content (the root, or the edit before it): the edit's replyTo equals the previous one member by member, and each of its AttachmentRefs equals one of the previous AttachmentRefs member by member. A secure receiver ignores an edit that fails (11 §3.9); the server checks this itself in insecure contexts (11 §6.2).

edit: Pick<EditContent, "replyTo" | "attachments">
previous: Pick<MessageContent, "replyTo" | "attachments">

Source: content.ts:981

effectiveCalls function

function effectiveCalls(global: Pick<NotificationSettings, "calls">, context: Pick<ContextNotificationSettings, "calls"> | null | undefined): boolean

The effective calls (19 §6.2): context, then global.

global: Pick<NotificationSettings, "calls">
context: Pick<ContextNotificationSettings, "calls"> | null | undefined

Source: api/notifications.ts:747

effectiveChannelKind function

function effectiveChannelKind(kind: ChannelKind | null | undefined): "text" | "voice"

The channel kind a client acts on: unknown is treated as text, with no call (09 §6.1).

kind: ChannelKind | null | undefined

Source: api/channels.ts:145

effectiveChannelMemberState function

function effectiveChannelMemberState(state: ChannelMemberState | null | undefined): "active" | "needs_encryption" | "left"

The channel membership state a client acts on: unknown is treated as left (09 §4.5).

state: ChannelMemberState | null | undefined

Source: api/channels.ts:161

effectiveCommunityListState function

function effectiveCommunityListState(state: CommunityListState | null | undefined): "active" | "needs_encryption" | "pending"

The state shown for a list entry: unknown values are shown as active (09 §5.1).

state: CommunityListState | null | undefined

Source: api/my-communities.ts:54

effectiveCommunityMemberState function

function effectiveCommunityMemberState(state: CommunityMemberState | null | undefined): "active" | "needs_encryption" | "left" | "pending" | "banned"

The community membership state a client acts on: an unknown value is treated as left (09 §4.1).

state: CommunityMemberState | null | undefined

Source: api/community.ts:414

effectiveEveryone function

function effectiveEveryone(ctxKind: NotifyContextKind, global: Pick<NotificationSettings, "everyone">, community: Pick<CommunityNotificationSettings, "everyone"> | null | undefined, context: Pick<ContextNotificationSettings, "everyone"> | null | undefined): boolean

The effective everyone (19 §6.2): context, then (channels) community, then global.

global: Pick<NotificationSettings, "everyone">
community: Pick<CommunityNotificationSettings, "everyone"> | null | undefined
context: Pick<ContextNotificationSettings, "everyone"> | null | undefined

Source: api/notifications.ts:735

effectiveJoinPolicy function

function effectiveJoinPolicy(policy: JoinPolicy | null | undefined): "closed" | "open" | "invite" | "request"

The join policy a client acts on: an unknown value is treated as invite (09 §3.2).

policy: JoinPolicy | null | undefined

Source: api/community.ts:407

effectiveLevel function

function effectiveLevel(ctxKind: NotifyContextKind, global: Pick<NotificationSettings, "channels" | "dms" | "groupDms">, community: Pick<CommunityNotificationSettings, "level"> | null | undefined, context: Pick<ContextNotificationSettings, "level"> | null | undefined): "all" | "mentions" | "nothing"

The effective level (19 §6.2): the context's level unless default; then, for channels, the community's unless default or absent; then the global default for the context kind (channels, dms or groupDms). Unknown stored levels count as mentions (19 §7.1).

global: Pick<NotificationSettings, "channels" | "dms" | "groupDms">
community: Pick<CommunityNotificationSettings, "level"> | null | undefined
context: Pick<ContextNotificationSettings, "level"> | null | undefined

Source: api/notifications.ts:723

effectiveLimit function

function effectiveLimit(limits: ServerLimits | null | undefined, name: "maxRequestBytes" | "maxEventBytes" | "maxSubscriptions" | "maxReplayEvents" | "maxMessageBytes" | "maxAttachmentBytes" | "maxSecureLeaves" | "maxGroupDmParticipants" | "maxDmRequestBytes" | "maxMlsUploadBytes" | "maxFederationEventBytes" | "maxDevices" | "maxLinkedProviders" | "maxAvatarBytes" | "maxBotsPerAccount" | "maxBotTokens" | "maxPushRegistrationsPerDevice"): number

The value of a limit a client relies on: the advertised value if it is an integer of at least the floor, otherwise the floor (03 §16.1 rules 2 and 3). A server must not advertise less than the floor, so a smaller value is ignored.

limits: ServerLimits | null | undefined
name: "maxRequestBytes" | "maxEventBytes" | "maxSubscriptions" | "maxReplayEvents" | "maxMessageBytes" | "maxAttachmentBytes" | "maxSecureLeaves" | "maxGroupDmParticipants" | "maxDmRequestBytes" | "maxMlsUploadBytes" | "maxFederationEventBytes" | "maxDevices" | "maxLinkedProviders" | "maxAvatarBytes" | "maxBotsPerAccount" | "maxBotTokens" | "maxPushRegistrationsPerDevice"

Source: wire/transport.ts:826

effectivePreviews function

function effectivePreviews(previews: PreviewsSetting): "none" | "full" | "sender_only"

The previews display setting as a client acts on it: unknown values are treated as sender_only (19 §7.1, §8.3).

previews: PreviewsSetting

Source: api/notifications.ts:931

effectiveRecordState function

function effectiveRecordState(state: string): "withdrawn" | "unread" | "read" | "dismissed"

A record state as a client acts on it: unknown values are treated as read (19 §8.1).

state: string

Source: api/notifications.ts:926

effectiveStatus function

function effectiveStatus(chosen: ChosenStatus, sessions: readonly PresenceSession[], nowMs: number): EffectiveStatus

The effective status of an account on a server (11 §11.1), evaluated in order: offline when no session had an open event WebSocket within OFFLINE_GRACE (30 s); offline when the chosen status is invisible; dnd; idle when chosen, or when every connected session is idle; otherwise online.

chosen: ChosenStatus
sessions: readonly PresenceSession[]
nowMs: number

Source: api/presence.ts:127

elligator2Curve25519 function

function elligator2Curve25519(uBytes: Uint8Array): Uint8Array

map_to_curve_elligator2 for curve25519 (RFC 9380 §6.7.1, Z = 2), returning the u-coordinate (32 bytes LE).

uBytes: Uint8Array

Source: api/pairing.ts:329

encodeBase64Url function

function encodeBase64Url(bytes: Uint8Array): string

Encode bytes as base64url without padding (00 §7.2). The output is always canonical.

bytes: Uint8Array

Source: core/base64url.ts:15

encodeCapabilities function

function encodeCapabilities(caps?: MlsCapabilities): Uint8Array

Encode a Capabilities struct (RFC 9420 §7.2); defaults to the sv1 set (13 §3.4, vector T-CAP).

caps: MlsCapabilities

Default: SV1_LEAF_CAPABILITIES

Source: mls/provider.ts:318

encodeControlMessage function

function encodeControlMessage<T extends keyof ControlMessages>(t: T, d: ControlMessages[T], extra?: { from?: number; to?: number }): string

Encode an sv-control message (15 §6.5). A client never sets from: the relay ignores it and sets from itself on everything it forwards. Set to for a unicast message such as call.media_feedback. A relay passes from when it forwards a client's message. Throws sdk.invalid_argument for an invalid type or a message over 16 KiB (15 §6.3).

t: T
extra: { from?: number; to?: number }

Default: {}

Source: calls/relay.ts:149

encodeDnsQuery function

function encodeDnsQuery(name: string, qtype?: number): Uint8Array

Encode a DNS query message for name and qtype (RFC 1035 §4.1): ID 0 (RFC 8484 §4.1 asks for 0 to help HTTP caching), RD set, one question of class IN.

name: string
qtype: number

Default: TYPE_TXT

Source: discovery/doh.ts:25

encodeExtension function

function encodeExtension(ext: MlsExtension): Uint8Array

Encode one Extension: uint16 extension_type || opaque extension_data<V> (RFC 9420 §13.4).

Source: mls/provider.ts:278

encodeExtensions function

function encodeExtensions(exts: readonly MlsExtension[]): Uint8Array

Encode an Extension extensions<V> list (RFC 9420 §13.4).

exts: readonly MlsExtension[]

Source: mls/provider.ts:283

encodeExternalSender function

function encodeExternalSender(signatureKey: Uint8Array, identity: string): Uint8Array

Encode one ExternalSender with a basic credential (13 §6.2, vector T-EXT).

signatureKey: Uint8Array
identity: string

Source: mls/provider.ts:400

encodeExternalSenders function

function encodeExternalSenders(senders: readonly ({ signatureKey: Uint8Array; identity: string })[]): Uint8Array

The external_senders extension_data: ExternalSender external_senders<V> with one entry in sv1 (13 §3.5, §6.2).

senders: readonly ({ signatureKey: Uint8Array; identity: string })[]

Source: mls/provider.ts:406

encodeInviteCode function

function encodeInviteCode(value: bigint): string

Encode a 60-bit value as an invite code: 12 Crockford base32 characters, 5 bits each, most significant first (09 §8.2, test vectors 09 §17.1).

value: bigint

Source: api/invites.ts:70

encodeMlsVarint function

function encodeMlsVarint(n: number): Uint8Array

Encode a vector length as the RFC 9420 §2.1.2 variable-length integer: 1, 2 or 4 bytes, always minimal (13 §2.1, test vector T-VAR of 13 §20.1).

n: number

Source: mls/provider.ts:44

encodeOAuthForm function

function encodeOAuthForm(params: object): string

Serialize OAuth parameters as application/x-www-form-urlencoded (05 §7.1, RFC 6749 Appendix B). undefined members are left out; booleans become the literals true and false (05 §7.3 shared_computer).

params: object

Source: auth/oauth.ts:318

encodeOpaqueV function

function encodeOpaqueV(bytes: Uint8Array): Uint8Array

opaque x<V>: the varint length followed by the bytes (RFC 9420 §2.1.2).

bytes: Uint8Array

Source: mls/provider.ts:69

encodePairingQr function

function encodePairingQr(p: PairingQrPayload): string

Encode "SVPAIR1:" || base32(pair-bin) (08 §6.3.1), shown in QR alphanumeric mode, error correction M.

Source: api/pairing.ts:105

encodePathSegment function

function encodePathSegment(param: string | number): string

Percent-encode one path segment (03 §2.6 item 2): every character outside RFC 3986 pchar is percent-encoded as UTF-8, so : in a context reference such as ch:… (03 §2.6 item 1) and @ in an address such as carol@c.com (10 §7.5) are sent as they are, while /, ?, #, %, spaces and non-ASCII are encoded. The dot segments . and .. are rejected: the WHATWG URL parser treats %2e and %2e%2e as dot segments too, so no encoding keeps them. An empty segment, or a string with a lone surrogate, is rejected as well.

param: string | number

Source: core/http.ts:160

encodePushPayload function

function encodePushPayload(h: string, r: string): string

Serialize the push payload in its one fixed form {"v":1,"h":"…","r":"…"}, no white space, members in this order, always 93 octets (19 §10.1, PD-19-1). h is the NotificationRecord ID, r the PushRegistration ID, both lowercase hyphenated UUIDs.

h: string
r: string

Source: api/push.ts:288

encodeRecoveryPhrase function

function encodeRecoveryPhrase(entropy: Uint8Array): Promise<string>

The canonical text form of the recovery phrase for E: 8 lowercase words, single spaces (08 §4.1, §4.2).

entropy: Uint8Array

Source: api/backup.ts:228

encodeRequiredCapabilities function

function encodeRequiredCapabilities(): Uint8Array

The required_capabilities extension_data of every sv1 group (13 §3.5, vector T-REQ): extension_types = [0xF5A1], proposal_types = [], credential_types = [0x0001, 0xF5A0].

Source: mls/provider.ts:376

encodeSealedPlaintext function

function encodeSealedPlaintext(content: ContentObject, maxBytes?: number): Uint8Array

Encode a content object as the padded plaintext of a SealedMessage (11 §3.8, 14 §4.5): its UTF-8 JSON (here JCS, which 11 allows but doesn't require), checked against maxMessageBytes before padding, then padded with spaces. Throws sdk.invalid_argument with reason: "too_large" instead of sending a longer one (11 §3.8).

content: ContentObject
maxBytes: number

Source: content.ts:143

encodeSvParticipants function

function encodeSvParticipants(participants: readonly SvParticipant[], opts?: SvParticipantsOptions): Uint8Array

Encode the sv_participants extension_data (13 §5.1, vector T-SVP). The entries are sorted by address in ascending byte order first; duplicates, bad lengths and non-canonical addresses are rejected with sdk.invalid_argument.

participants: readonly SvParticipant[]
opts: SvParticipantsOptions

Default: {}

Source: mls/provider.ts:520

encryptKeyBackup function

function encryptKeyBackup(input: { backupKey: Uint8Array; payload: KeyBackupPayload; kdf: Argon2idParams; nonce?: Uint8Array<ArrayBufferLike>; random?: RandomSource }): Promise<KeyBackupContent>

Encrypt a backup payload into the client members of a KeyBackup (08 §5.1, §5.4). addr, igen, phraseId and vgen (the largest generation in vaultKeys) come from the payload; ikf is computed from its ik. The payload is serialized with JSON.stringify in its member order. Clients keep ct within 16 KiB (08 §16.1).

input: { backupKey: Uint8Array; payload: KeyBackupPayload; kdf: Argon2idParams; nonce?: Uint8Array<ArrayBufferLike>; random?: RandomSource }

Source: api/backup.ts:423

encryptVaultRecord function

function encryptVaultRecord(input: EncryptVaultRecordInput): Promise<VaultRecordWrite>

Encrypt a record for PUT /v1/me/vault/records (08 §8.4): rid and bucket computed from the plaintext (08 §8.5), ct = AEAD-Seal(K_rec(vgen, rid), nonce, plaintext, AAD) bound to the version ifVer + 1 the write creates. Clients keep a record within 4 KiB (08 §16.1).

Source: api/vault.ts:221

epochAckFor function

function epochAckFor(group: MlsGroupHandle): Promise<EpochAck>

Build the EpochAck for a group's current epoch: {epoch, ekid, extPub} (13 §7.8, §14.2).

Source: mls/provider.ts:1389

epochSwitchFromTick function

function epochSwitchFromTick(tick: LeaseSnapshot, sendingEpoch: number | null): number | null

Client side of 15 §9.4: a tick whose epoch is higher than the epoch the client sends with counts exactly as a call.epoch_switch for that epoch. Returns the epoch switched to, or null (a switch to an epoch already passed is ignored).

sendingEpoch: number | null

Source: calls/lease.ts:327

evaluateNotificationSettings function

function evaluateNotificationSettings(input: SettingsEvaluationInput): SettingsEvaluation

Evaluate the user's notification settings for an accepted notify.event of a message kind or call_ring, or for a home-local record (19 §6.2, §6.5), returning drop, silent or notify and the notification as it is to be stored.

Message kinds and call_ring follow rules H1–H9 in order, with H4 evaluated per item (items whose own kind is dropped are removed and the record recomputed). Home-local kinds follow 19 §6.5: dm_request honours only H1 and H8; pairing_request and test ignore every setting; account_alert ignores H1–H5, and for code W4a also H8; call_missed is silent when a call_ring would be. call_ring_ended and withdrawn create no record and are rejected.

Unknown kinds throw sdk.invalid_argument: a receiver answers ignored before settings apply.

Source: api/notifications.ts:821

evaluatePinChange function

function evaluatePinChange(pin: ServerPinRecord, candidate: PinCandidate, nowMs: number): Promise<PinEvaluation>

Compare a successful resolution R with the pin P for its domain using every rule of 02 §10.2 (with chainAccepts, 02 §12.3): status and time changes, disappeared and revoked keys are always accepted; an un-revoked key and a secure downgrade never are; a canonical-domain change is never accepted when P.canonicalDomain = D; new keys need continuity or strong evidence; a base-URL change needs a URL-bound rotation or strong evidence; a fork needs strong evidence. chainHead is updated as 02 §10.2 says. Pure: storing the result is the caller's job.

candidate: PinCandidate
nowMs: number

Source: discovery/pins.ts:157

eventsUrl function

function eventsUrl(baseUrl: string): string

The event WebSocket URL for a base URL: {base}/v1/events with the https scheme replaced by wss (03 §5.1 item 1). For https://chat.sloppyvoice.com/server it returns wss://chat.sloppyvoice.com/server/v1/events.

Throws sdk.invalid_argument if the base URL isn't https (03 §2.2 item 1: never plain ws:) or carries a query or fragment (03 §2.1 item 1, §5.1 item 1). A trailing slash on the base URL is removed (03 §2.1 item 1).

baseUrl: string

Source: events/websocket.ts:96

exceedsBytes function

function exceedsBytes(s: string, maxBytes: number): boolean

Whether a text message exceeds maxBytes UTF-8 bytes (03 §5.2 item 4). A string never has more UTF-16 code units than UTF-8 bytes, so long strings are rejected and short ones accepted without counting.

s: string
maxBytes: number

Source: events/websocket.ts:141

exportHistoryKey function

function exportHistoryKey(source: MlsExporter): Promise<Uint8Array<ArrayBufferLike>>

K_hist(e) = MLS-Exporter("sv1 history", "", 32) (14 §3.1).

source: MlsExporter

Source: mls/provider.ts:1369

extensionsAcceptable function

function extensionsAcceptable(extensions: string | null | undefined): boolean

Whether a negotiated Sec-WebSocket-Extensions value is acceptable: either no permessage-deflate, or permessage-deflate with both server_no_context_takeover and client_no_context_takeover (03 §5.1 item 6, §18.5).

extensions: string | null | undefined

Source: events/websocket.ts:152

externalSenderIdentity function

function externalSenderIdentity(domain: string, keyId: string): string

The basic credential identity of the hosting server's external sender: "<domain>#<keyId>" (13 §6.2 item 1).

domain: string
keyId: string

Source: mls/provider.ts:395

extPubHash function

function extPubHash(externalPub: Uint8Array): Promise<string>

base64url SHA-256 of an external_pub key: the extPub of EpochAck (13 §7.8).

externalPub: Uint8Array

Source: mls/provider.ts:1384

extractMentions function

function extractMentions(text: string, opts?: { isCanonicalAddress?: MentionAddressCheck }): ExtractedMentions

Extract mentions, mentionAll and channel references from text (11 §3.4). The result is what content.mentions and content.mentionAll MUST be, and what a receiver of a secure message treats as authoritative (11 §3.4 rule 4).

text: string
opts: { isCanonicalAddress?: MentionAddressCheck }

Default: {}

Source: content.ts:407

fcmPushMessage function

function fcmPushMessage(type: PushType, token: string, payload: string, ttlMs: number, collapseKey?: string): string

The FCM HTTP v1 request body for a push (19 §10.2): data-only, the serialized payload as the string data.sv, android.priority HIGH for alert and call and NORMAL for background, android.ttl from ttlMs rounded up to whole seconds, and android.collapse_key only for background (FCM keeps at most four collapse keys per device). Gateway side.

type: PushType
token: string
payload: string
ttlMs: number
collapseKey?: string

Source: api/push.ts:460

federationError function

function federationError(code: "federation.audience_is_home" | "federation.blocked" | "federation.assertion_invalid" | "federation.assertion_replayed" | "federation.wrong_audience" | "federation.device_proof_required" | "federation.device_proof_invalid" | "federation.identity_mismatch" | "federation.issuer_unreachable" | "federation.session_ended" | "federation.home_unreachable" | "federation.home_reachable" | "federation.extension_limit" | "federation.s2s_unauthenticated" | "federation.not_authorized" | "federation.batch_invalid" | "federation.event_invalid" | "federation.event_too_large" | "federation.event_not_authorized" | "federation.event_expired", data?: Record<string, unknown>, detail?: string): SloppyVoiceError

Build (not throw) a SloppyVoiceError for a federation.* code with the registry's status, retryable and userAction (06 §16). For federation.session_ended, retryable is data.retry and userAction is retry when it is true, otherwise none (06 §6.8).

code: "federation.audience_is_home" | "federation.blocked" | "federation.assertion_invalid" | "federation.assertion_replayed" | "federation.wrong_audience" | "federation.device_proof_required" | "federation.device_proof_invalid" | "federation.identity_mismatch" | "federation.issuer_unreachable" | "federation.session_ended" | "federation.home_unreachable" | "federation.home_reachable" | "federation.extension_limit" | "federation.s2s_unauthenticated" | "federation.not_authorized" | "federation.batch_invalid" | "federation.event_invalid" | "federation.event_too_large" | "federation.event_not_authorized" | "federation.event_expired"
data?: Record<string, unknown>
detail?: string

Source: auth/remote.ts:104

fetchMetadata function

function fetchMetadata(baseUrl: string, opts?: FetchMetadataOptions): Promise<MetadataFetch>

GET {base}/meta (02 §7.1, §5.2 step 7): no Authorization, no redirects (a 3xx is discovery.metadata_invalid with reason: redirect), 10 s in total, at most 262,144 octets (too_large). Connection failures, timeouts, 5xx and 429 are discovery.server_unreachable; any other non-200 status is discovery.metadata_invalid with data.status. Validation of the body is validateServerMetadata's job.

baseUrl: string
opts: FetchMetadataOptions

Default: {}

Source: discovery/fetch.ts:234

fetchWellKnown function

function fetchWellKnown(domain: string, opts?: FetchWellKnownOptions): Promise<WellKnownFetch>

GET https://D/.well-known/sloppyv (02 §4.2): HTTPS only, at most 3 redirects (each HTTPS; a fourth, a non-HTTPS hop or a loop means absent), no Content-Type check, 10 s in total, at most 4,096 octets. Outcomes: present (200 and a valid body), invalid (200 and an invalid body), absent (404, 410, a redirect failure, or D has no address) or unavailable (connection, timeout, TLS, 429, 5xx, any other status).

In browsers redirect: "manual" hides redirect targets; the SDK then lets the browser follow them and accepts the result only if the final URL is HTTPS (it can't count hops there).

domain: string
opts: FetchWellKnownOptions

Default: {}

Source: discovery/fetch.ts:111

findTokens function

function findTokens(text: string, opts?: { isCanonicalAddress?: MentionAddressCheck }): TextToken[]

Find the mention and channel tokens of text outside code spans, fenced code blocks and backslash escapes (11 §3.4 rules 1 to 3). A <@…> or <#…> whose address isn't canonical is literal text, not a token.

text: string
opts: { isCanonicalAddress?: MentionAddressCheck }

Default: {}

Source: content.ts:351

fitDiagnosticReport function

function fitDiagnosticReport<D extends { samples?: CallSample[] }>(report: DiagnosticReport<D>): DiagnosticReport<D>

Keep a report within 64 KiB (15 §14.3): after the caller has applied the upload bounds of 16 §13 (audio) and 17 §14 (video), omit the oldest Samples until it fits. Throws sdk.invalid_argument if it can't fit even without samples.

report: DiagnosticReport<D>

Source: calls/diagnostics.ts:106

formatAuthorization function

function formatAuthorization(scheme: AuthScheme, token: string): string

Build an Authorization header value, Bearer <token> or Bot <token>, with the scheme spelled exactly as 03 §3.1 recommends. Throws sdk.invalid_argument if the token breaks the credentials grammar, so a malformed token is never put on the wire.

scheme: AuthScheme
token: string

Source: core/auth.ts:63

formatInviteCode function

function formatInviteCode(code: string): string

The display form of a code, three groups of four: 7KQ2-M9XP-4HRT (sv-invite-display, 09 §8.2). Accepts any input form; throws sdk.invalid_argument for an invalid code.

code: string

Source: api/invites.ts:58

formatPairingCode function

function formatPairingCode(code: string): string

The display form "042 917" (08 §6.3.2).

code: string

Source: api/pairing.ts:154

generateInviteCode function

function generateInviteCode(random?: RandomSource): string

Generate a fresh invite code from 60 CSPRNG bits (09 §8.2). Servers (and the SDK's mock server) use it; clients never make up codes.

random: RandomSource

Default: randomBytes

Source: api/invites.ts:92

generatePairingCode function

function generatePairingCode(random?: RandomSource): string

Draw the 6-digit code uniformly: a 32-bit r, redrawn while r ≥ 4,294,000,000, then r mod 1,000,000 (08 §6.3.2).

random: RandomSource

Default: cryptoRandomBytes

Source: api/pairing.ts:145

generatePairingSecret function

function generatePairingSecret(random?: RandomSource): Uint8Array

A fresh 16-byte QR secret (08 §6.3).

random: RandomSource

Default: cryptoRandomBytes

Source: api/pairing.ts:137

generatePhrase function

function generatePhrase(random?: RandomSource): { entropy: Uint8Array; phraseId: Uint8Array }

Draw a new phrase entropy E (10 bytes) and its phrase ID (16 bytes) from the CSPRNG (08 §3.3 U2, §4.6).

random: RandomSource

Default: cryptoRandomBytes

Source: api/backup.ts:212

generateVaultKey function

function generateVaultKey(random?: RandomSource): Uint8Array

Generate a new 32-byte vault key or K_vid from the CSPRNG (08 §3.3 U2, §10.5.2 V4).

random: RandomSource

Default: cryptoRandomBytes

Source: api/vault.ts:179

grantCovering function

function grantCovering(state: Pick<HistoryState, "visibleFromSeq" | "grants">, seq: number): VisibilityGrantSummary | null

The grant that covers seq below visibleFromSeq, for placing K7 (14 §7.9, §10.3), or null.

state: Pick<HistoryState, "visibleFromSeq" | "grants">
seq: number

Source: api/history.ts:88

groupBootstrapFor function

function groupBootstrapFor(generation: number, group: MlsGroupHandle): Promise<GroupBootstrap>

Build the GroupBootstrap for a freshly created epoch-0 group (13 §7.4, §10.1 item 3).

generation: number

Source: mls/provider.ts:1410

groupIdBytes function

function groupIdBytes(groupId: string): Uint8Array

The MLS group_id bytes: the UTF-8 encoding of the string (13 §4.1).

groupId: string

Source: mls/provider.ts:246

groupNameProblem function

function groupNameProblem(name: string): string | null

Check a group DM name (12 §6.1): 1 to 100 Unicode scalar values, at most 400 UTF-8 bytes, NFC, no control characters (Cc), and no leading or trailing white space. Returns the problem, or null.

name: string

Source: api/dms.ts:448

hasFeature function

function hasFeature(metadata: Pick<ServerMetadata, "features">, feature: string): boolean

Whether the server's metadata lists feature (03 §12.2).

metadata: Pick<ServerMetadata, "features">
feature: string

Source: discovery/metadata.ts:394

hasForbiddenTextChars function

function hasForbiddenTextChars(text: string): boolean

Whether text contains a character 11 §3.2 rule 1 forbids.

text: string

Source: content.ts:199

hasPermission function

function hasPermission(input: PermissionInput, permission: Permission): boolean

Whether the member effectively holds permission (10 §6.1). A community-scoped permission is evaluated at community level even when input.channel is given, because overwrites can't change it and the channel-level output of 10 §6.1 holds only channel-scoped names (10 §3.2).

permission: Permission

Source: permissions.ts:378

hasSv1Capabilities function

function hasSv1Capabilities(caps: MlsCapabilities): boolean

Whether caps carries the capabilities 13 §3.4 requires: mls10, ciphersuite 0x0001, extension 0xF5A1 (and no default extension type), credentials basic and sv_device, and an empty proposals list. GREASE values (RFC 9420 §13.5) are ignored everywhere.

Source: mls/provider.ts:358

highestPriorityKind function

function highestPriorityKind(kinds: Iterable<string>): MessageNotificationKind

The highest-priority kind, in the order mention > reply > mention_all > dm_message (19 §4.1, §4.5). Unknown kinds count as dm_message. Throws on an empty list.

kinds: Iterable<string>

Source: api/notifications.ts:376

honoursMentionAll function

function honoursMentionAll(content: Pick<MessageContent, "text" | "mentionAll">, validatedMentionAll: boolean): boolean

Whether <@everyone> in a received message should be honoured (11 §3.9, §4.4): only when the content says so and the server-validated mentionAll of the Message object (or edit) is true.

content: Pick<MessageContent, "text" | "mentionAll">
validatedMentionAll: boolean

Source: content.ts:914

hostFor1to1 function

function hostFor1to1(a: string, b: string, isSecureServer: IsSecureServer): string

host_1to1(A, B) (12 §4.2): the hosting server of a 1:1 DM. It depends only on the two canonical addresses (in either order) and their homes' secure flags: if exactly one home is a secure server, the other one; otherwise the home of the participant who sorts first byte-wise.

Throws dm.invalid_participants (reason self) when A == B. Callers MUST canonicalize first (12 §4.1 item 1); obviously non-canonical input throws sdk.invalid_argument.

a: string
b: string
isSecureServer: IsSecureServer

Source: api/dms.ts:205

hostForGroup function

function hostForGroup(creator: DmPartySecurity, others: readonly DmPartySecurity[], isSecureServer: IsSecureServer, security?: "insecure" | "secure"): string

host_group(C, Ps, security) (12 §4.3): the hosting server of a new group DM.

  • a secure group, or a creator whose home isn't a secure server: the creator's home;
  • otherwise, in byte-wise order of all participants, the home of the first insecure participant whose home isn't a secure server; failing that, the first home that isn't a secure server;
  • if every home is a secure server, throws dm.encryption_pending with data.waitingFor listing the insecure participants (12 §13.2): retryable, the registration is kept.

security defaults to computeDmSecurity over the creator and others. The creator is the account that sends POST /v1/dms, also for a successor (12 §4.3).

others: readonly DmPartySecurity[]
isSecureServer: IsSecureServer
security?: "insecure" | "secure"

Source: api/dms.ts:261

httpFreshnessSec function

function httpFreshnessSec(headers: Headers, nowMs: number): number

Freshness of an HTTP response (.well-known, /meta; 02 §4.2, §13.1): Cache-Control: max-age, else Expires (relative to Date, or to nowMs), else 3,600 s; then clamped to [300 s, 86,400 s].

headers: Headers
nowMs: number

Source: discovery/cache.ts:29

ikfFromSeed function

function ikfFromSeed(seed: Uint8Array): Promise<string>

The RFC 7638 thumbprint (ikf) of the public key of a 32-byte identity-key seed.

seed: Uint8Array

Source: api/backup.ts:412

interpretAddressResponse function

function interpretAddressResponse(msg: DnsMessage, qname: string, qtype: number): AddressLookupResult

Read an A or AAAA answer (RFC 1035): present when the final owner after CNAMEs has a record of qtype, absent for NXDOMAIN or NODATA, unknown for anything else.

qname: string
qtype: number

Source: discovery/doh.ts:212

interpretTxtResponse function

function interpretTxtResponse(msg: DnsMessage, qname: string): TxtLookupResult

Interpret a DNS response to a TXT query for qname (02 §3.4, §3.5): follow the CNAME chain (more than 8 links is a temporary failure), collect the TXT RRset of the final owner, and take the smallest TTL over the chain and the RRset. NXDOMAIN and NODATA carry the negative TTL from the SOA in the authority section (RFC 2308: the smaller of the SOA TTL and its MINIMUM). Never reports DNSSEC validation.

qname: string

Source: discovery/doh.ts:162

isAdmin function

function isAdmin(member: MemberLike, roles: readonly RoleLike[]): boolean

Whether member holds the system admin role (10 §4.2) and is a member (10 §6.1 steps 1–2).

member: MemberLike
roles: readonly RoleLike[]

Source: permissions.ts:242

isBase64Url function

function isBase64Url(s: unknown, byteLength?: number): s is string

Whether s is strict, canonical base64url without padding (00 §7.2, 03 §2.4 item 11), optionally of exactly byteLength decoded bytes.

s: unknown
byteLength?: number

Source: core/base64url.ts:56

isBlankText function

function isBlankText(text: string): boolean

Whether text counts as empty: empty or white space only (11 §3.2 rule 3).

text: string

Source: content.ts:225

isBotToken function

function isBotToken(token: unknown): token is string

Whether token is a well-formed bot token: svb_ + 43 base64url characters (05 §7.4, §15.4).

token: unknown

Source: auth/bots.ts:21

isCanonicalInviteCode function

function isCanonicalInviteCode(s: unknown): s is string

Whether s is a canonical invite code, sv-invite-code (09 §2).

s: unknown

Source: api/invites.ts:49

isChannelRef function

function isChannelRef(s: unknown): s is `ch:${string}`

Whether s is a channel reference ch:<uuid7> (03 §8.3). The prefix is case-sensitive.

s: unknown

Source: wire/transport.ts:300

isChannelScoped function

function isChannelScoped(name: string): boolean

Whether a permission is channel-scoped, i.e. may appear in an overwrite (10 §3.2).

name: string

Source: permissions.ts:119

isClientId function

function isClientId(s: unknown): s is string

Whether s is a valid client_id (05 §5.1): the loopback client ID, or an HTTPS URL without query, fragment or userinfo.

s: unknown

Source: auth/oauth.ts:180

isCodeVerifier function

function isCodeVerifier(s: unknown): s is string

Whether s is a valid code verifier: 43–128 characters of [A-Za-z0-9-._~] (05 §6.2, RFC 7636 §4.1).

s: unknown

Source: auth/oauth.ts:146

isCommunityMember function

function isCommunityMember(state: CommunityMemberState | null | undefined): boolean

Whether a CommunityMember state counts as "community member": active or needs_encryption (09 §2).

state: CommunityMemberState | null | undefined

Source: api/community.ts:428

isControlMessageType function

function isControlMessageType(t: unknown): t is string

Whether t matches the msg-type ABNF of 15 §6.5.

t: unknown

Source: calls/relay.ts:87

isCtxRef function

function isCtxRef(s: unknown): s is CtxRef

Whether s is a context reference (ctx-ref, 03 §8.3). me and community are not.

s: unknown

Source: wire/transport.ts:315

isCurrentParticipant function

function isCurrentParticipant(state: DmParticipationState, kind: DmKind): boolean

Whether a participant in state is a current participant (12 §2.1): reserved, pending or active; in a 1:1 DM, declined too.

kind: DmKind

Source: api/dms.ts:130

isDefinitiveDiscoveryFailure function

function isDefinitiveDiscoveryFailure(e: unknown): boolean

Whether e is a definitive failure of 02 §13.2, which discards the cached result and creates a negative entry.

e: unknown

Source: discovery/errors.ts:100

isDeviceId function

function isDeviceId(s: unknown): s is string

Whether s is a well-formed device ID did: 22 base64url characters encoding 16 bytes (05 §12.4, §21.3).

s: unknown

Source: auth/oauth.ts:104

isDiscoveryError function

function isDiscoveryError(e: unknown, codes?: "discovery.invalid_domain" | "discovery.not_found" | "discovery.record_invalid" | "discovery.delegation_conflict" | "discovery.dns_failure" | "discovery.server_unreachable" | "discovery.metadata_invalid" | "discovery.domain_not_served" | "discovery.canonical_mismatch" | "discovery.version_unsupported" | "discovery.forbidden_target" | "discovery.peer_suspended" | "discovery.unknown_key" | "discovery.key_unusable" | readonly ("discovery.invalid_domain" | "discovery.not_found" | "discovery.record_invalid" | "discovery.delegation_conflict" | "discovery.dns_failure" | "discovery.server_unreachable" | "discovery.metadata_invalid" | "discovery.domain_not_served" | "discovery.canonical_mismatch" | "discovery.version_unsupported" | "discovery.forbidden_target" | "discovery.peer_suspended" | "discovery.unknown_key" | "discovery.key_unusable")[]): e is SloppyVoiceError

Whether e is a discovery.* error (optionally one of codes).

e: unknown
codes?: "discovery.invalid_domain" | "discovery.not_found" | "discovery.record_invalid" | "discovery.delegation_conflict" | "discovery.dns_failure" | "discovery.server_unreachable" | "discovery.metadata_invalid" | "discovery.domain_not_served" | "discovery.canonical_mismatch" | "discovery.version_unsupported" | "discovery.forbidden_target" | "discovery.peer_suspended" | "discovery.unknown_key" | "discovery.key_unusable" | readonly ("discovery.invalid_domain" | "discovery.not_found" | "discovery.record_invalid" | "discovery.delegation_conflict" | "discovery.dns_failure" | "discovery.server_unreachable" | "discovery.metadata_invalid" | "discovery.domain_not_served" | "discovery.canonical_mismatch" | "discovery.version_unsupported" | "discovery.forbidden_target" | "discovery.peer_suspended" | "discovery.unknown_key" | "discovery.key_unusable")[]

Source: discovery/errors.ts:82

isDmRef function

function isDmRef(s: unknown): s is `dm:${string}`

Whether s is a 1:1 DM reference dm:<b64u-128> (03 §8.3). Format only; 12 checks that it is the right DM ID.

s: unknown

Source: wire/transport.ts:305

isFeatureName function

function isFeatureName(s: unknown): s is FeatureName

Whether s matches the feature grammar of 03 §12.2 (at most 64 characters).

s: unknown

Source: wire/transport.ts:725

isGreaseValue function

function isGreaseValue(v: number): boolean

Whether a 16-bit value is an RFC 9420 §13.5 GREASE value (0x0A0A, 0x1A1A, … 0xEAEA), which receivers ignore in capability lists (13 §3.4).

v: number

Source: mls/provider.ts:346

isGroupDmRef function

function isGroupDmRef(s: unknown): s is `gdm:${string}`

Whether s is a group DM reference gdm:<uuid7> (03 §8.3).

s: unknown

Source: wire/transport.ts:310

isHomeLocalKind function

function isHomeLocalKind(kind: unknown): boolean

Whether kind is a home-local kind, which a hosting server never sends (19 §5.3).

kind: unknown

Source: api/notifications.ts:363

isHttpsUrl function

function isHttpsUrl(s: unknown, maxOctets?: number): s is string

Whether s is an absolute https URL of at most maxOctets octets.

s: unknown
maxOctets: number

Default: DISCOVERY_LIMITS.maxUrlMemberBytes

Source: discovery/metadata.ts:52

isIdempotencyKey function

function isIdempotencyKey(s: unknown): s is string

Whether s is a valid Idempotency-Key value: the bare key or its quoted form (03 §14.2).

s: unknown

Source: core/http.ts:228

isIncarnation function

function isIncarnation(s: unknown): s is string

Whether s is a well-formed account incarnation inc (05 §11.1, §21.7).

s: unknown

Source: auth/oauth.ts:109

isInviteUsable function

function isInviteUsable(state: InviteState | null | undefined): boolean

Whether an invite in state can be used: only active; unknown values are not usable (09 §8.1).

state: InviteState | null | undefined

Source: api/invites.ts:101

isKnownControlMessage function

function isKnownControlMessage(m: ControlMessage): m is KnownControlMessage

Whether a decoded message has a type defined in 15 §6.5 (payloads are not deep-validated).

Source: calls/relay.ts:138

isKnownPermission function

function isKnownPermission(s: unknown): s is KnownPermission

Whether s is one of the 20 permissions of 10 §3.1.

s: unknown

Source: permissions.ts:108

isLeaseSnapshot function

function isLeaseSnapshot(v: unknown): v is LeaseSnapshot

Whether v is a well-formed LeaseSnapshot (15 §4.2).

v: unknown

Source: calls/lease.ts:67

isMessageKind function

function isMessageKind(kind: unknown): kind is MessageNotificationKind

Whether kind is a message kind (mention, reply, mention_all, dm_message) (19 §5.2).

kind: unknown

Source: api/notifications.ts:358

isMid function

function isMid(s: unknown): s is string

Whether s matches the mid grammar of 11 §2.4: a lowercase hyphenated UUIDv7 with variant 8, 9, a or b. Timestamps are never checked against a clock (11 §2.4).

s: unknown

Source: content.ts:55

isModeratorView function

function isModeratorView(r: Report | ReporterView): r is Report

Whether a report body is the moderator view rather than the reporter view (10 §10.2, §10.8).

Source: api/reports.ts:208

isNormalizedBaseUrl function

function isNormalizedBaseUrl(u: unknown): u is string

Whether u is already a normalized base URL (02 §3.3), as endpoints.api must be (02 §7.3.1).

u: unknown

Source: discovery/base-url.ts:160

isPermissionName function

function isPermissionName(s: unknown): s is Permission

Whether s matches the permission-name grammar (10 §3.3). Known or not.

s: unknown

Source: permissions.ts:103

isProtocolVersion function

function isProtocolVersion(s: unknown): s is string

Whether s matches the version grammar major.minor of 03 §12.1 (no leading zeros).

s: unknown

Source: wire/transport.ts:730

isPushKey function

function isPushKey(s: unknown): s is string

Whether s has the syntax of a push key (19 §9.1, §11.2). The format itself is private to the gateway.

s: unknown

Source: api/push.ts:47

isQueriedDomain function

function isQueriedDomain(domain: unknown, opts?: QueriedDomainOptions): domain is string

Whether domain is a valid queried domain (02 §5.1).

domain: unknown
opts: QueriedDomainOptions

Default: {}

Source: discovery/domain.ts:61

isRecordVisibleTo function

function isRecordVisibleTo(record: Pick<NotificationRecord, "targets">, deviceId: string): boolean

Whether a record is visible to a device: targets null or containing it (19 §8.1).

record: Pick<NotificationRecord, "targets">
deviceId: string

Source: api/notifications.ts:911

isRelayIceServersResponse function

function isRelayIceServersResponse(res: RelayConnectResult): res is RelayConnectIceServersResponse

Whether a /connect result is a 200 ICE-servers challenge rather than a 201 SDP answer (15 §6.2, §6.10.1).

Source: calls/relay.ts:388

isRelayUrl function

function isRelayUrl(url: unknown): url is string

Whether url is a valid relay URL (15 §6.1 item 3): a base-url of 02 §3.3 (absolute https, a DNS host of at least two labels whose last label isn't numeric, no userinfo, no IP literal, no query or fragment, no dot or empty segments) that doesn't end in /.

url: unknown

Source: calls/relay.ts:65

isSameOrSubdomain function

function isSameOrSubdomain(host: string, domain: string): boolean

Whether host equals domain or is a subdomain of it (02 §10.2).

host: string
domain: string

Source: discovery/domain.ts:77

isSameSite function

function isSameSite(host: string, domain: string, psl: PublicSuffixList): boolean

The same-site test of 02 §9.1: host equals domain, or both registrable domains are defined and equal.

host: string
domain: string

Source: discovery/evidence.ts:162

isSealedSeqServed function

function isSealedSeqServed(state: Pick<HistoryState, "visibleFromSeq" | "grants">, seq: number): boolean

Whether the server serves the sealed item at seq to this account (14 §10.2, §10.3): at or above visibleFromSeq, or inside one of its VisibilityGrants. It only narrows what 09's visibility ranges and 12's joinedSeq allow, which this function doesn't know.

state: Pick<HistoryState, "visibleFromSeq" | "grants">
seq: number

Source: api/history.ts:83

isServerKeyIdFor function

function isServerKeyIdFor(kid: unknown, canonicalDomain: string): boolean

Whether kid is a valid server-kid of the server whose canonical domain is canonicalDomain (02 §11.2, §11.5 rule 3).

kid: unknown
canonicalDomain: string

Source: discovery/keys.ts:45

isServerUpgradePlan function

function isServerUpgradePlan(x: Community | ServerUpgradePlan): x is ServerUpgradePlan

Whether a dry-run answer is a ServerUpgradePlan rather than the Community of an already secure server (09 §11.2, §11.6).

Source: api/community.ts:423

isSloppyVoiceError function

function isSloppyVoiceError(e: unknown, code?: string | readonly string[]): e is SloppyVoiceError

Whether e is a SloppyVoiceError, optionally with the given code (or one of the given codes).

e: unknown
code?: string | readonly string[]

Source: core/errors.ts:169

isSpeakAndShareOnlyChange function

function isSpeakAndShareOnlyChange(before: { allow: readonly string[]; deny: readonly string[] } | null | undefined, after: { allow: readonly string[]; deny: readonly string[] }): boolean

Whether going from before to after changes only whether deny contains speak_and_share (the exception of 10 §5.2).

before: { allow: readonly string[]; deny: readonly string[] } | null | undefined
after: { allow: readonly string[]; deny: readonly string[] }

Source: permissions.ts:692

isSpecialUseDomain function

function isSpecialUseDomain(domain: string): boolean

Whether domain (a lowercase A-label) is a special-use name or under one (02 §5.1).

domain: string

Source: discovery/domain.ts:32

isStreamName function

function isStreamName(s: unknown): s is StreamName

Whether s is a stream name (stream, 03 §8.3).

s: unknown

Source: wire/transport.ts:320

isStrongEvidence function

function isStrongEvidence(evidence: string, host: string, domain: string, pinnedHost?: string | null): boolean

Whether a candidate is strong for pin changes (02 §10.2, D-081): evidence dnssec or wellknown, or same-site where the base-URL host equals the queried domain, is a subdomain of it, or equals the host of the pinned base URL. Everything else is weak, including same-site between sibling hosts.

evidence: string
host: string
domain: string
pinnedHost?: string | null

Source: discovery/evidence.ts:220

isSvToken function

function isSvToken(token: unknown, kind?: "bot" | "access" | "refresh" | "signup" | "code"): token is string

Whether token is a well-formed sv-token (05 §7.4), optionally of the given kind.

token: unknown
kind?: "bot" | "access" | "refresh" | "signup" | "code"

Source: auth/oauth.ts:80

isTemporaryDiscoveryFailure function

function isTemporaryDiscoveryFailure(e: unknown): boolean

Whether e is a temporary failure of 02 §13.2 (discovery.dns_failure, discovery.server_unreachable), during which a stale result may be used.

e: unknown

Source: discovery/errors.ts:92

isTimedOut function

function isTimedOut(until: string | null | undefined, now?: number | Date): boolean

Whether a Timeout ending at until is active at now: exactly while now < until (10 §6.2).

until: string | null | undefined
now?: number | Date

Source: permissions.ts:261

isTimestamp function

function isTimestamp(value: unknown): value is string

Whether value is exactly the producer form of 03 §9 (YYYY-MM-DDTHH:MM:SS.mmmZ, a valid date).

value: unknown

Source: core/time.ts:114

isTurnUrl function

function isTurnUrl(url: unknown): url is string

Whether url is a valid turn: or turns: URI (15 §6.10.2).

url: unknown

Source: calls/relay.ts:345

isUnderBaseUrl function

function isUnderBaseUrl(url: string, baseUrl: string): boolean

Whether url is under {base}/ (11 §14.2 step 2): same origin (after URL normalization, so default ports and host case don't matter) and a path under the base path. Only then may the session token be sent.

url: string
baseUrl: string

Source: api/attachments.ts:38

isUsableThumbnail function

function isUsableThumbnail(thumb: ThumbnailRef): boolean

Whether a received thumbnail is within the limits of 11 §14.3 (THUMB_MAX_BYTES, THUMB_MAX_PX, an allowed media type). A receiving client ignores one that isn't.

Source: content.ts:794

isUuidV7 function

function isUuidV7(s: unknown): s is string

Whether s is a UUIDv7 in the one canonical spelling 03 §8.2 allows.

s: unknown

Source: core/uuidv7.ts:21

isValidCredential function

function isValidCredential(token: unknown): token is string

Whether token matches the credentials grammar of 03 §3.1 (token68, 1 to 4,096 characters).

token: unknown

Source: core/auth.ts:53

isValidGroupId function

function isValidGroupId(groupId: string | Uint8Array<ArrayBufferLike>): boolean

Whether groupId passes parseGroupId (13 §4.1).

groupId: string | Uint8Array<ArrayBufferLike>

Source: mls/provider.ts:236

isValidJoinTemplate function

function isValidJoinTemplate(template: unknown, apiHost: string, domains: readonly string[]): template is string

Check a links.join template against 02 §7.3.4 and 01 §11.2: at most 512 octets; an RFC 6570 template of level 3 or lower (no prefix or explode modifiers) using only the variables local, domain and invite; a literal https:// scheme and literal authority with no expression before the path (an expression right after the authority must start the path, query or fragment); and a host that is the host of endpoints.api or one of domains. Clients must still confirm the host by discovery before using the template (01 §11.2, §11.4).

template: unknown
apiHost: string
domains: readonly string[]

Source: discovery/metadata.ts:85

isValidReactionKey function

function isValidReactionKey(key: unknown): key is string

Whether key is a valid reaction key (11 §3.7.2): one extended grapheme cluster (UAX #29) that matches UTS #51's possible_emoji, at most 64 bytes of UTF-8. Membership in the RGI list is never checked. Where the runtime has no Intl.Segmenter, only the possible_emoji structure is checked.

key: unknown

Source: content.ts:459

isValidWebhookName function

function isValidWebhookName(name: unknown): name is string

Whether name is a valid webhook name (11 §15.2): 1 to 80 Unicode scalar values, without @, <, >, control characters or line breaks.

name: unknown

Source: api/webhooks.ts:36

isWebhookToken function

function isWebhookToken(token: unknown): token is string

Whether token has the form of a webhook token: whk_ and base64url of 32 bytes (11 §15.2).

token: unknown

Source: api/webhooks.ts:28

isWithheldPayload function

function isWithheldPayload(d: unknown): d is WithheldPayload

Whether a durable payload is the reduced form { "withheld": true } (11 §8.3, 03 §7.2).

d: unknown

Source: content.ts:988

jcsSerialize function

function jcsSerialize(value: unknown): string

Serialize a JSON value with the JSON Canonicalization Scheme (RFC 8785): object members sorted by the UTF-16 code units of their names, no insignificant white space, ECMAScript number and string serialization. Members whose value is undefined are skipped, as JSON.stringify does. Used to measure insecure content (11 §3.8).

value: unknown

Source: content.ts:76

keyBackupAad function

function keyBackupAad(b: KeyBackupAadInput): Uint8Array

AAD = "sv1 backup" || 0x00 || u8(v) || lv(addr) || u32(igen) || ikf_raw || u32(vgen) || phraseId_raw || u8(kdf.v) || u32(kdf.m) || u32(kdf.t) || u32(kdf.p) || lv(salt) (08 §5.4).

Source: api/backup.ts:393

keyPackageRef function

function keyPackageRef(keyPackage: Uint8Array<ArrayBufferLike> | ParsedKeyPackage): Promise<Uint8Array<ArrayBufferLike>>

KeyPackageRef = RefHash("MLS 1.0 KeyPackage Reference", KeyPackage) (RFC 9420 §5.2, vector T-KPREF).

keyPackage: Uint8Array<ArrayBufferLike> | ParsedKeyPackage

Source: mls/provider.ts:1115

keyRotationHash function

function keyRotationHash(compact: string): Promise<string>

The SHA-256 of a compact KeyRotation as ASCII, base64url (02 §12.2, §20.5).

compact: string

Source: discovery/keychain.ts:58

keyUnusableReason function

function keyUnusableReason(key: KeyTimes, input: KeyUsabilityInput): KeyUnusableReason | null

The usability test of 02 §11.6 step 5, with ±60 s skew: purpose matches; status next, active or retired and not revoked; now ≤ exp; iat ≥ nbf; for a next key now ≥ nbf; for a retired key iat ≤ retiredAt; and the stale bound. Returns null if usable, otherwise the data.reason of discovery.key_unusable.

Source: discovery/keys.ts:216

lastChainHead function

function lastChainHead(keyChain: readonly string[]): Promise<ChainHead | null>

The chain head of a keyChain as at first contact: its last element, or null if empty (02 §10.1).

keyChain: readonly string[]

Source: discovery/pins.ts:83

leaseSnapshotProblem function

function leaseSnapshotProblem(v: unknown): string | null

Why a value isn't a well-formed LeaseSnapshot (15 §4.2), or null if it is: callId a string, seq and validMs non-negative integers, the three lists ascending without duplicates, audio and video subsets of listeners, and epoch (when present) a non-negative integer. A receiver MUST ignore a snapshot that breaks these rules. Unknown members are ignored.

v: unknown

Source: calls/lease.ts:51

localDmError function

function localDmError(code: "dm.wrong_host" | "dm.invalid_participants" | "dm.recipient_not_found" | "dm.too_many_participants" | "dm.security_mismatch" | "dm.upgrade_in_progress" | "dm.encryption_pending" | "dm.closed" | "dm.not_participant" | "dm.not_accepted" | "dm.not_group" | "dm.not_owner" | "dm.reservation_expired" | "dm.request_not_pending" | "dm.entry_active" | "dm.host_mismatch", detail: string, data?: Record<string, unknown>): SloppyVoiceError

Build (not throw) a SloppyVoiceError carrying a dm.* code for a rule the SDK evaluated itself, with the retryable and userAction of the registry (12 §17) and status 0 (no server answered). Callers handle it exactly like the hosting server's error of the same code.

code: "dm.wrong_host" | "dm.invalid_participants" | "dm.recipient_not_found" | "dm.too_many_participants" | "dm.security_mismatch" | "dm.upgrade_in_progress" | "dm.encryption_pending" | "dm.closed" | "dm.not_participant" | "dm.not_accepted" | "dm.not_group" | "dm.not_owner" | "dm.reservation_expired" | "dm.request_not_pending" | "dm.entry_active" | "dm.host_mismatch"
detail: string
data?: Record<string, unknown>

Source: api/dms.ts:145

markChannelPinDeleted function

function markChannelPinDeleted(pin: ChannelSecPin, cause: Pick<ChannelDeletedEvent, "reason"> | "tombstone", now: string): ChannelSecPin

Record that the pinned channel was deleted (09 §13.5): on channel.deleted with reason deleted, or a 410 channel.deleted from GET /v1/channels/{id}. A lost_access event doesn't set deletedSeenAt (09 §14.1). Returns the pin unchanged when there is nothing to record.

cause: Pick<ChannelDeletedEvent, "reason"> | "tombstone"
now: string

Source: api/channels.ts:871

maxAttachmentBytes function

function maxAttachmentBytes(limits?: ServerLimits | null): number

The maxAttachmentBytes a client relies on: the advertised value, or the 8 MiB floor (11 §2.3).

limits?: ServerLimits | null

Source: content.ts:113

maxMessageBytes function

function maxMessageBytes(limits?: ServerLimits | null): number

The maxMessageBytes a client relies on: the advertised value, or the 8,192 floor (11 §2.3).

limits?: ServerLimits | null

Source: content.ts:108

maxSealedCiphertextBytes function

function maxSealedCiphertextBytes(maxMessageBytesValue: number): number

The largest decoded ct a server accepts: roundUp256(maxMessageBytes) + 16 (11 §3.8, §19.2).

maxMessageBytesValue: number

Source: content.ts:132

mentionHint function

function mentionHint(content: MessageContent | EditContent, opts?: { sender?: string; enabled?: boolean }): MentionHint

The mention hint a secure message or edit carries (11 §4.4): the content's mentions plus, for a reply with ping not false, the reply's author unless it is the sender; [] when the user turned the mention_hints setting off. mentionAll is always the content's value. Throws if the hint would exceed MAX_MENTIONS.

opts: { sender?: string; enabled?: boolean }

Default: {}

Source: content.ts:894

mentionsOf function

function mentionsOf(content: Pick<MessageContent, "text" | "replyTo">, self: string, opts?: { validatedMentionAll?: boolean; isCanonicalAddress?: MentionAddressCheck }): MentionMatch

Whether a received (for a secure message, decrypted) message or edit mentions self, for highlights, badges and deciding whether to keep a notification (11 §4.4 receiver rules): by a user-mention token outside code (11 §3.4 rule 4, mentions entries without a token are ignored), by a reply to self with ping not false, or by <@everyone> when the server-validated mentionAll is true. A notification triggered by a hint that this doesn't support MUST be suppressed silently (11 §4.4).

content: Pick<MessageContent, "text" | "replyTo">
self: string
opts: { validatedMentionAll?: boolean; isCanonicalAddress?: MentionAddressCheck }

Default: {}

Source: content.ts:939

mentionToken function

function mentionToken(addr: string): string

Format a user-mention token for an already canonical address (11 §3.4).

addr: string

Source: content.ts:421

mergeArchiveRecords function

function mergeArchiveRecords(ours: ArchiveRecordPlaintext, theirs: ArchiveRecordPlaintext): MergeResult<ArchiveRecordPlaintext>

Merge this device's version of an archive record (ours) with the stored one (theirs) entry by entry (08 §8.9.1, 14 §12.5): same ekid is one entry (source mls if either, confirmed if either, the earlier learnedAt); different ekids are all kept (two mls ones are fork evidence, reported); at most 4 entries, dropping non-mls entries first (unconfirmed before confirmed, latest learnedAt first), never an mls one.

Source: api/vault.ts:672

mergeChannelPins function

function mergeChannelPins(a: ChannelSecPin, b: ChannelSecPin): { pin: ChannelSecPin; w9: W9Finding | null }

Merge two versions of one channel pin (09 §13.2, for 08 §8.9.3). When both pinned different securedAt or upgradeSeq values, the result keeps the values of the version with the earlier firstSeenAt and w9 is T3: the server presented two histories to two devices of the account.

Source: api/channels.ts:982

mergeCommunityPins function

function mergeCommunityPins(a: CommunitySecPin, b: CommunitySecPin): { pin: CommunitySecPin; w9: W9Finding | null }

Merge two versions of one community pin (09 §13.2): the earliest firstSeenAt, the latest lastSeenAt, hidden if either is set; a different pinned securedAt keeps the earlier version's and raises T4.

Source: api/channels.ts:1026

mergeGroupDmPins function

function mergeGroupDmPins(a: GroupDmSecPin, b: GroupDmSecPin): GroupDmSecPin

Merge two versions of one group DM pin (09 §13.2): earliest firstSeenAt, latest lastSeenAt, hidden if either is set.

Source: api/channels.ts:1056

mergeReactions function

function mergeReactions(message: Pick<Message, "reactions">, decrypted?: DecryptedReaction[], self?: string): MergedReaction[]

Merge a Message's plain ReactionSummaries with its decrypted sealed reaction entries (11 §5.2, §5.5 step 3): group by normalized key (U+FE0F removed, 11 §3.7.2), count each account at most once per key, keep the order of first appearance. self is the reader's canonical address, used for me on sealed entries; plain summaries carry their own me. Entries whose decrypted target isn't the message must be dropped by the caller (11 §3.9).

message: Pick<Message, "reactions">
decrypted: DecryptedReaction[]

Default: []

self?: string

Source: api/reactions.ts:92

mergeRecoveryRecords function

function mergeRecoveryRecords(ours: RecoveryRecordPlaintext, theirs: RecoveryRecordPlaintext, activePhraseId: string | null): MergeResult<RecoveryRecordPlaintext>

Merge two recovery record versions (08 §8.9.4): the one whose phraseId is the active KeyBackup's wins entirely; if both or neither match, the later createdAt, then the larger phraseId. Versions with the same phraseId merge member by member: the earliest non-null savedAt (with its saveMethod) and the latest non-null lastNudgedAt.

activePhraseId: string | null

Source: api/vault.ts:747

mergeSharedKeysRecords function

function mergeSharedKeysRecords(ours: SharedKeysRecordPlaintext, theirs: SharedKeysRecordPlaintext): MergeResult<SharedKeysRecordPlaintext>

Merge two shared_keys versions (08 §8.9.5): the keys arrays united by mid. Entries with the same mid and a different key are reported in diagnostics as mid:<mid>; the caller keeps the one that passes 14 §7.8 and sends 14's diagnostic. ours is kept on a conflict here.

Source: api/vault.ts:712

metadataLimit function

function metadataLimit(metadata: Pick<ServerMetadata, "limits">, name: "maxRequestBytes" | "maxEventBytes" | "maxSubscriptions" | "maxReplayEvents" | "maxMessageBytes" | "maxAttachmentBytes" | "maxSecureLeaves" | "maxGroupDmParticipants" | "maxDmRequestBytes" | "maxMlsUploadBytes" | "maxFederationEventBytes" | "maxDevices" | "maxLinkedProviders" | "maxAvatarBytes" | "maxBotsPerAccount" | "maxBotTokens" | "maxPushRegistrationsPerDevice"): number

The advertised value of a registered limit, or its floor when missing or invalid (02 §7.3.3, 03 §16.1).

metadata: Pick<ServerMetadata, "limits">
name: "maxRequestBytes" | "maxEventBytes" | "maxSubscriptions" | "maxReplayEvents" | "maxMessageBytes" | "maxAttachmentBytes" | "maxSecureLeaves" | "maxGroupDmParticipants" | "maxDmRequestBytes" | "maxMlsUploadBytes" | "maxFederationEventBytes" | "maxDevices" | "maxLinkedProviders" | "maxAvatarBytes" | "maxBotsPerAccount" | "maxBotTokens" | "maxPushRegistrationsPerDevice"

Source: discovery/metadata.ts:378

midToBytes function

function midToBytes(mid: string): Uint8Array

The 16-byte binary form of a mid: its 32 hex digits decoded big-endian (11 §2.4).

mid: string

Source: content.ts:60

mlsDeriveSecret function

function mlsDeriveSecret(secret: Uint8Array, label: string): Promise<Uint8Array<ArrayBufferLike>>

DeriveSecret(Secret, Label) = ExpandWithLabel(Secret, Label, "", 32) (RFC 9420 §8).

secret: Uint8Array
label: string

Source: mls/provider.ts:717

mlsExpandWithLabel function

function mlsExpandWithLabel(secret: Uint8Array, label: string, context: Uint8Array, length: number): Promise<Uint8Array<ArrayBufferLike>>

ExpandWithLabel(Secret, Label, Context, Length) of RFC 9420 §8 with HKDF-SHA256 (ciphersuite 0x0001): KDFLabel = uint16 length || opaque "MLS 1.0 " + Label <V> || opaque Context<V>.

secret: Uint8Array
label: string
context: Uint8Array
length: number

Source: mls/provider.ts:711

mlsExporterFromSecret function

function mlsExporterFromSecret(exporterSecret: Uint8Array, label: string, context: Uint8Array, length: number): Promise<Uint8Array<ArrayBufferLike>>

MLS-Exporter(Label, Context, Length) = ExpandWithLabel(DeriveSecret(exporter_secret, Label), "exported", Hash(Context), Length) (RFC 9420 §8.5), for providers that expose the epoch's exporter_secret instead of an exporter function. Vector 14 §16.3.1.

exporterSecret: Uint8Array
label: string
context: Uint8Array
length: number

Source: mls/provider.ts:726

mlsRefHash function

function mlsRefHash(label: string, value: Uint8Array): Promise<Uint8Array<ArrayBufferLike>>

RefHash(label, value) = SHA-256(opaque label<V> || opaque value<V>) (RFC 9420 §5.2).

label: string
value: Uint8Array

Source: mls/provider.ts:732

mlsSignWithLabel function

function mlsSignWithLabel(signer: Ed25519Signer, label: string, content: Uint8Array): Promise<Uint8Array<ArrayBufferLike>>

SignWithLabel(SignatureKey, Label, Content) of RFC 9420 §5.1.2 with Ed25519 (ciphersuite 0x0001).

label: string
content: Uint8Array

Source: mls/provider.ts:741

mlsVerifyWithLabel function

function mlsVerifyWithLabel(publicKey: Uint8Array, label: string, content: Uint8Array, signature: Uint8Array): Promise<boolean>

VerifyWithLabel(VerificationKey, Label, Content, SignatureValue) of RFC 9420 §5.1.2, strict Ed25519 (04 §4.3).

publicKey: Uint8Array
label: string
content: Uint8Array
signature: Uint8Array

Source: mls/provider.ts:746

mustCheckPublicIdentity function

function mustCheckPublicIdentity(ended: HomeSessionEnded, security: string & {} | AccountSecurity): boolean

Whether a client whose own device was revoked must fetch the public IdentityState (GET /v1/users/{local}/identity, 07, no Authorization) before it discards its local identity state (05 §14.1 step 2): the account is secure, the session ended with auth.session_revoked or auth.refresh_reused, and the reason is neither signed_out nor account_deleted.

security: string & {} | AccountSecurity

Source: auth/session.ts:802

needsSuccessor function

function needsSuccessor(dm: Pick<Dm, "state" | "closedReason"> | Pick<DmIndexEntry, "state" | "dmState" | "closedReason">): boolean

Whether a DM (or its index entry) is closed with reason host_secure, so that a client that wants to send into it creates a successor without asking the user (12 §13.3). For a group, the caller first checks the index entry's successor and uses it if set.

dm: Pick<Dm, "state" | "closedReason"> | Pick<DmIndexEntry, "state" | "dmState" | "closedReason">

Source: api/dms.ts:434

needsWellKnownCheck function

function needsWellKnownCheck(input: Omit<EvidenceInput, "wellKnownConfirmed">): boolean

Whether evidence would be dns-only without the .well-known check, so that case W-c of 02 §4.3 applies (servers MUST check; native clients SHOULD for their home server at sign-in).

input: Omit<EvidenceInput, "wellKnownConfirmed">

Source: discovery/evidence.ts:210

negativeLifetimeSec function

function negativeLifetimeSec(code: string, opts: { temporary: boolean; negativeTtlSec?: number; consecutive?: number }): number | null

Negative-cache lifetime in seconds for a failure (02 §13.3), or null when it isn't cached: discovery.not_found uses the DNS negative TTL clamped to [60 s, 900 s] (300 s if unknown); discovery.invalid_domain isn't cached; other definitive failures 300 s; temporary failures 30 s after the first, doubling on each consecutive failure up to 300 s (consecutive counts this one, starting at 1).

code: string
opts: { temporary: boolean; negativeTtlSec?: number; consecutive?: number }

Source: discovery/cache.ts:53

newArgon2idParams function

function newArgon2idParams(random?: RandomSource): Argon2idParams

Fresh producer parameters with a new 16-byte salt (04 §12.1; a new salt for every new phrase, 08 §5.1).

random: RandomSource

Default: cryptoRandomBytes

Source: api/backup.ts:362

newIdempotencyKey function

function newIdempotencyKey(): string

A fresh Idempotency-Key for one logical operation: a UUIDv7 (03 §14.2 item 2). Reuse the same value on every retry of that operation.

Source: core/http.ts:238

newMemberRestriction function

function newMemberRestriction(policy: NewMemberPolicyLike | null | undefined, joinedAt: string | null | undefined, now?: number | Date): { restricted: KnownPermission[]; until: string } | null

The new-member restriction that applies to a member who became active at joinedAt (10 §12.2, modifier c of §6.2): the restricted channel-scoped permissions and when the restriction ends, or null if none applies. Missing policy members take their defaults; view_channel is never restricted.

policy: NewMemberPolicyLike | null | undefined
joinedAt: string | null | undefined
now?: number | Date

Source: permissions.ts:273

newNotificationWindow function

function newNotificationWindow(): NotificationWindowState

A new idle window (19 §4.5).

Source: api/notifications.ts:527

newSignInsAfterResync function

function newSignInsAfterResync(devices: readonly Pick<DeviceRecord, "provider" | "did" | "createdAt">[], own: OwnDevice, lastMeEventAt: string | null): string[]

After session.resync_required for the me stream, the devices of GET /v1/me/devices?include=revoked that raise W4d (05 §12.12): created after both this device's own record and the last me event processed (lastMeEventAt, the envelope ts of that event), with a non-null provider, and not this device.

devices: readonly Pick<DeviceRecord, "provider" | "did" | "createdAt">[]
lastMeEventAt: string | null

Source: auth/session.ts:778

nextRejoinOffset function

function nextRejoinOffset(elapsed: number): number

The first scheduled attempt time strictly after elapsed ms since t0 (15 §10.5). A network-up signal starts an attempt early but doesn't change the schedule of later attempts, so the schedule is a fixed grid.

elapsed: number

Source: calls/continuity.ts:81

nextWrongHostStep function

function nextWrongHostStep(input: { originalHost: string; serverHost: string; recomputedHost: string; retriedOriginal: boolean }): WrongHostStep

The client side of a dm.wrong_host disagreement (12 §4.4). After refetching every input metadata document (12 §4.1 item 2) and recomputing the rule (recomputedHost): if the result now equals the server's data.host, retry there; otherwise retry the original server once after 5 s; if that already happened, give up with core.unavailable ("Couldn't start this conversation right now") and keep the draft in the outbox (11).

input: { originalHost: string; serverHost: string; recomputedHost: string; retriedOriginal: boolean }

Source: api/dms.ts:309

nonCanonicalError function

function nonCanonicalError(data: Record<string, unknown>): SloppyVoiceError

address.non_canonical (01 §12): a signed object names an alias instead of the canonical domain (02 §11.6 step 2).

data: Record<string, unknown>

Source: discovery/errors.ts:69

normalizeAudioBlockedBy function

function normalizeAudioBlockedBy(v: AudioBlockedBy | null): AudioBlockedBy | null

audioBlockedBy: unknown values are treated as other (15 §4.1).

v: AudioBlockedBy | null

Source: calls/call.ts:68

normalizeAutoAcceptSetting function

function normalizeAutoAcceptSetting(setting: DmAutoAcceptSetting | null | undefined): "contacts_and_communities" | "contacts_only" | "everyone"

The autoAccept setting with unknown values treated as the default, contacts_and_communities (12 §9.4).

setting: DmAutoAcceptSetting | null | undefined

Source: api/dms.ts:112

normalizeBaseUrl function

function normalizeBaseUrl(u: unknown): string | null

normalizeBaseUrl(u) of 02 §3.3: the normalized base URL, or null if u isn't a valid base-url. Every party compares, pins and signs base URLs in this form.

u: unknown

Source: discovery/base-url.ts:147

normalizeCallEndReason function

function normalizeCallEndReason(v: CallEndReason): CallEndReason

call.ended reason: unknown values are treated like context_closed (15 §2.4).

Source: calls/call.ts:51

normalizeCallParticipantKind function

function normalizeCallParticipantKind(v: ParticipantKind): "bot" | "user"

Participant kind: unknown values are treated as user (15 §2.5.2).

Source: calls/call.ts:35

normalizeCallSecurity function

function normalizeCallSecurity(v: CallSecurity): "insecure" | "secure"

Call security: unknown values are treated as secure (15 §2.5.1).

Source: calls/call.ts:25

normalizeDmKind function

function normalizeDmKind(kind: DmKind | null | undefined): "direct" | "group"

kind with unknown values treated as group (12 §6.1).

kind: DmKind | null | undefined

Source: api/dms.ts:58

normalizeDmMarker function

function normalizeDmMarker(marker: DmMarker | null | undefined): "K1" | "K2" | "K5" | null

The marker of dm.security_changed or dm.closed, with an unknown value (or null) treated as no marker (12 §16.1).

marker: DmMarker | null | undefined

Source: api/dms.ts:122

normalizeDmSecurity function

function normalizeDmSecurity(security: DmSecurity | null | undefined): "insecure" | "secure"

Dm security with unknown values treated as secure, so plaintext is refused (12 §6.1).

security: DmSecurity | null | undefined

Source: api/dms.ts:63

normalizeDmState function

function normalizeDmState(state: DmState | null | undefined): "closed" | "active" | "upgrading" | "encryption_pending"

Dm state with unknown values treated as closed (12 §6.1).

state: DmState | null | undefined

Source: api/dms.ts:68

normalizeEffectiveStatus function

function normalizeEffectiveStatus(s: string): "idle" | "online" | "dnd" | "offline"

Normalize a received effective status: unknown values count as online (11 §11.1).

s: string

Source: api/presence.ts:138

normalizeEvidence function

function normalizeEvidence(value: unknown): DelegationEvidence

Map a received evidence value to a known level: unknown values are treated as dns-only (02 §6.3).

value: unknown

Source: discovery/evidence.ts:227

normalizeIndexEntryState function

function normalizeIndexEntryState(state: DmIndexEntryState | null | undefined): "closed" | "active" | "blocked" | "left" | "declined" | "requested"

A DmIndexEntry state with unknown values treated as left (12 §9.1).

state: DmIndexEntryState | null | undefined

Source: api/dms.ts:98

normalizeInviteCode function

function normalizeInviteCode(input: string): string | null

Normalize a user- or link-supplied invite code (09 §8.2, normative for clients): NFKC; remove White_Space, Pd and U+2212; ASCII upper case; I/L → 1, O → 0; then require exactly 12 characters of the Crockford alphabet. Returns the canonical code, or null when the input is invalid, which the protocol treats exactly like an unknown code (invite.not_found).

input: string

Source: api/invites.ts:39

normalizeItemKind function

function normalizeItemKind(kind: string): MessageNotificationKind

An item's kind for processing: unknown values are treated as dm_message (19 §4.4, §5.2).

kind: string

Source: api/notifications.ts:368

normalizeParticipantKind function

function normalizeParticipantKind(kind: DmParticipantKind | null | undefined): "bot" | "user"

A participant kind with unknown values treated as bot (12 §6.3).

kind: DmParticipantKind | null | undefined

Source: api/dms.ts:85

normalizeParticipantReason function

function normalizeParticipantReason(reason: DmParticipantReason | null | undefined): "removed" | "account_deleted" | "left" | "declined" | "encryption_turned_off" | "invitation_expired" | null

A participant reason with unknown values treated as removed (12 §6.3). Null stays null.

reason: DmParticipantReason | null | undefined

Source: api/dms.ts:90

normalizeParticipantRole function

function normalizeParticipantRole(role: DmParticipantRole | null | undefined): "owner" | "member"

A participant role with unknown values treated as member (12 §6.3).

role: DmParticipantRole | null | undefined

Source: api/dms.ts:80

normalizeParticipationState function

function normalizeParticipationState(state: DmParticipationState | null | undefined): "active" | "removed" | "reserved" | "left" | "pending" | "declined"

A participation state with unknown values treated as removed (12 §6.3).

state: DmParticipationState | null | undefined

Source: api/dms.ts:73

normalizeProblem function

function normalizeProblem(raw: unknown, status: number, retryAfterHeaderMs?: number | null): Problem | null

Read a problem object received from a server (03 §10.1), tolerating missing or ill-typed members. Returns null if raw has no string code, in which case the caller falls back to problemForStatus. Only the members 03 §10.1 defines are copied; unknown members are ignored (03 §2.4 item 6).

status is the HTTP status (or the status of the surrounding context); retryAfterHeaderMs is a parsed Retry-After, used only when the problem has no retryAfterMs (03 §10.1 rule 1).

raw: unknown
status: number
retryAfterHeaderMs?: number | null

Source: core/errors.ts:263

normalizeReactionKey function

function normalizeReactionKey(key: string): string

Normalize a reaction key for comparison: remove every U+FE0F (11 §3.7.2).

key: string

Source: content.ts:468

normalizeRequestState function

function normalizeRequestState(state: DmRequestState | null | undefined): "expired" | "blocked" | "pending" | "declined" | "accepted" | "withdrawn"

A DmRequest state with unknown values treated as withdrawn (12 §10.1).

state: DmRequestState | null | undefined

Source: api/dms.ts:105

normalizeResyncReason function

function normalizeResyncReason(reason: unknown): "gap_too_large" | "expired" | "ahead" | "access_changed" | "buffer_overflow" | "server_reset"

Map a resync reason to a known one: an unknown value is treated like gap_too_large (03 §7.5).

reason: unknown

Source: events/tracker.ts:31

normalizeRingEndReason function

function normalizeRingEndReason(v: RingEndReason): RingEndReason

Ring end reason: unknown values are treated as cancelled (15 §15).

Source: calls/call.ts:74

normalizeSeatRemovalReason function

function normalizeSeatRemovalReason(v: SeatRemovalReason): never

call.participant_left reason: unknown values are treated as left (15 §15).

Source: calls/call.ts:45

normalizeSeatState function

function normalizeSeatState(v: SeatState): "connecting" | "connected" | "reconnecting"

Participant state: unknown values are treated as connecting (15 §2.5.2).

Source: calls/call.ts:40

normalizeSecureAccess function

function normalizeSecureAccess(access: unknown): "none" | "full" | "existing_only"

A RemoteSession secureAccess as a client acts on it: unknown values are none (06 §6.2).

access: unknown

Source: auth/remote.ts:151

normalizeSessionEndedReason function

function normalizeSessionEndedReason(reason: unknown): SessionEndedReason

Map a federation.session_ended reason to a known value; unknown values are admin (06 §6.8, §17.4).

reason: unknown

Source: auth/remote.ts:141

normalizeSessionState function

function normalizeSessionState(state: unknown): "active" | "extended"

A RemoteSession state as a client acts on it: unknown values are active (06 §6.2).

state: unknown

Source: auth/remote.ts:146

normalizeSfuClosedReason function

function normalizeSfuClosedReason(v: SfuClosedReason): SfuClosedReason

sfu.closed reason: unknown values are treated as sfu_failed (15 §15).

Source: calls/call.ts:79

normalizeSource function

function normalizeSource(value: unknown): DelegationSource

Map a received source value to a known one: unknown values are treated as wellknown (02 §6.3).

value: unknown

Source: discovery/evidence.ts:232

normalizeTargetUri function

function normalizeTargetUri(uri: string): string

normalize(uri) of 06 §8.3: https only, no userinfo, fragment dropped; lowercase scheme and host, host as a lowercase A-label; port 443 removed; empty path → /; percent-encodings upper-cased and unreserved octets decoded in path and query; %3A decoded in the path only; dot segments removed. Throws sdk.invalid_argument for a URI that can't be normalized.

uri: string

Source: auth/remote.ts:700

normalizeTimestamp function

function normalizeTimestamp(value: string): string | null

Normalize a received timestamp to the producer form (03 §9 rule 2 and the consumer column of 03 §17.4). Returns null if it isn't RFC 3339.

value: string

Source: core/time.ts:108

normalizeTrackState function

function normalizeTrackState(v: TrackState): "active" | "paused"

Track state: unknown values are treated as paused (15 §8.2).

Source: calls/call.ts:84

normalizeUserAction function

function normalizeUserAction(value: unknown): "none" | "retry" | "wait" | "sign_in" | "enable_encryption" | "set_up_device" | "update_app" | "contact_admin"

Map a wire userAction to a known value; unknown values are treated as none (03 §10.2).

value: unknown

Source: core/errors.ts:46

normalizeVideoRoute function

function normalizeVideoRoute(v: VideoRoute): "dc" | "sfu"

videoRoute: unknown values are treated as dc (15 §2.5.1).

Source: calls/call.ts:30

normalizeVisibilityRanges function

function normalizeVisibilityRanges(ranges: readonly VisibilityRange[]): VisibilityRange[]

Merge overlapping or adjacent ranges and sort them (09 §7.2).

ranges: readonly VisibilityRange[]

Source: api/channels.ts:419

notificationReferenceText function

function notificationReferenceText(record: ReferenceTextRecord, labels?: ReferenceTextLabels, opts?: ReferenceTextOptions): ReferenceText

The reference (fallback and minimal) text of a record, in English (19 §13.7, PD-19-15). It never contains message content: use it when content can't or mustn't be shown. 20 §19.2 governs localisation. {Sender} and {channel} are derived with 01's display-name check (01 §6.4, §6.5; 19 §13.1 D10) unless labels supplies them. Returns the generic text for unknown kinds and for a missing sender.

labels: ReferenceTextLabels

Default: {}

opts: ReferenceTextOptions

Default: {}

Source: api/notifications.ts:1015

octetLength function

function octetLength(s: string): number

The UTF-8 length of s in octets.

s: string

Source: discovery/base-url.ts:51

openAckProof function

function openAckProof(body: PairingPayloadBody, ctx: { kAck: Uint8Array; pairingId: string; newDid: string; approverDid: string; addr: string }): Promise<AckProofPlaintext>

Decrypt the ack proof on the approver (08 §6.7.3). Show "Your new device is ready" only when it decrypts, names newDid and says ok; the cleartext status is only for the server.

ctx: { kAck: Uint8Array; pairingId: string; newDid: string; approverDid: string; addr: string }

Source: api/pairing.ts:646

openPairingPayload function

function openPairingPayload(body: PairingPayloadBody, ctx: { kPayload: Uint8Array; pairingId: string; approverDid: string; newDid: string; addr: string }): Promise<PairingPayloadPlaintext>

Decrypt the pairing payload on the new device (08 §6.7.2) and check that addr is the account and approverDid and newDid match the session. Then run checkPairingPayload against a freshly fetched IdentityState. Any failure: send ack with failed / verification_failed.

ctx: { kPayload: Uint8Array; pairingId: string; approverDid: string; newDid: string; addr: string }

Source: api/pairing.ts:567

openVaultKeyGrant function

function openVaultKeyGrant(grant: Pick<VaultKeyGrant, "did" | "igen" | "vgen" | "enc" | "ct">, boxKey: X25519KeyPair, addr: string): Promise<Uint8Array<ArrayBufferLike>>

Open a VaultKeyGrant addressed to this device (08 §10.3). The grant authenticates nothing: verify the generation (verifyVaultGeneration) before using the key.

grant: Pick<VaultKeyGrant, "did" | "igen" | "vgen" | "enc" | "ct">
addr: string

Source: api/vault.ts:623

openVaultKeyLink function

function openVaultKeyLink(link: VaultKeyLink, newKey: Uint8Array, vgen: number, addr: string, igen: number): Promise<Uint8Array<ArrayBufferLike>>

Open the VaultKeyLink of generation vgen with that generation's key and return the linked generation's key (08 §10.2). The caller checks the result against the linked generation's kcv. A failure is crypto.decrypt_failed.

newKey: Uint8Array
vgen: number
addr: string
igen: number

Source: api/vault.ts:337

outboxDecision function

function outboxDecision(error: unknown, ctx: OutboxContext): OutboxDecision

The outbox state after a post fails with error (11 §13.3, §13.4). Network failures and timeouts, 502/503/504, core.unavailable, core.internal, core.idempotency_conflict in_progress and other retryable problems wait for the server; core.rate_limited and moderation.slow_mode keep the item sending until retryAfterMs; encryption-state codes wait for keys; codes only a person can fix wait for action; a delete of a deleted target or a duplicate reaction counts as sent; everything else not retryable fails.

error: unknown

Source: api/messages.ts:548

outboxExpired function

function outboxExpired(queuedAtMs: number, nowMs: number): boolean

Whether an outbox item queued at queuedAtMs has passed OUTBOX_MAX_AGE (7 days) at nowMs (11 §13.1).

queuedAtMs: number
nowMs: number

Source: api/messages.ts:603

outboxRetryDelayMs function

function outboxRetryDelayMs(n: number, retryAfterMs?: number | null, random?: () => number): number

The delay before outbox retry number n (0-based) (11 §13.4 rule 2): 1, 2, 4, 8, 16, 30 and 60 s, then every 60 s, each with ±20 % random jitter, and never sooner than the server's retryAfterMs.

n: number
retryAfterMs: number | null

Default: null

random: () => number

Source: api/messages.ts:596

padContentJson function

function padContentJson(json: Uint8Array): Uint8Array

Pad a content JSON with spaces (0x20) to the smallest multiple of 256 bytes that is at least its length (11 §3.8, 14 §4.5); every kind is padded, so a reaction or delete always becomes exactly 256 bytes. Uses the 14 module's padPlaintext, which owns the padding.

json: Uint8Array

Source: content.ts:127

pairingAad function

function pairingAad(dir: 1 | 2, pairingId: string, fromDid: string, toDid: string, addr: string): Uint8Array

AAD(dir, fromDid, toDid) = "sv1 pair" || 0x00 || u8(dir) || pairingId || fromDid || toDid || lv(addr) (08 §6.7.1).

dir: 1 | 2
pairingId: string
fromDid: string
toDid: string
addr: string

Source: api/pairing.ts:535

pairingKeys function

function pairingKeys(isk: Uint8Array): Promise<{ kPayload: Uint8Array; kAck: Uint8Array }>

K_payload = HKDF-Expand(ISK, "sv1 pair" || 0x00 || 0x01, 32), K_ack with 0x02 (08 §6.7.1). Erase ISK afterwards.

isk: Uint8Array

Source: api/pairing.ts:528

parseAuthorizationResponse function

function parseAuthorizationResponse(callbackUrl: string | URL, expected: ExpectedAuthorizationResponse): AuthorizationSuccessParams

Read the redirect back to the client (05 §6.6). The client MUST check that state equals the value it sent and iss equals the base URL it started with, and discard the response otherwise: a mismatch throws sdk.verification_failed and the response must not be used. A failure redirect throws a SloppyVoiceError whose code is the sv_code (for example auth.access_denied, auth.registration_closed), with the RFC 6749 error and error_description in data.

callbackUrl: string | URL

Source: auth/oauth.ts:412

parseBaseUrl function

function parseBaseUrl(u: unknown): BaseUrlParse

Parse and normalize a base-url (02 §3.3): https only, no userinfo, query or fragment, a DNS host of at least two labels whose last label isn't numeric or 0x…, a port in 1–65535 (443 removed, leading zeros removed), percent-encodings normalized, no dot or empty segments, one trailing / removed, at most 512 octets. Never throws.

u: unknown

Source: discovery/base-url.ts:98

parseControlMessage function

function parseControlMessage(text: string): ControlMessage<string, Record<string, unknown>> | null

Decode one sv-control text message (15 §6.5). Returns null for anything that isn't a JSON object with a valid t, an object d and integer from/to where present: the receiver drops such messages. Unknown t values are returned too (the caller ignores them, 15 §6.5); use isKnownControlMessage to narrow. On a message the relay forwards, from is the sender's pid as the relay set it; a message the relay originates has no from (15 §6.5).

text: string

Source: calls/relay.ts:102

parseGroupId function

function parseGroupId(groupId: string | Uint8Array<ArrayBufferLike>): ParsedGroupId

Parse a group_id (string or its UTF-8 bytes) with every rule of 13 §4.1: the ABNF, the 320-byte limit, splitting the generation at the last colon, and generation 1 to 2,147,483,647 with no leading zeros. Throws sdk.invalid_argument. Whether the domain is canonical rather than an alias of the hosting server can only be checked against the server the client resolved itself; use checkGroupIdFor.

groupId: string | Uint8Array<ArrayBufferLike>

Source: mls/provider.ts:208

parseHomeAssertion function

function parseHomeAssertion(compact: string): ParsedHomeAssertion

Parse a HomeAssertion without verifying its signature or times: 06 §6.3 V1 (size ≤ 4,096, header), V2 (claims, types, canonical base64url, known kind and sec), V3 (iss syntax and kid domain) and V7 (security claims). Clients use it to read jti, aud, enr and dkf from the assertion their home server returned (06 §5.3); servers call verifyHomeAssertion. Throws federation.assertion_invalid with data.reason.

compact: string

Source: auth/remote.ts:416

parseKeyChain function

function parseKeyChain(chain: unknown): ParsedKeyRotation[] | null

Parse a whole keyChain and check the ordering rules of 02 §12.2: at most 64 elements, ordered by n ascending, each n exactly one more than the previous. Returns null on any failure.

chain: unknown

Source: discovery/keychain.ts:102

parseKeyPackage function

function parseKeyPackage(bytes: Uint8Array): ParsedKeyPackage

Parse a KeyPackage, given either its MLSMessage form (0001 0005 …, as carried in JSON) or the bare KeyPackage struct (RFC 9420 §10). Throws sdk.protocol_violation on encoding errors.

bytes: Uint8Array

Source: mls/provider.ts:1095

parseKeyRotation function

function parseKeyRotation(compact: unknown): ParsedKeyRotation | null

Decode a compact KeyRotation and check its syntax (02 §7.4 step 9): at most 2,048 octets, three canonical base64url parts with a 64-byte signature, a header of exactly alg EdDSA, typ sv-keyrot+jwt and a string kid, and claims iss (string), n (positive integer), iat (integer), prev (string), key (object) and url (string). Signatures are not checked here. Returns null on any failure.

compact: unknown

Source: discovery/keychain.ts:69

parsePairingCode function

function parsePairingCode(input: string): string | null

Lenient input (08 §6.3.2): NFKC, drop every non-ASCII-digit, require exactly 6 digits. Returns the digits or null.

input: string

Source: api/pairing.ts:160

parsePairingQr function

function parsePairingQr(text: string): PairingQrPayload | null

Decode a scanned pairing QR (08 §6.3.1). Returns null for a wrong prefix, bad base32, a version other than 1, an unknown displayer, a malformed length or trailing bytes. The scanner then checks addr against its account (or pre-fills sign-in with it).

text: string

Source: api/pairing.ts:118

parseProposalMessage function

function parseProposalMessage(message: Uint8Array): ParsedProposalMessage

Parse an MLSMessage carrying a proposal PublicMessage (RFC 9420 §6.2, 13 §6.3). Rejects other versions, wire formats and content types with sdk.protocol_violation.

message: Uint8Array

Source: mls/provider.ts:839

parsePublicSuffixList function

function parsePublicSuffixList(text: string): PublicSuffixList

Parse the Public Suffix List file format (https://publicsuffix.org/list/): one rule per line, // comments, *. wildcards and ! exceptions, ICANN and PRIVATE sections alike (02 §9.1). Unicode rules are converted to A-labels. The standard algorithm applies: an exception rule wins, otherwise the matching rule with the most labels, otherwise the implicit * rule.

text: string

Source: discovery/evidence.ts:105

parsePushPayload function

function parsePushPayload(input: unknown): PushPayload | null

Parse a received push payload (19 §10.1, §13.1 step D1): JSON text (FCM data.sv, Web Push plaintext), its UTF-8 bytes, or the already-parsed object (APNs sv). Unknown members are ignored. Returns null when the payload is unusable (v other than 1, h or r missing or not strings, or not JSON): the receiver then shows the generic text (19 §13.7).

input: unknown

Source: api/push.ts:300

parseRateLimit function

function parseRateLimit(value: string | null | undefined): RateLimitInfo[]

Parse a RateLimit header, e.g. "session";r=0;t=3 (03 §15.2). Advisory.

value: string | null | undefined

Source: core/http.ts:394

parseRateLimitPolicy function

function parseRateLimitPolicy(value: string | null | undefined): RateLimitPolicyInfo[]

Parse a RateLimit-Policy header, e.g. "session";q=600;w=60, "ip";q=3000;w=60 (03 §15.2). Advisory.

value: string | null | undefined

Source: core/http.ts:382

parseRecoveryPhraseInput function

function parseRecoveryPhraseInput(input: string): Promise<RecoveryPhraseInput>

The forgiving input algorithm of 08 §4.3: NFKC, ASCII lowercase, every non-a–z character a separator, tokens resolved exactly or by a unique 4-letter prefix, then 8 tokens decoded and the checksum checked. Accepts the canonical text form unchanged.

input: string

Source: api/backup.ts:300

parseRelayConnectResult function

function parseRelayConnectResult(value: unknown): RelayConnectResult

Validate a POST {relayUrl}/connect response body (15 §6.2, §6.10.1).

value: unknown

Source: calls/relay.ts:393

parseRelayIceServersMessage function

function parseRelayIceServersMessage(value: unknown): RelayIceServers | null

Validate a relay.ice_servers control-channel payload (15 §6.10.3).

value: unknown

Source: calls/relay.ts:440

parseRelayTicket function

function parseRelayTicket(ticket: string): { header: RelayTicketHeader; claims: RelayTicketClaims }

Read a RelayTicket's header and claims WITHOUT verifying anything (15 §5.1), for diagnostics and for showing when the ticket expires. Throws sdk.protocol_violation if it isn't a well-formed sv-relay+jwt. Never act on the result: sec in particular is never trusted (15 §2.1 item 4).

ticket: string

Source: calls/relay-ticket.ts:60

parseRetryAfter function

function parseRetryAfter(value: string | null | undefined, nowMs?: number): number | null

Parse a Retry-After header (03 §15.2, RFC 9110 §10.2.3): delay-seconds or an HTTP-date. Returns milliseconds from nowMs, or null if absent or invalid.

value: string | null | undefined
nowMs: number

Source: core/http.ts:257

parseServerKeyId function

function parseServerKeyId(kid: unknown): { domain: string; keyId: string } | null

Parse a server-kid (02 §11.2): kid-domain "#" key-id, where kid-domain is 1–253 of [a-z0-9.-] (always lowercase) and key-id is 1–32 of [A-Za-z0-9._-] (case-sensitive). Returns null if kid doesn't match the grammar. Whether the domain equals the server's canonicalDomain is checked separately (02 §20.4 vector I7).

kid: unknown

Source: discovery/keys.ts:34

parseStreamName function

function parseStreamName(s: unknown): ParsedStream | null

Parse a stream name by the grammar of 03 §8.3. Returns null for anything that doesn't match exactly.

s: unknown

Source: wire/transport.ts:333

parseStructuredList function

function parseStructuredList(value: string | null | undefined): StructuredItem[]

Parse a structured-field List (RFC 9651 §3.1) of bare items with parameters, enough for RateLimit and RateLimit-Policy. Inner lists aren't supported. Returns [] on any syntax error: these headers are advisory (03 OQ-03-3).

value: string | null | undefined

Source: core/http.ts:280

parseTimestamp function

function parseTimestamp(value: string): number | null

Parse any RFC 3339 date-time to Unix milliseconds in UTC, truncating extra fractional digits (03 §9 rule 2). Accepts lowercase t/z and numeric offsets. A leap second (second 60) is read as second 59 (03 §9 rule 1). Returns null for anything that isn't an RFC 3339 date-time.

value: string

Source: core/time.ts:76

parseTurnIceServers function

function parseTurnIceServers(value: unknown): TurnIceServer[] | null

Validate and filter a relay iceServers array (15 §6.10.2). Returns null if structurally malformed, or the entries with valid turn:/turns: URLs (possibly empty if no URL was usable).

value: unknown

Source: calls/relay.ts:365

parseWellKnownDocument function

function parseWellKnownDocument(body: string | Uint8Array<ArrayBufferLike>): WellKnownParse

Read a .well-known/sloppyv body (02 §4.1): a JSON object with v = "sv1" and a valid url, at most 4,096 octets. Unknown members are ignored. Never throws.

body: string | Uint8Array<ArrayBufferLike>

Source: discovery/record.ts:126

path function

function path(strings: TemplateStringsArray, ...params: (string | number)[]): string

Tagged template that percent-encodes each interpolated path segment: everything outside RFC 3986 pchar (03 §2.6, 00 §7.3).

strings: TemplateStringsArray
...params: (string | number)[]

Source: core/http.ts:178

peerPinKeys function

function peerPinKeys(keys: readonly PinnedKey[]): PeerPinKey[]

The wire form of a pin's keys (02 §10.5 {kid, thumbprint, purpose, status}).

keys: readonly PinnedKey[]

Source: discovery/pins.ts:267

permissionChanges function

function permissionChanges(current: readonly string[], req: UpdateRoleRequest): string[] | null

The names a role edit adds or removes (10 §7.3), or null for a request that combines permissions with addPermissions/removePermissions, or names one permission in both (core.invalid_request).

current: readonly string[]

Source: permissions.ts:623

permissionScope function

function permissionScope(name: string): PermissionScope | null

The scope of a known permission, or null for an unknown name (10 §3.2).

name: string

Source: permissions.ts:113

pickSettingsWinner function

function pickSettingsWinner<T extends { updatedAt: string }>(ours: T, oursBy: string, theirs: T, theirsBy: string): T

The default settings merge (08 §8.9.4) for a setting whose owner defines none: the later updatedAt wins; on a tie, the version whose writer did (the VaultRecord's updatedBy) is larger in byte order.

ours: T
oursBy: string
theirs: T
theirsBy: string

Source: api/vault.ts:769

pinMayBeDeleted function

function pinMayBeDeleted(pin: ChannelSecPin | CommunitySecPin | GroupDmSecPin, now: string): boolean

Whether a pin MAY be deleted now (09 §13.3 rule 4, §13.2): a channel pin 400 days after both its lastSeenAt and its deletedSeenAt (if set); a group DM pin 400 days after its lastSeenAt; a community pin never.

now: string

Source: api/channels.ts:1074

pinRid function

function pinRid(kVid: Uint8Array, contactAddr: string): Promise<string>

rid of a pin record: VID(lv("pin") || lv(contactAddr)) (08 §8.5).

kVid: Uint8Array
contactAddr: string

Source: api/vault.ts:96

pkceChallenge function

function pkceChallenge(codeVerifier: string): Promise<string>

The S256 code challenge of a verifier: base64url(SHA-256(ASCII verifier)) (05 §6.2, §21.1).

codeVerifier: string

Source: auth/oauth.ts:151

plaintextDecision function

function plaintextDecision(input: PlaintextCheckInput): { allowed: true } | { allowed: false; reason: PlaintextRefusal }

Whether a client may post plaintext (11) into a DM, by 12 §11.1 and §6.2. A client MUST NOT send plaintext into a DM it computes as secure whatever the hosting server says; never into a group it holds a secure-state pin for (that is W9); and not into a 1:1 DM it last knew as secure until it verified the peer's downgrade itself. Content is accepted only in state active.

Source: api/dms.ts:570

planDirectDm function

function planDirectDm(input: PlanDirectDmInput): Promise<DirectDmPlan>

Compute what to send to start a 1:1 DM (12 §7.1 steps 2, 3 and 6): the rule host, the dm: reference, the computed security, the registration at the creator's home, and the creation request. Pure: the caller fetches IdentityStates and metadata, opens the remote session (06), builds the MLS group for a secure DM (13), and sends.

Source: api/dms.ts:375

planGroupDm function

function planGroupDm(input: PlanGroupDmInput): GroupDmPlan

Compute what to send to start a group DM (12 §7.1, §4.3). Throws dm.encryption_pending when every home is a secure server and someone is insecure (12 §13.2). After the 201 the caller registers { host, ctx } at its home (dms.index.register), and for a secure group bootstraps the MLS group with the creator's grant (12 §11.4, 13 §7.4).

Source: api/dms.ts:418

planReconnect function

function planReconnect(code: number, closing?: SessionClosing | null, options?: PlanReconnectOptions): ReconnectPlan

Decide what to do after the socket closed with code, given the session.closing that preceded it, if any (03 §5.10). For a code in the table the table decides the action and retryAfterMs only raises the delay; for an unknown code the client follows reconnect and retryAfterMs, and without them reconnects with backoff. 1006 (abnormal closure, including any handshake failure a browser can't read, 03 §5.1 item 5) is such an unknown code.

code: number
closing?: SessionClosing | null
options: PlanReconnectOptions

Default: {}

Source: core/backoff.ts:73

postEntry function

function postEntry(http: HttpClient, ctx: string, entry: PostEntry, opts?: RequestOptions): Promise<EntryAck>

POST /v1/contexts/{ctx}/messages with an already built PostEntry (11 §4.1). The mid is the idempotency key, so the request is retried automatically and a resend answers 201 with the stored EntryAck (11 §4.6); Idempotency-Key is not used on this endpoint.

ctx: string
entry: PostEntry
opts: RequestOptions

Default: {}

Source: api/messages.ts:117

prepareOutgoingText function

function prepareOutgoingText(text: string, opts?: { trim?: boolean; nfc?: boolean }): string

Prepare outgoing text (11 §3.2): CR LF and lone CR become LF (MUST); the text is put in NFC (SHOULD) and leading and trailing white space is trimmed (SHOULD) unless trim is false. Other forbidden characters are left for validation to report.

text: string
opts: { trim?: boolean; nfc?: boolean }

Default: {}

Source: content.ts:209

previewText function

function previewText(text: string): string

Build preview text from a message's display text, in which mention and channel tokens are already replaced by display names (11 §16) (19 §4.8): line breaks replaced by single spaces, truncated to at most 140 Unicode scalar values, the last of which is U+2026 when truncated. CRLF counts as one line break.

text: string

Source: api/notifications.ts:505

previewVisible function

function previewVisible(roles: readonly RoleLike[], overwrites: readonly OverwriteLike[]): boolean

Whether a channel is shown to prospective members (10 §6.1 "Preview visibility"): view_channel ∈ ((everyone.permissions ∩ CH) − e.deny) ∪ e.allow, where e is the channel's everyone overwrite. Role and member overwrites are ignored. Display only; it grants nothing.

roles: readonly RoleLike[]
overwrites: readonly OverwriteLike[]

Source: permissions.ts:389

problemForStatus function

function problemForStatus(status: number, retryAfterMs?: number | null): Problem

The problem a client assumes for a 4xx or 5xx response without a problem object, such as one from a proxy (03 §10.3 item 3). retryAfterMs is the parsed Retry-After header, if any; a bare 429 without one waits 5 s.

status: number
retryAfterMs?: number | null

Source: core/errors.ts:229

processTxtRRset function

function processTxtRRset(records: readonly TxtRecord[]): TxtRRsetOutcome

Process every TXT record at _sloppyv.D (02 §3.4): no sv1 record means "no record" (the .well-known fallback runs); one or more valid records with one normalized base URL are a delegation; any malformed sv1 record or several base URLs is discovery.record_invalid and the fallback is not consulted (PD-02-1). NXDOMAIN/NODATA is passed as an empty list.

records: readonly TxtRecord[]

Source: discovery/record.ts:103

proposalRef function

function proposalRef(parsed: ParsedProposalMessage): Promise<Uint8Array<ArrayBufferLike>>

The ProposalRef of a parsed proposal: RefHash("MLS 1.0 Proposal Reference", AuthenticatedContent) where AuthenticatedContent is wire_format || FramedContent || signature<V> (RFC 9420 §5.2, §6.1; 13 §6.3, vector T-PREF). base64url of it is the ref of ServerProposal (13 §7.7).

Source: mls/provider.ts:890

providerAllowsSignup function

function providerAllowsSignup(provider: Pick<AuthProvider, "signup">): boolean

Whether a provider of ServerMetadata auth.providers may create new accounts: signup absent means true (05 §3.3). The server's answer at sign-up is authoritative.

provider: Pick<AuthProvider, "signup">

Source: auth/session.ts:724

providerType function

function providerType(provider: Pick<AuthProvider, "type">): AuthProviderType

auth.providers[].type with unknown values treated as oidc (02 §7.3.2).

provider: Pick<AuthProvider, "type">

Source: discovery/metadata.ts:350

publicSuffixListFromRules function

function publicSuffixListFromRules(rules: Iterable<string>, wildcards?: Iterable<string>, exceptions?: Iterable<string>): PublicSuffixList

Build a list from explicit rules, for example the test list of 02 §20.3: ["com", "org", "net", "edu", "co.uk", "github.io"].

rules: Iterable<string>
wildcards: Iterable<string>

Default: []

exceptions: Iterable<string>

Default: []

Source: discovery/evidence.ts:120

pushAuthError function

function pushAuthError(code: "push.unauthenticated" | "push.home_blocked", data?: Record<string, unknown>, detail?: string): SloppyVoiceError

Build (not throw) the push.unauthenticated (401, data.reason as in 06 §8.5) or push.home_blocked (403) problem of 19 §11.5 with the registry's status, retryable and userAction (19 §17.2).

code: "push.unauthenticated" | "push.home_blocked"
data?: Record<string, unknown>
detail?: string

Source: auth/remote.ts:920

pushCollapseKey function

function pushCollapseKey(kColl: Uint8Array, topic: string): Promise<string>

A push collapse key (19 §10.3): b64u(HMAC-SHA256(K_coll, "sv1 push collapse" || 0x00 || opaque(topic))[0..16]), 22 characters. K_coll is the home server's 32-byte per-registration secret; topic comes from callCollapseTopic or recordCollapseTopic. Server side.

kColl: Uint8Array
topic: string

Source: api/push.ts:360

pushCollapseMessage function

function pushCollapseMessage(topic: string): Uint8Array

The HMAC message of a collapse key: "sv1 push collapse" || 0x00 || opaque(topic) (19 §10.3).

topic: string

Source: api/push.ts:351

pushGatewayAllowed function

function pushGatewayAllowed(metadata: Pick<ServerMetadata, "endpoints">, gatewayUrl: string): boolean

Whether this server, as a home server, delivers to the push gateway at gatewayUrl (02 §7.3.1, 19): always under any; under listed only when the normalized URL is in gateways. A client that sees its build's gateway missing can say, before sign-in, that notifications won't arrive.

metadata: Pick<ServerMetadata, "endpoints">
gatewayUrl: string

Source: discovery/metadata.ts:371

pushGatewayPolicy function

function pushGatewayPolicy(metadata: Pick<ServerMetadata, "endpoints">): PushGatewayPolicy

endpoints.push.gatewayPolicy with unknown values treated as listed (02 §7.3.1).

metadata: Pick<ServerMetadata, "endpoints">

Source: discovery/metadata.ts:362

pushTypesForPlatform function

function pushTypesForPlatform(platform: GatewayPlatform): PushType[]

The push types a registration for a gateway platform may list (19 §9.1 types, §11.5 step 3): apns_voip push keys ["call"]; apns push keys alert and background; fcm any.

platform: GatewayPlatform

Source: api/push.ts:55

queriedDomainProblem function

function queriedDomainProblem(domain: unknown, opts?: QueriedDomainOptions): string | null

Why domain isn't a valid queried domain (02 §5.1), or null if it is: a lowercase A-label of at most 253 octets with at least two labels, not an IP address and not a special-use name. Conversion from U-labels is 01's job (prepareDomain); this check doesn't lowercase.

domain: unknown
opts: QueriedDomainOptions

Default: {}

Source: discovery/domain.ts:51

raisesNewSignInNotice function

function raisesNewSignInNotice(event: Pick<DeviceAddedPayload, "device" | "via">, own: OwnDevice): boolean

Whether a device.added event raises the new-sign-in notice W4d on this device (05 §12.12, D-084): via is login (an unknown via counts as login, 05 §18), the device isn't this one, and it was created after this device's own record. Raise it once per did, remembered in device-local storage (not the vault); bot clients raise nothing. Any other via only updates the device list and MUST NOT be shown as a warning.

event: Pick<DeviceAddedPayload, "device" | "via">

Source: auth/session.ts:764

randomBytes function

function randomBytes(n: number): Uint8Array

Return n cryptographically secure random bytes from crypto.getRandomValues (used for UUIDv7 rand_b per 03 §8.2 item 2, jti values per 00 §7.6, and reconnect and retry jitter per 03 §2.7 and §5.11).

n: number

Source: core/random.ts:21

randomFloat function

function randomFloat(source?: RandomSource): number

A uniform random number in [0, 1) with 53 bits of precision, drawn from source. Used for the "full jitter" delays of 03 §2.7 and §5.11.

source: RandomSource

Default: randomBytes

Source: core/random.ts:34

rangesContain function

function rangesContain(ranges: readonly VisibilityRange[], seq: number): boolean

Whether seq lies in one of the ranges (09 §7.2 condition 2, ranges only).

ranges: readonly VisibilityRange[]
seq: number

Source: api/channels.ts:467

readBodyCapped function

function readBodyCapped(res: Response, max: number): Promise<Uint8Array<ArrayBufferLike> | null>

Read a response body, failing (returning null) if it exceeds max octets.

res: Response
max: number

Source: discovery/fetch.ts:36

readDnsName function

function readDnsName(b: Uint8Array, offset: number): { name: string; next: number }

Read a possibly compressed domain name (RFC 1035 §4.1.4). Returns the lowercase name and the offset after it.

b: Uint8Array
offset: number

Source: discovery/doh.ts:73

receivedContentIssues function

function receivedContentIssues(kind: string, content: unknown, secure: boolean): ContentIssue[]

The structural checks a receiving client applies to a content object of kind (11 §3.9 row 2): required members present and well typed. Rules whose failure 11 §3.9 handles another way are not checked here: mentions that don't match the tokens (the tokens win), forbidden characters in text (replaced with U+FFFD), and oversized thumbnails (ignored, see isUsableThumbnail). secure requires key and sha256 on every file and thumbnail reference (11 §3.6). Returns [] when the entry can be shown.

kind: string
content: unknown
secure: boolean

Source: content.ts:738

reconnectDelayBound function

function reconnectDelayBound(n: number): number

Upper bound of the delay before reconnect retry n (from 0): min(30 s, 1 s × 2^n) (03 §5.11 item 1, §17.9).

n: number

Source: core/backoff.ts:13

recordCollapseTopic function

function recordCollapseTopic(recordId: string): string

The collapse topic of a record's key: rec: + record id (19 §10.3).

recordId: string

Source: api/push.ts:335

recoveryPhraseIndices function

function recoveryPhraseIndices(entropy: Uint8Array): Promise<number[]>

The 8 word indices of E (08 §4.1 encoding steps 1 to 3).

entropy: Uint8Array

Source: api/backup.ts:217

recoveryRid function

function recoveryRid(kVid: Uint8Array): Promise<string>

rid of the recovery record: VID(lv("recovery")) (08 §8.5).

kVid: Uint8Array

Source: api/vault.ts:111

recoveryWordCompletions function

function recoveryWordCompletions(prefix: string, limit?: number): string[]

Autocomplete candidates for a partly typed word, from the second letter (08 §4.3 user-interface rules). Returns at most limit words that start with prefix.

prefix: string
limit: number

Default: 8

Source: api/backup.ts:282

redirectUriForm function

function redirectUriForm(uri: string): RedirectUriForm

Classify a redirect URI by the forms of 05 §5.2, or throw sdk.invalid_argument if it has none: loopback (http, literal 127.0.0.1 or [::1], never localhost or another spelling of the address), claimed HTTPS, or a private-use scheme containing a period that isn't reserved. No fragment in any form.

uri: string

Source: auth/oauth.ts:211

redirectUriMatches function

function redirectUriMatches(registered: readonly string[], presented: string): boolean

Whether presented matches one of a client's registered redirect_uris (05 §5.2, §21.4): exact string comparison, except that a loopback URI's port is ignored. A server-side rule, here for test servers and the 05 §21.4 vectors.

registered: readonly string[]
presented: string

Source: auth/oauth.ts:247

registerWithGateway function

function registerWithGateway(http: HttpClient, gatewayUrl: string, body: GatewayRegisterRequest, opts?: RequestOptions): Promise<GatewayRegisterResponse>

POST {gatewayUrl}/v1/register (19 §11.2) through any HttpClient, for code that has no home-server client yet. See PushApi.registerWithGateway.

gatewayUrl: string

Source: api/push.ts:234

registrableDomain function

function registrableDomain(host: string, psl: PublicSuffixList): string | undefined

registrableDomain(x) of 02 §9.1: the public suffix plus one label, or undefined when x is itself a public suffix.

host: string

Source: discovery/evidence.ts:150

registrationPolicy function

function registrationPolicy(metadata: Pick<ServerMetadata, "auth">): RegistrationPolicy

auth.registration with unknown values treated as closed (02 §7.3.2).

metadata: Pick<ServerMetadata, "auth">

Source: discovery/metadata.ts:356

registrationPolicyOf function

function registrationPolicyOf(registration: unknown): RegistrationPolicy

ServerMetadata auth.registration for logic: an unknown value is closed (05 §3.3).

registration: unknown

Source: auth/session.ts:715

rejoinAttemptOffset function

function rejoinAttemptOffset(index: number): number

The start time of auto-rejoin attempt index (0-based), in ms after t0: 0, 1, 2, 4, 8, 15 s, then every 30 s (45, 75, 105 s, …) with no limit (15 §10.5, D-013, D-047).

index: number

Source: calls/continuity.ts:70

relayClosingAction function

function relayClosingAction(reason: RelayClosingReason, opts?: { openedReplacement?: boolean }): RelayClosingAction

Classify a relay.closing reason (15 §6.6). An unknown reason is an unexpected drop.

opts: { openedReplacement?: boolean }

Default: {}

Source: calls/relay.ts:186

relayConnectFailureAction function

function relayConnectFailureAction(error: unknown): { class: RelayConnectFailureClass; retryAfterMs: number | null; code: string | null }

Classify a /connect failure (15 §6.2 item 3). Every rejoin returns a fresh ticket; a ticket is never reused.

error: unknown

Source: calls/relay.ts:222

relayConnectUrl function

function relayConnectUrl(relayUrl: string): string

connect-url = relay-url "/connect" (15 §6.1 item 3). Throws sdk.invalid_argument for an invalid relay URL.

relayUrl: string

Source: calls/relay.ts:70

relayTicketClaimsProblem function

function relayTicketClaimsProblem(claims: Record<string, unknown>): string | null

Why claims doesn't have the shape of 15 §5.1, or null: every claim present with its type, pid 0–65535, prof a subset of voice-dc/1 and video-dc/1, jti base64url of at least 128 bits (22 characters).

claims: Record<string, unknown>

Source: calls/relay-ticket.ts:38

removeItemsAndRecompute function

function removeItemsAndRecompute<T extends RecomputableNotification>(record: T, remove: (item: NotifyItem, index: number) => boolean): T | null

Remove items and recompute a record from the rest (19 §6.2 "Per-item evaluation", §6.3 withdrawal): kind = highest-priority remaining kind; sender and eventAt = the latest remaining item's; otherSenders = distinct remaining senders other than sender; count = original count minus the removed items, but at least the remaining items; preview = null if the latest item was removed. Returns null when no item remains. When nothing is removed the input is returned unchanged.

record: T
remove: (item: NotifyItem, index: number) => boolean

Source: api/notifications.ts:473

repeatedQuery function

function repeatedQuery(values: readonly (string | number)[]): RepeatedQueryValue

Mark a list to be sent as a repeated query parameter, name=a&name=b, where the owner defines it as repeatable (03 §2.6 item 4).

values: readonly (string | number)[]

Source: core/http.ts:77

reportItemPresentation function

function reportItemPresentation(item: Pick<ReportItem, "itemVerification" | "withheld" | "evidenceSource">): "withheld" | "verified" | "plaintext" | "plaintext_from_origin" | "unverified"

How a moderator client may present an item (10 §10.8, 14 §13.5): content is shown only for verified and plaintext results; items with withheld show the security door (G1/G2); everything else is a one-line explanation.

item: Pick<ReportItem, "itemVerification" | "withheld" | "evidenceSource">

Source: api/reports.ts:217

requireBaseUrl function

function requireBaseUrl(u: unknown, field?: string): string

Like normalizeBaseUrl, but throws sdk.invalid_argument with the problem in data.problem.

u: unknown
field: string

Default: 'baseUrl'

Source: discovery/base-url.ts:153

resolveRecoveryWord function

function resolveRecoveryWord(token: string): string | null

Resolve one token (08 §4.3 step 4): an exact word, or a unique 4-letter prefix of at least 4 letters.

token: string

Source: api/backup.ts:268

restartsLogin function

function restartsLogin(error: unknown): boolean

Whether an error means the login must be restarted from the beginning (05 §8.4): auth.identity_already_linked and auth.signup_token_invalid at sign-up. The restart signs in to the existing account.

error: unknown

Source: auth/session.ts:813

resyncDiscardsCache function

function resyncDiscardsCache(reason: unknown): boolean

Whether a resync reason makes the client discard its event-derived cached state for the stream before refetching: ahead and server_reset, because the server no longer has, or has renumbered, events the client saw (03 §7.5).

reason: unknown

Source: events/tracker.ts:42

retryDelay function

function retryDelay(n: number, minMs: number | null | undefined, random?: () => number): number

The delay before HTTP retry n: uniform in [0, retryDelayBound(n)] ("full jitter"), but never less than minMs (retryAfterMs or Retry-After) (03 §2.7). random returns a value in [0, 1).

n: number
minMs: number | null | undefined
random: () => number

Default: randomFloat

Source: core/http.ts:426

retryDelayBound function

function retryDelayBound(n: number): number

Upper bound of the delay before HTTP retry n (from 0): min(30 000, 500 × 2^n) ms (03 §2.7).

n: number

Source: core/http.ts:417

revokedReasonOf function

function revokedReasonOf(reason: unknown): RevokedReason

revokedReason (or auth.session_revoked data.reason) for logic: an unknown value is other (05 §12.3).

reason: unknown

Source: auth/session.ts:700

s2sBodyHash function

function s2sBodyHash(content: string | Uint8Array<ArrayBufferLike>): Promise<string>

bh of 06 §8.4: base64url (no padding) of the SHA-256 of the request content. Serialize the body once, hash those octets and send the same octets.

content: string | Uint8Array<ArrayBufferLike>

Source: auth/remote.ts:746

s2sRetryDelayMs function

function s2sRetryDelayMs(n: number, u?: number): number

The S2S delivery back-off of 06 §9.7: delay(n) = min(2^(n−1), 3600) s × u in milliseconds, where n ≥ 1 counts the consecutive failed attempts and u is the jitter factor, uniform in [0.8, 1.2] (pass 1 for the nominal schedule of TV-8, §18.9). A larger Retry-After or retryAfterMs replaces the result. For server authors; clients never deliver S2S events.

n: number
u: number

Default: 1

Source: auth/remote.ts:1056

sameReactionKey function

function sameReactionKey(a: string, b: string): boolean

Whether two reaction keys count as one reaction (11 §3.7.2).

a: string
b: string

Source: content.ts:473

sanitizeReceivedText function

function sanitizeReceivedText(text: string): string

Replace the characters 11 §3.2 rule 1 forbids with U+FFFD, as a receiving client does with decrypted secure text before rendering.

text: string

Source: content.ts:220

sdkError function

function sdkError(code: SdkErrorCode, message: string, data?: Record<string, unknown>): SloppyVoiceError

Build (not throw) a SloppyVoiceError for an SDK-side failure with an sdk.* code: status 0, retryable: false, userAction: "none".

message: string
data?: Record<string, unknown>

Source: core/errors.ts:179

sdpHasRelayCandidate function

function sdpHasRelayCandidate(sdp: string): boolean

Whether an SDP string contains at least one relayed ICE candidate (typ relay, 15 §6.10.1).

sdp: string

Source: calls/relay.ts:450

sdpIceUfrag function

function sdpIceUfrag(sdp: string): string | null

Extract the first a=ice-ufrag: value from an SDP string, or null if absent.

sdp: string

Source: calls/relay.ts:455

sealAckProof function

function sealAckProof(input: { kAck: Uint8Array; proof: AckProofPlaintext; pairingId: string; approverDid: string; addr: string; nonce?: Uint8Array<ArrayBufferLike>; random?: RandomSource }): Promise<PairingPayloadBody>

Encrypt the ack proof (new device → approver) (08 §6.7.3).

input: { kAck: Uint8Array; proof: AckProofPlaintext; pairingId: string; approverDid: string; addr: string; nonce?: Uint8Array<ArrayBufferLike>; random?: RandomSource }

Source: api/pairing.ts:628

sealPairingPayload function

function sealPairingPayload(input: { kPayload: Uint8Array; payload: PairingPayloadPlaintext; pairingId: string; nonce?: Uint8Array<ArrayBufferLike>; random?: RandomSource }): Promise<PairingPayloadBody>

Encrypt the pairing payload (approver → new device) (08 §6.7.2). Only after the approver's own run is confirmed.

input: { kPayload: Uint8Array; payload: PairingPayloadPlaintext; pairingId: string; nonce?: Uint8Array<ArrayBufferLike>; random?: RandomSource }

Source: api/pairing.ts:548

sealVaultKeyGrant function

function sealVaultKeyGrant(input: { kVault: Uint8Array; boxPub: Uint8Array; addr: string; did: string; igen: number; vgen: number }): Promise<VaultGrantInput>

Seal K_vault(vgen) to one device's verified box key with HPKE base mode (08 §10.3). Verify the box key first (verifyBoxKey).

input: { kVault: Uint8Array; boxPub: Uint8Array; addr: string; did: string; igen: number; vgen: number }

Source: api/vault.ts:613

sealVaultKeyLink function

function sealVaultKeyLink(input: { newKey: Uint8Array; vgen: number; linkedKey: Uint8Array; linkedVgen: number; addr: string; igen: number; nonce?: Uint8Array<ArrayBufferLike>; random?: RandomSource }): Promise<VaultKeyLink>

Create the VaultKeyLink of generation vgen wrapping K_vault(linkedVgen) under K_link(vgen, linkedVgen) (08 §10.2).

input: { newKey: Uint8Array; vgen: number; linkedKey: Uint8Array; linkedVgen: number; addr: string; igen: number; nonce?: Uint8Array<ArrayBufferLike>; random?: RandomSource }

Source: api/vault.ts:316

secPinRid function

function secPinRid(kVid: Uint8Array, host: string, ctx: string | null): Promise<string>

rid of a sec_pin record: VID(lv("sec_pin") || lv(host) || lv(ctx)), ctx empty for a community pin (08 §8.5).

kVid: Uint8Array
host: string
ctx: string | null

Source: api/vault.ts:101

secureHostOutcome function

function secureHostOutcome(input: { kind: DmKind; security: "insecure" | "secure"; participants?: readonly [string, string]; isSecureServer: IsSecureServer }): SecureHostOutcome

The outcome of 12 §13.1 for a DM on a secure hosting server, given its computed security after the change (a server upgrade, or a participant's downgrade). A secure DM is unchanged; an insecure group DM closes; an insecure 1:1 DM goes to encryption_pending in place if the rule host with the new flags is a secure server, and otherwise closes with a successor at the rule host. Test vectors U-1 to U-5.

input: { kind: DmKind; security: "insecure" | "secure"; participants?: readonly [string, string]; isSecureServer: IsSecureServer }

Source: api/dms.ts:686

securityDisagrees function

function securityDisagrees(computed: "insecure" | "secure", reported: DmSecurity): boolean

Whether the hosting server's reported security disagrees with the client's own computation, in which case the client refetches the IdentityStates concerned (at most once per 30 s per DM) and keeps outgoing messages queued (12 §11.1).

computed: "insecure" | "secure"
reported: DmSecurity

Source: api/dms.ts:587

senderKey function

function senderKey(sender: NotifySender): string

A key identifying a sender for the "distinct senders" counts of otherSenders (19 §4.5, §5.2, §6.2): the address, or the webhook ID for 11's webhook Sender.

sender: NotifySender

Source: api/notifications.ts:398

serverKeyThumbprint function

function serverKeyThumbprint(key: Pick<ServerKey, "x">): Promise<string>

The RFC 7638 thumbprint of a ServerKey (02 §11.1: keys are compared by thumbprint, never by kid).

key: Pick<ServerKey, "x">

Source: discovery/keys.ts:126

settingsRid function

function settingsRid(kVid: Uint8Array, name: string): Promise<string>

rid of a settings record: VID(lv("settings") || lv(name)) (08 §8.5).

kVid: Uint8Array
name: string

Source: api/vault.ts:106

sharedKeysRid function

function sharedKeysRid(kVid: Uint8Array, host: string, ctx: string, shareId: string, part: number): Promise<string>

rid of a shared_keys record: VID(lv("shared_keys") || lv(host) || lv(ctx) || shareId || u32(part)) (08 §8.5).

kVid: Uint8Array
host: string
ctx: string
shareId: string
part: number

Source: api/vault.ts:89

shouldApplyEvent function

function shouldApplyEvent(cached: Pick<Message, "updatedSeq">, seq: number): boolean

Whether a message.edited, message.deleted, reaction.added or reaction.removed event with envelope seq should be applied to a cached Message: only if seq is greater than its cached updatedSeq (11 §7.6).

cached: Pick<Message, "updatedSeq">
seq: number

Source: api/messages.ts:493

shouldDeleteRegistrationAfter function

function shouldDeleteRegistrationAfter(error: { code: string; retryable: boolean }): boolean

Whether a client MUST delete the index registration it made before POST /v1/dms after that request failed with error (12 §7.1, "Cleaning up after a failed creation"): yes for every error whose retryable is false; no for dm.encryption_pending and other retryable errors. When the outbox gives up on a retryable error, the client deletes it too.

error: { code: string; retryable: boolean }

Source: api/dms.ts:330

showReconnectingBadge function

function showReconnectingBadge(state: SeatState, reconnectingSince: number | null, now: number): boolean

Whether to show the reconnecting badge for a seat (15 §2.6, §10.3 item 2): only once it has been reconnecting for 2 s. reconnectingSince is when this client saw the seat become reconnecting (monotonic ms), or null.

state: SeatState
reconnectingSince: number | null
now: number

Source: calls/call.ts:199

signRelayTicket function

function signRelayTicket(claims: RelayTicketClaims, signer: Ed25519Signer, kid: string): Promise<string>

Sign a RelayTicket (15 §5, for hosting servers and test servers). The claims are serialized in the order of 15 §5.1; exp − iat must be at most 60. kid is domain#keyId of a sign key of the issuer (02); its domain must equal iss.

kid: string

Source: calls/relay-ticket.ts:85

signVaultGeneration function

function signVaultGeneration(dsk: Ed25519Signer, f: VaultGenerationFields): Promise<string>

Sign a generation with the creating device's DSK, label vault-generation (08 §10.2). Returns base64url.

Source: api/vault.ts:406

sortChannelsForDisplay function

function sortChannelsForDisplay(channels: readonly Channel[], categories: readonly Category[]): ChannelDisplayOrder

Order channels for display (09 §6.5, normative for clients): uncategorized channels first, by position; then each category by position, each with its channels by position. Ties are broken by ctx byte-wise (ASCII, so code-unit order). Text and voice channels are not separated. Categories without channels are kept (the server already omits the ones a caller shouldn't see, 09 §6.6).

channels: readonly Channel[]
categories: readonly Category[]

Source: api/channels.ts:129

sortPermissions function

function sortPermissions(names: Iterable<string>): KnownPermission[]

The known names of names, deduplicated and in registry order (10 §3.1, §6.4). Unknown names are dropped, as computation ignores them (10 §3.3).

names: Iterable<string>

Source: permissions.ts:127

splitPublicRead function

function splitPublicRead(opts: PublicReadOptions | undefined, defaultAuth: "none" | "session"): { auth: "none" | "session"; rest: RequestOptions }

The plain request options of a PublicReadOptions, without auth (only signal and idempotencyKey).

opts: PublicReadOptions | undefined
defaultAuth: "none" | "session"

Source: core/http.ts:52

staleUsable function

function staleUsable(expiredAtMs: number, nowMs: number): boolean

Whether a result that expired at expiredAtMs may still be used stale at nowMs after a temporary failure (02 §13.2: up to 7 days after it expired).

expiredAtMs: number
nowMs: number

Source: discovery/cache.ts:74

staticToken function

function staticToken(token: string, scheme?: AuthScheme): TokenProvider

A provider for a token obtained elsewhere (03 §3.1). It never refreshes, so a 401 is passed straight to the caller. scheme defaults to Bearer.

token: string
scheme: AuthScheme

Default: 'Bearer'

Source: core/auth.ts:150

staticTxtResolver function

function staticTxtResolver(table: Record<string, TxtLookupResult | readonly TxtRecord[]>, addresses?: Record<string, AddressLookupResult>): TxtResolver

A resolver that answers from a fixed table, for tests and for development setups. Names not in the table are NXDOMAIN.

table: Record<string, TxtLookupResult | readonly TxtRecord[]>
addresses?: Record<string, AddressLookupResult>

Source: discovery/txt.ts:60

statusOf function

function statusOf(p: OwnPresence): PresenceStatusUpdate

The account-level members of an OwnPresence, to copy to another server (11 §11.6 rule 2).

Source: api/presence.ts:105

stepNotificationWindow function

function stepNotificationWindow(w: NotificationWindowState, input: NotificationWindowInput): { window: NotificationWindowState; actions: NotificationWindowAction[] }

Advance a notification window by one input, following the state machine of 19 §4.5 exactly. Pure: returns the new state and the actions to perform (send notify.triggered per 19 §4.4; send one notify.event with the aggregate, attaching preview and ticket). The caller tracks the rate cap across windows and fires deadline inputs (up to 2 s late is allowed).

Source: api/notifications.ts:571

t6CheckNeeded function

function t6CheckNeeded(pin: ChannelSecPin, address: string, resolved: { ctx: string; security: ChannelSecurity | null | undefined }, now: string): boolean

Whether resolving address (by address lookup, link or channel list) calls for the check before T6 (09 §13.4): the address is P.address or a previous address of P replaced less than 90 days ago (or at an unknown time), it now names a channel with another ctx whose security is insecure, and P.deletedSeenAt is null. When true, fetch GET /v1/channels/{P.ctx} and pass the answer to decideT6.

address: string
resolved: { ctx: string; security: ChannelSecurity | null | undefined }
now: string

Source: api/channels.ts:899

timeline function

function timeline<T extends { seq: number }>(http: HttpClient, path: string, params: TimelineParams, opts?: RequestOptions): Pager<T, TimelinePage<T>>

Page through a timeline by seq (03 §13.1). Pages arrive in ascending seq order whatever the direction.

  • With after, iteration walks forwards (newer): items are yielded in ascending seq, and each next page uses after = the last item's seq.
  • With before, or neither (the newest page first), iteration walks backwards (older): items are yielded in descending seq, and each next page uses before = the first item's seq.

Iteration stops when hasMore is false or a page is empty (03 §13.1 rule 5). A seq or headSeq seen here never advances an event-stream position (03 §2.8).

path: string

Source: core/pagination.ts:96

toChannelRef function

function toChannelRef(id: string): `ch:${string}`

Normalize a {id} path value (09 §2 channel-id): a UUIDv7, ch:<UUIDv7> or ch%3A<UUIDv7>, to the context reference ch:<UUIDv7>. Throws sdk.invalid_argument otherwise.

id: string

Source: api/channels.ts:58

tokenHint function

function tokenHint(token: string): string

The last 4 characters of a token: the tokenHint of a bot device (05 §12.2, §21.2).

token: string

Source: auth/oauth.ts:98

tokenKind function

function tokenKind(token: unknown): "bot" | "access" | "refresh" | "signup" | "code" | null

The kind of a well-formed Sloppy Voice credential, from its prefix, or null if token isn't a well-formed sv-token (05 §7.4). Padding and uppercase prefixes are malformed (05 §21.2).

token: unknown

Source: auth/oauth.ts:74

tokenStorageHash function

function tokenStorageHash(token: string): Promise<string>

The value a server stores for a token: SHA-256 over the ASCII bytes of the whole token, prefix included, as lowercase hex (05 §7.4, §21.2). Clients never need it; it is here for test servers and the vectors of 05 §21.2.

token: string

Source: auth/oauth.ts:90

toPeerPin function

function toPeerPin(pin: ServerPinRecord): PeerPin

A pin in its wire form (02 §10.5), for diagnostics and admin interfaces.

Source: discovery/pins.ts:272

topPosition function

function topPosition(member: MemberLike, roles: readonly RoleLike[]): number

Top position (10 §2): the highest position among the roles a member holds; 0 for a member who holds only everyone, and 0 for anyone without an active or needs_encryption membership (10 §8.2 rule 1).

member: MemberLike
roles: readonly RoleLike[]

Source: permissions.ts:253

toRfc3339Ms function

function toRfc3339Ms(time: number | Date): string

Format a time as the producer form of 03 §9: YYYY-MM-DDTHH:MM:SS.mmmZ, UTC, exactly three fractional digits (03 §9 rule 1, 00 §7.7).

time: number | Date

Source: core/time.ts:50

turnRtcConfiguration function

function turnRtcConfiguration(servers: readonly TurnIceServer[]): { iceServers: TurnIceServer[]; iceTransportPolicy: "relay" }

Build an RTCConfiguration forcing relayed transport through the given TURN servers (15 §6.10.1).

servers: readonly TurnIceServer[]

Source: calls/relay.ts:425

txtRecordText function

function txtRecordText(record: TxtRecord): { text: string; octets: number; ascii: boolean }

The record text: the concatenation of all character-strings of one resource record, with nothing inserted between them (02 §3.2, as RFC 7208 §3.3). Returned with the octet count.

record: TxtRecord

Source: discovery/record.ts:35

typingLine function

function typingLine(names: readonly string[]): string

The typing line of 11 §10.3 rule 3: "Alice is typing…", "Alice and Bob are typing…", "Several people are typing…" for three or more, or '' for none. Copy may be refined by 20.

names: readonly string[]

Source: api/typing.ts:156

unavailableAttachmentIds function

function unavailableAttachmentIds(content: Pick<MessageContent, "attachments">, boundIds: readonly string[]): Set<string>

The attachment and thumbnail IDs of a received message or edit that a receiver shows as "This file isn't available" (11 §3.9): the IDs in the decrypted content, taken together, must be exactly the server-bound attachmentIds of the entry (11 §4.3, §5.2, §5.3). Returns the IDs that aren't bound, and every ID that appears more than once in the content (a blob binds to one reference only, 11 §3.6 rule 1, §14.5). The rest of the message is shown normally. Pass [] when the entry has no bound IDs.

content: Pick<MessageContent, "attachments">
boundIds: readonly string[]

Source: content.ts:961

unsupportedVersionError function

function unsupportedVersionError(data: Record<string, unknown>): SloppyVoiceError

core.unsupported_version (03 §10.5) for metadata whose versions are all newer than the consumer's (02 §7.4 step 5): userAction: update_app, a definitive failure for caching.

data: Record<string, unknown>

Source: discovery/errors.ts:59

utf8ByteLength function

function utf8ByteLength(s: string): number

The UTF-8 length in bytes of a string, without allocating (03 §16.2: maxEventBytes counts UTF-8 bytes). Lone surrogates count as 3 bytes, the size of the U+FFFD that replaces them on encoding.

s: string

Source: events/websocket.ts:119

uuidToBytes function

function uuidToBytes(uuid: string): Uint8Array

The binary form of a UUID: its 16 bytes in the order of the hexadecimal string (03 §8.2 item 3, RFC 9562 §4). This is the form used for mid in K_msg (14). Accepts lowercase hyphenated UUIDs only (03 §8.1 rule 2).

uuid: string

Source: core/uuidv7.ts:30

uuidv7 function

function uuidv7(now?: number, random?: RandomSource): string

Generate a UUIDv7 (RFC 9562 §5.7, 03 §8.2) for client-generated IDs such as a message mid (00 §7.6, 03 §8.2 item 4), an envelope id or an Idempotency-Key (03 §14.2 item 2). IDs from this function are strictly increasing within the process.

now is Unix milliseconds (default: the device clock); random overrides the CSPRNG. For a generator with its own clock and state, use UuidV7Generator.

now?: number
random?: RandomSource

Source: core/uuidv7.ts:139

uuidV7Timestamp function

function uuidV7Timestamp(uuid: string): number

The Unix time in milliseconds embedded in a UUIDv7 (RFC 9562 §5.7). Diagnostics only: clients MUST NOT parse the time out of a UUIDv7 for any other purpose (03 §8.1 rule 3).

uuid: string

Source: core/uuidv7.ts:55

validateCreateDmRequest function

function validateCreateDmRequest(body: CreateDmRequest, self?: string): void

Check the shape of a POST /v1/dms body before sending it (12 §7.2 step 2): peer for direct, at least 2 distinct participants for group (not the caller, if self is given), bootstrap only for a secure direct DM, commit only with bootstrap, a valid name for groups only, at most 10 communityHints that are canonical domains, and a replaces link of the same kind (dm: for direct, gdm: for group). Throws sdk.invalid_argument. The hosting server enforces maxGroupDmParticipants (409 dm.too_many_participants).

self?: string

Source: api/dms.ts:488

validateNotifyEvent function

function validateNotifyEvent(d: unknown, opts: ValidateNotifyEventOptions): NotifyEventValidation

Validate a notify.event d at the receiving home server, rows V1 to V7 of 19 §5.6 in order. accepted here means "passes V1–V7": the caller still applies V8 (unknown or deleted recipient, legitimacy filter of 19 §6.1), which must also answer ignored.

d: unknown

Source: api/notifications.ts:645

validateServerMetadata function

function validateServerMetadata(body: unknown, opts: ValidateMetadataOptions): Promise<ServerMetadata>

Validate ServerMetadata fetched from base URL B (02 §7.4). body is the raw response body (bytes or text: checked for size, I-JSON and duplicate member names) or an already-parsed value (step 1's duplicate check is then skipped). Returns a clean copy in which unknown members are dropped, invalid cosmetic members are dropped, keys with an unknown purpose or status are dropped, features elements that don't match the grammar are dropped, an invalid links.join is removed (02 §7.3.4) and an invalid links.web is kept as given (present, matching no origin).

Failures: discovery.metadata_invalid with data.reason; core.unsupported_version when every listed version is newer than the consumer's; discovery.version_unsupported when the server is too old (02 §7.4 step 5). Signatures in keyChain are checked only when the chain is used.

body: unknown

Source: discovery/metadata.ts:128

vaultBucket function

function vaultBucket(kVid: Uint8Array, host: string, ctx: string): Promise<string>

The bucket of a context: VID(lv("bucket") || lv(host) || lv(ctx)) (08 §8.5), shared by archive and shared_keys.

kVid: Uint8Array
host: string
ctx: string

Source: api/vault.ts:84

vaultGenerationTbs function

function vaultGenerationTbs(f: VaultGenerationFields): Uint8Array

VaultGenerationTBS = u8(1) || lv(addr) || u32(igen) || u32(vgen) || u32(linked_vgen) || kcv || lv(link_nonce) || lv(link_ct) || u64(id_state_ver) || creator_did (08 §10.2).

Source: api/vault.ts:390

vaultGrantInfo function

function vaultGrantInfo(addr: string, did: string, igen: number, vgen: number): Uint8Array

info = "sv1 vault grant" || 0x00 || lv(addr) || did || u32(igen) || u32(vgen) (08 §10.3).

addr: string
did: string
igen: number
vgen: number

Source: api/vault.ts:605

vaultId function

function vaultId(kVid: Uint8Array, input: Uint8Array): Promise<Uint8Array<ArrayBufferLike>>

VID(input) = HMAC-SHA256(K_vid, "sv1 vault id" || 0x00 || input)[0..16] (08 §8.5).

kVid: Uint8Array
input: Uint8Array

Source: api/vault.ts:73

vaultKeyCheckValue function

function vaultKeyCheckValue(kVault: Uint8Array): Promise<string>

kcv(g): the first 8 bytes of HKDF-Expand(K_vault(g), "sv1 vault" || 0x00 || 0x03, 32), base64url (08 §8.2).

kVault: Uint8Array

Source: api/vault.ts:173

vaultLinkAad function

function vaultLinkAad(addr: string, igen: number, vgen: number, linkedVgen: number): Uint8Array

AAD of a VaultKeyLink: "sv1 vault" || 0x00 || 0x02 || lv(addr) || u32(igen) || u32(g) || u32(l) (08 §10.2).

addr: string
igen: number
vgen: number
linkedVgen: number

Source: api/vault.ts:311

vaultLinkKey function

function vaultLinkKey(kVault: Uint8Array, linkedVgen: number): Promise<Uint8Array<ArrayBufferLike>>

K_link(g, l) = HKDF-Expand(K_vault(g), "sv1 vault" || 0x00 || 0x02 || u32(l), 32) (08 §8.2).

kVault: Uint8Array
linkedVgen: number

Source: api/vault.ts:167

vaultRecordAad function

function vaultRecordAad(r: { rid: string; type: string; igen: number; vgen: number; ver: number; addr: string }): Uint8Array

AAD = "sv1 vault" || 0x00 || 0x01 || rid || lv(type) || u32(igen) || u32(vgen) || u32(ver) || lv(addr) (08 §8.4).

r: { rid: string; type: string; igen: number; vgen: number; ver: number; addr: string }

Source: api/vault.ts:187

vaultRecordKey function

function vaultRecordKey(kVault: Uint8Array, rid: string): Promise<Uint8Array<ArrayBufferLike>>

K_rec(g, rid) = HKDF-Expand(K_vault(g), "sv1 vault" || 0x00 || 0x01 || rid, 32) (08 §8.2).

kVault: Uint8Array
rid: string

Source: api/vault.ts:161

vaultRecordLocation function

function vaultRecordLocation(kVid: Uint8Array, pt: VaultPlaintext): Promise<{ rid: string; bucket: string | null } | null>

The rid and bucket a plaintext must have (08 §8.4, §8.5), or null for a type this SDK doesn't know (clients ignore unknown types, 08 §8.3).

kVid: Uint8Array

Source: api/vault.ts:122

verifyBoxKey function

function verifyBoxKey(boxKey: Pick<BoxKey, "did" | "igen" | "pub" | "devcert" | "sig">, ctx: { addr: string; identity: IdentityCertificateTuple; state: VerifiedIdentityState; now?: number | Date }): Promise<Uint8Array<ArrayBufferLike>>

Verify another device's box key before sealing a grant to it (08 §10.1, 04 §9.8 item 4): devcert verifies under the identity key with the current igen; the device is listed active in a fresh own IdentityState with dkf = thumb(dsk); pub equals devcert's dbk; sig verifies under that DSK. Returns the 32-byte public key, or throws sdk.verification_failed (skip the device).

boxKey: Pick<BoxKey, "did" | "igen" | "pub" | "devcert" | "sig">
ctx: { addr: string; identity: IdentityCertificateTuple; state: VerifiedIdentityState; now?: number | Date }

Source: api/vault.ts:567

verifyDeviceProof function

function verifyDeviceProof(compact: string, opts: VerifyDeviceProofOptions): Promise<DeviceProofClaims>

Verify a DeviceProof: 06 §6.3.3 steps 2–5 (header and size, signature with the DSK, aud/ajti binding, times with a 60 s maximum lifetime). Step 1, the DeviceCertificate, is 07's and the caller's. Throws federation.device_proof_invalid with data.reason device_proof, device_proof_binding or device_proof_expired.

compact: string

Source: auth/remote.ts:624

verifyHomeAssertion function

function verifyHomeAssertion(compact: string, opts: VerifyHomeAssertionOptions): Promise<ParsedHomeAssertion>

Verify a HomeAssertion as a remote server: 06 §6.3 V1–V7 (local, before any network activity) and V10 (key and signature, through opts.key). V6 checks sub with 01 §7.5 checks 1 to 5. Steps V8 (DeviceProof present, see verifySessionRequest), V9 (issuer resolution), V11–V17 (policy, IdentityState, device, bans, revocation marks, replay cache) need the request or server state and remain the caller's, in that order.

Failures throw SloppyVoiceError with the codes of 06 §6.3: federation.assertion_invalid (data.reason), federation.wrong_audience (data.expected) or 400 address.non_canonical; resolver errors other than 02's key failures pass through.

compact: string

Source: auth/remote.ts:506

verifyIdentityEventState function

function verifyIdentityEventState(event: { sub: string; state: string }, opts: Omit<VerifyIdentityStateOptions, "expectedSub"> & { refetch?: (signal?: AbortSignal) => Promise<IdentityResponse>; signal?: AbortSignal }): Promise<VerifiedIdentityState>

Steps 1 and 2 of 07 §12.3 for a received identity.changed, device.revoked or identity.refresh_hint: verify state with 07 §7.4 and expectedSub = the event's sub. If it fails only because it has expired (an S2S retry can arrive up to 24 h late), call refetch (GET /v1/users/{local}/identity at the subject's home server, for example () => homeIdentityApi.get(local)) and continue with that verified result, which counts as validated. Any other failure is thrown: the caller doesn't use the state as evidence and records a diagnostic. Every other event member is a hint (07 §12.3 step 3).

event: { sub: string; state: string }
opts: Omit<VerifyIdentityStateOptions, "expectedSub"> & { refetch?: (signal?: AbortSignal) => Promise<IdentityResponse>; signal?: AbortSignal }

Source: api/identity.ts:92

verifyIdentityResponse function

function verifyIdentityResponse(res: IdentityResponse, opts: VerifyIdentityStateOptions & { expectedSub: string; purpose?: FreshnessPurpose }): Promise<VerifiedIdentityResponse>

Verify an IdentityResponse (07 §11.1): the state with 07 §7.4 for expectedSub, then each deviceCertificates[i] with 07 §9 against devices[i] (unexpired freshness, since the state was just verified). A certificate that doesn't back its entry is reported per device, not thrown. Throws sdk.protocol_violation if address isn't the expected address or the arrays differ in length, and an IdentityCheckError if the state fails.

opts: VerifyIdentityStateOptions & { expectedSub: string; purpose?: FreshnessPurpose }

Source: api/identity.ts:59

verifyPushToken function

function verifyPushToken(authorization: string | null | undefined, opts: VerifyPushTokenOptions): Promise<VerifiedPushToken>

Verify the Authorization header of POST {gatewayUrl}/v1/push at a push gateway: steps G1–G10 of 19 §11.5, in the spec's order. G11 (the (iss, jti) replay cache) needs gateway state and remains the caller's, after this returns.

authorization is the header value (Bearer <token>), or null when absent. Failures throw 401 push.unauthenticated with data.reason (06 §8.5 names), or 403 push.home_blocked (G4). Errors of opts.key other than 02's discovery.unknown_key / discovery.key_unusable (→ key_unknown / key_status) and address.non_canonical (→ issuer_not_canonical) pass through unchanged: the gateway answers them with 503 core.unavailable (G5).

authorization: string | null | undefined

Source: auth/remote.ts:978

verifyRecoveryWordList function

function verifyRecoveryWordList(): Promise<boolean>

Check the bundled word list against the SHA-256 that 08 §4.1 pins.

Source: api/backup.ts:202

verifyRelayTicket function

function verifyRelayTicket(ticket: string, opts: VerifyRelayTicketOptions): Promise<RelayTicketClaims>

Validate a RelayTicket as a relay must (15 §5.2 items 1 to 6), and return its verified claims. Failures throw SloppyVoiceError with the code the relay answers: relay.ticket_invalid (401) for format, issuer, key and signature failures; relay.wrong_relay (421) when aud isn't one of this relay's URLs; relay.ticket_expired (401) outside iat − 60 s ≤ now < exp + 60 s or when exp − iat > 60; relay.ticket_replayed (401) for a jti seen before. Item 7 (waiting up to 2,000 ms for a snapshot of cid, else 404 relay.call_unknown) is the relay's own, after this returns. The jti is recorded only when every other check has passed.

ticket: string

Source: calls/relay-ticket.ts:160

verifyS2SToken function

function verifyS2SToken(authorization: string | null | undefined, opts: VerifyS2STokenOptions): Promise<VerifiedS2SToken>

Verify the Authorization header of an S2S request: 06 §8.5 R1–R9 (local checks), R11 (key) and R12 (signature). R10 (resolving iss and checking it is canonical), R13 (policy) and R14 (replay cache) need server state and remain the caller's: R10 before calling, R13 and R14 after, in that order.

authorization is the header value (Bearer <token>), or null when absent. Failures throw federation.s2s_unauthenticated with data.reason.

authorization: string | null | undefined

Source: auth/remote.ts:841

verifyServerProposal function

function verifyServerProposal(parsed: ParsedProposalMessage, expected: { groupId: string | Uint8Array<ArrayBufferLike>; epoch: number | bigint; externalSenderKey: Uint8Array; currentExtensions?: readonly MlsExtension[]; externalSenderKeys?: readonly ExternalSenderKeyInfo[] }): Promise<string | null>

The client checks of a server proposal (13 §6.2 items 3–4, §6.3): the expected group_id and epoch, sender external index 0, empty authenticated_data, a Remove or GroupContextExtensions proposal, and a valid signature under the external sender's key from the client's own GroupContext (FramedContentTBS without GroupContext). Returns null when it passes, else a reason.

A GroupContextExtensions proposal must additionally (13 §6.3, §6.2 item 6) keep every extension of the current GroupContext byte-identical except external_senders, and its new external_senders entry must pass 13 §6.2 item 2's check against the hosting server's mls-external-sender keys with status next or active. Both checks are mandatory, so for a GroupContextExtensions proposal currentExtensions and externalSenderKeys are required (sdk.invalid_argument otherwise). Failures: extensions, external_sender.

expected: { groupId: string | Uint8Array<ArrayBufferLike>; epoch: number | bigint; externalSenderKey: Uint8Array; currentExtensions?: readonly MlsExtension[]; externalSenderKeys?: readonly ExternalSenderKeyInfo[] }

Source: mls/provider.ts:910

verifySessionRequest function

function verifySessionRequest(body: CreateSessionRequest, opts: VerifyHomeAssertionOptions): Promise<ParsedHomeAssertion>

The local checks of a session request at the remote server (06 §6.1, §6.3): the body's members have the right types (else 400 core.invalid_request), then V1–V8 on its assertion (V8: an assertion with enr: true needs deviceProof and deviceCertificate, else 401 federation.device_proof_required), then V10. Everything after V10 is the caller's: V11 policy, V12 IdentityState (§6.3.1, §6.3.2), V13 the DeviceCertificate (07) and verifyDeviceProof, V14–V17. The 64 KiB body limit (413 core.too_large) is the HTTP layer's.

Source: auth/remote.ts:520

verifyVaultGeneration function

function verifyVaultGeneration(gen: VaultGeneration, key: Uint8Array, linkedKey: Uint8Array<ArrayBufferLike> | null, ctx: VaultGenerationContext): Promise<void>

Verify a vault key generation before using a key received by grant or writing under it (08 §10.2.1): (1) sig under devcert's DSK and devcert under the identity key with the current igen and did = createdBy; (2) createdBy listed active with a matching dkf in a fresh own IdentityState with ver ≥ idStateVer, and never seen revoked; (3) the key gives kcv; (4) for vgen > 1, the link opens to the key this device holds for linkedVgen. Throws sdk.verification_failed with data.check: "generation"; ignore the generation and report it.

key: Uint8Array
linkedKey: Uint8Array<ArrayBufferLike> | null

Source: api/vault.ts:486

webClientOrigin function

function webClientOrigin(metadata: Pick<ServerMetadata, "links">): { present: boolean; origin: string | null }

The origin of the server's own web client from links.web (02 §7.3.4, 20 §16.11): present is false when the member is absent; origin is null when it is present but invalid, which matches no origin (it is never treated as absent).

metadata: Pick<ServerMetadata, "links">

Source: discovery/metadata.ts:387

webLocks function

function webLocks(name: string): (fn: () => Promise<T>) => Promise<T>

A lock for HomeSessionOptions.lock using the Web Locks API (navigator.locks), as 05 §7.7 asks web clients with several tabs to do. Throws sdk.not_implemented if the platform has no Web Locks.

name: string

Source: auth/session.ts:125

Interfaces

AbortBody interface

Body of abort (08 §6.6.2).

interface AbortBody

reason

reason: PairingAbortReason

Source: wire/device-setup.ts:243

AcceptPinRequest interface

POST /v1/resolve/pins/{domain}/accept body (02 §10.5): must equal the pin's observed values (compare-and-set).

interface AcceptPinRequest

baseUrl

baseUrl: string

canonicalDomain

canonicalDomain: string

keyThumbprints

keyThumbprints: string[]

Source: wire/discovery.ts:365

Account interface

The Account object (05 §11.1).

interface Account

address

address: string

Canonical address (01). Never changes.

name

name: string

Display name, never empty; receivers apply 01 §6.4.

kind

kind: AccountKind

user or bot; unknown treated as bot.

inc

inc: string

The account's incarnation (D-086): 22 base64url characters (05 §11.1).

state

state: AccountState

Account state (05 §11.2).

security

security: string & {} | AccountSecurity

insecure or secure.

igen

igen: number

Identity generation of the latest IdentityState (07); 0 if never secure.

about

about: string

Plain text, 0–190 code points, at most 4 line breaks; "" when unset.

avatar

avatar: Avatar | null

The avatar, or null.

profileVersion

profileVersion: number

Starts at 1; increases on every change of name, about or avatar.

createdAt

createdAt: string

Timestamp.

owner?

owner?: string

Bots only: canonical address of the owning local account (05 §15.1).

Source: wire/accounts.ts:155

AccountDeletedPayload interface

account.deleted payload, client and S2S form (05 §16.3).

interface AccountDeletedPayload

addr

addr: string

Canonical address.

kind

kind: AccountKind

user or bot.

inc

inc: string

The deleted account's incarnation.

deletedAt

deletedAt: string

Timestamp.

igen

igen: number

Last identity generation; 0 if never secure.

reason

reason: AccountDeletionReason

Unknown values are treated as admin.

Source: wire/accounts.ts:688

AccountEvents interface

The client events of document 05, all durable on the account's me stream (05 §18). device.revoked is sent by §13 step 5 but its payload is owned by 07, so it is in IdentityEvents (wire/identity.ts), not here.

interface AccountEvents

account.updated

account.updated: AccountUpdatedPayload

account.deleted

account.deleted: AccountDeletedPayload

auth.provider_linked

auth.provider_linked: ProviderLinkedPayload

auth.provider_unlinked

auth.provider_unlinked: ProviderUnlinkedPayload

device.added

device.added: DeviceAddedPayload

device.updated

device.updated: DeviceUpdatedPayload

bot.created

bot.created: BotPayload

bot.updated

bot.updated: BotPayload

bot.deleted

bot.deleted: BotDeletedPayload

Source: wire/accounts.ts:755

AccountProfileChangedPayload interface

S2S account.profile_changed payload (05 §17.4). Not delivered to clients.

interface AccountProfileChangedPayload

addr

addr: string

inc

inc: string

profileVersion

profileVersion: number

Source: wire/accounts.ts:744

AccountS2SEvents interface

The S2S events of document 05 (05 §11.8, §16.3, §17.4). Typed for server authors; they never arrive on a client's event WebSocket except account.deleted, which also has a client form (in AccountEvents).

interface AccountS2SEvents

account.deleted

account.deleted: AccountDeletedPayload

account.suspended

account.suspended: AccountSuspendedPayload

account.profile_changed

account.profile_changed: AccountProfileChangedPayload

Source: wire/accounts.ts:772

AccountSuspendedPayload interface

S2S account.suspended payload (05 §11.8). Not delivered to clients.

interface AccountSuspendedPayload

addr

addr: string

inc

inc: string

kind

kind: AccountKind

suspendedAt

suspendedAt: string

Source: wire/accounts.ts:736

AccountUpdatedPayload interface

account.updated payload (05 §18).

interface AccountUpdatedPayload

account

account: Account

Source: wire/accounts.ts:683

AckBody interface

Body of ack (08 §6.6.2, §6.7.3). The cleartext status is only for the server's state machine.

interface AckBody

status

status: "ok" | "failed"

reason?

reason?: "registration_failed" | "verification_failed"

Only with failed.

proof

proof: PairingPayloadBody

The encrypted ack proof (08 §6.7.3).

Source: wire/device-setup.ts:231

AckProofPlaintext interface

The decrypted ack proof (08 §6.7.3).

interface AckProofPlaintext

v

v: 1

status

status: "ok" | "failed"

did

did: string

dkf

dkf: string | null

Thumbprint of the new device's DSK, or null.

Source: wire/device-setup.ts:293

Actor interface

Who performed an action (10 §11.2). Never shown to a target.

interface Actor

kind

kind: ActorKind

address

address: string | null

Canonical address, or null for system and usually operator.

Source: wire/moderation.ts:209

AddDmParticipantsRequest interface

Body of POST /v1/dms/{ctx}/participants (12 §12.2).

interface AddDmParticipantsRequest

participants

participants: string[]

1 to 10 canonical addresses.

communityHints?

communityHints?: string[]

Optionally up to 10 community domains, copied into batch 1 of each new invitation (12 §12.2).

Source: wire/dms.ts:194

AddressAvailability interface

What an availability check found (01 §9.4).

interface AddressAvailability

available

available: boolean

Whether an ordinary person could register this local part as a user right now. Advisory.

reason?

reason?: "deleted" | NotFoundReason

Why not: the 404 data.reason (reserved, too_similar, not_allowed, taken; unknown values read as taken), taken when the lookup found an entry (200), or deleted for a quarantined local part (410).

minChars?

minChars?: number

The server's registration minimum, with not_allowed for length.

info?

info?: AddressInfo

The entry, when the lookup answered 200.

formerKind?

formerKind?: FormerKind

With deleted: what the address was (user or channel).

Source: api/addresses.ts:19

AddressDeletedData interface

data of address.deleted (01 §9.4) and address.quarantined (01 §5.7).

interface AddressDeletedData

formerKind

formerKind: FormerKind

Source: wire/addressing.ts:246

AddressInfo interface

The 200 response of GET {base}/v1/addresses/{local} (01 §9.3). It carries nothing else about the entry.

interface AddressInfo

kind

kind: AddressInfoKind

What the address names. Not the Channel object's kind, which is channelKind here.

address

address: string

The canonical address. Its domain is the server's canonicalDomain. For the old local part of a renamed channel during its rename reservation it is the channel's current address (01 §5.6).

name

name: string

The display name (01 §6.2). Receivers apply 01 §6.4.

bot?

bot?: boolean

When kind is user: whether the account is a bot.

ctx?

ctx?: string

When kind is channel: the channel's context reference, ch:<UUIDv7>.

channelKind?

channelKind?: AddressChannelKind

When kind is channel: text or voice.

security?

security?: AddressChannelSecurity

When kind is channel: insecure or secure.

Source: wire/addressing.ts:50

AddressNotFoundData interface

data of address.not_found (01 §9.4).

interface AddressNotFoundData

available

available: boolean

Whether an ordinary person could register this local part as a user right now. Advisory.

reason?

reason?: NotFoundReason

Why not, when available is false.

minChars?

minChars?: number

The server's registration minimum in code points, when reason is not_allowed because of length.

Source: wire/addressing.ts:231

AddressRef interface

An address carried with its display name (01 §6.7). addr is always a canonical address (01 §7). Receivers check name with checkDisplayName (01 §6.4) before showing it, and show the prepared local part when it is absent, null or fails (01 §6.5). Embedding documents MAY add members such as did.

interface AddressRef

addr

addr: string

The canonical address (01 §7).

name?

name?: string | null

The display name as the owning server last stated it (01 §6.2). Receivers apply 01 §6.4.

Source: wire/addressing.ts:22

AntiSpamPolicy interface

The community's anti-spam policy (10 §12.2).

interface AntiSpamPolicy

version

version: number

Read-only; increases on every change.

newMember

newMember: { enabled: boolean; durationMs: number; restricted: Permission[] }

newAccount

newAccount: { enabled: boolean; ageMs: number; maxNewDmsPerDay: number }

slowMode

slowMode: Record<string, number>

Channel ctx → interval in ms (1,000 to 21,600,000).

mentionLimit

mentionLimit: number

1 to 50.

floodTimeout

floodTimeout: { enabled: boolean; durationMs: number }

Source: wire/moderation.ts:776

AntiSpamPolicyPatch interface

Body of PATCH /v1/moderation/policy: a JSON Merge Patch (RFC 7396), where null deletes a member (a member with a default takes it again), plus an optional ifVersion (10 §12.2).

interface AntiSpamPolicyPatch

newMember?

newMember?: { enabled?: boolean | null; durationMs?: number | null; restricted?: Permission[] | null } | null

newAccount?

newAccount?: { enabled?: boolean | null; ageMs?: number | null; maxNewDmsPerDay?: number | null } | null

slowMode?

slowMode?: Record<string, number | null> | null

mentionLimit?

mentionLimit?: number | null

floodTimeout?

floodTimeout?: { enabled?: boolean | null; durationMs?: number | null } | null

ifVersion?

ifVersion?: number

409 moderation.version_conflict if it differs.

Source: wire/moderation.ts:808

ApnsPushHeadersInput interface

Input of apnsPushHeaders (19 §10.2).

interface ApnsPushHeadersInput

type

type: PushType

bundleId

bundleId: string

The app's bundle ID; call pushes go to the topic <bundle ID>.voip.

ttlMs

ttlMs: number

collapseKey?

collapseKey?: string

now

now: number

ms timestamp; apns-expiration = now + ttlMs rounded up to whole seconds, or 0 for ttlMs 0.

Source: api/push.ts:410

ArchiveKeyEntry interface

One key entry of an archive record (08 §9.1).

interface ArchiveKeyEntry

ekid

ekid: string

base64url of the 8-byte ekid.

key

key: string

base64url of K_hist (32 bytes).

source

source: ArchiveKeySource

confirmed

confirmed: boolean

learnedAt

learnedAt: string

RFC 3339.

Source: wire/device-setup.ts:424

ArchiveRecordPlaintext interface

Plaintext of an archive record (08 §9.1).

interface ArchiveRecordPlaintext

t

t: "archive"

host

host: string

ctx

ctx: string

groupId

groupId: string

gen

gen: number

epoch

epoch: number

keys

keys: ArchiveKeyEntry[]

1 to 4 entries with distinct ekids.

Source: wire/device-setup.ts:436

Argon2idParams interface

An Argon2idParams object (04 §12.2), the KeyBackup's kdf (08 §5.1). Unknown members are ignored.

interface Argon2idParams

alg

alg: string & {} | "argon2id"

"argon2id"; anything else is crypto.unsupported_algorithm.

v

v: number

Argon2 version, 19.

m

m: number

Memory in KiB, 65,536 to 262,144.

t

t: number

Passes, 3 to 10.

p

p: number

Lanes, 1.

salt

salt: string

base64url of the 16-byte salt.

Source: wire/device-setup.ts:19

Argon2idProvider interface

A pluggable Argon2id (RFC 9106) implementation: WebCrypto has none, and the SDK has no dependencies. It MUST compute Argon2id (y = 2) with version 0x13, empty secret and associated data, and a 32-byte tag, off the user-interface thread (04 §12.3).

interface Argon2idProvider

argon2id

argon2id(input: { password: Uint8Array; salt: Uint8Array; memoryKiB: number; passes: number; parallelism: number; tagLength: 32; version: 19 }): Promise<Uint8Array<ArrayBufferLike>>
input: { password: Uint8Array; salt: Uint8Array; memoryKiB: number; passes: number; parallelism: number; tagLength: 32; version: 19 }

Source: api/backup.ts:326

AssertionInvalidData interface

data of federation.assertion_invalid (06 §16).

interface AssertionInvalidData

reason

reason: AssertionInvalidReason

serverTime?

serverTime?: string

RFC 3339; when reason is expired, not_yet_valid or lifetime.

Source: wire/federation.ts:661

AssertionRequest interface

POST /v1/federation/assertions request body (06 §4.1).

interface AssertionRequest

aud

aud: string

The remote server's domain, 1–253 octets; send the canonical domain learned by resolution (06 §4.1, §6.10 rule 2).

Source: wire/federation.ts:97

AssertionResponse interface

POST /v1/federation/assertions 200 response body (06 §4.1).

interface AssertionResponse

assertion

assertion: string

The HomeAssertion, a JWS compact serialization (06 §4.3).

aud

aud: string

The canonical domain placed in the assertion's aud claim.

expiresAt

expiresAt: string

The assertion's exp as an RFC 3339 timestamp.

identityState?

identityState?: string

The account's current IdentityState JWS (07). Present when sec is secure; SHOULD be present otherwise.

Source: wire/federation.ts:103

Attachment interface

The server's record of an uploaded blob (11 §14.1).

interface Attachment

id

id: string

UUIDv7, generated by the server.

ctx

ctx: CtxRef

purpose

purpose: AttachmentPurpose

state

state: AttachmentState

blobBytes

blobBytes: number

Exact size of the blob in bytes.

mime

mime: string

Insecure: the declared type. Secure: application/octet-stream.

sha256

sha256: string

base64url SHA-256 of the blob bytes.

uploader

uploader: string

Canonical address of the uploading account.

createdAt

createdAt: string

expiresAt

expiresAt: string | null

While pending or uploaded: createdAt + 24 h; otherwise null.

mid

mid: string | null

The root message it is bound to, when bound.

Source: wire/messaging.ts:725

AttachmentRef interface

One uploaded file inside a content object (11 §3.6).

interface AttachmentRef

id

id: string

The Attachment ID returned by the upload (11 §14.2).

name

name: string

File name: 1 to 255 bytes of UTF-8, no /, ``, U+0000–U+001F or U+007F.

mime

mime: string

Lowercase type/subtype without parameters; application/octet-stream if unknown.

size

size: number

Size of the file before encryption, 1 to maxAttachmentBytes.

sha256?

sha256?: string

base64url SHA-256 of the file before encryption. Secure: required.

key?

key?: string

The 32-byte file key K_file (04 §10.2), base64url. Secure: required; insecure: MUST be absent.

width?

width?: number

Pixel width, 1–65,535.

height?

height?: number

Pixel height, 1–65,535.

durationMs?

durationMs?: number

Duration for audio and video.

thumb?

thumb?: ThumbnailRef

A preview image (11 §14.3).

spoiler?

spoiler?: boolean

Show the preview blurred until tapped. Default false.

voice?

voice?: boolean

A recorded voice message. Default false.

Source: wire/messaging.ts:218

AttachmentsApiOptions interface

Options of AttachmentsApi.

interface AttachmentsApiOptions

limits?

limits?: LimitsSource

The hosting server's ServerMetadata limits (or a getter) for maxAttachmentBytes (11 §2.3).

clock?

clock?: Clock

Clock for upload.expiresAt. Default: the device clock.

Source: api/attachments.ts:68

AttachmentSizeMismatchData interface

data of attachment.size_mismatch (11 §17.1).

interface AttachmentSizeMismatchData

expected

expected: number

actual

actual: number

Source: wire/messaging.ts:530

AudioLossFeedback interface

audio_loss: a listener's report on one audio stream of the sender to, used only to tune the sender's Opus in-band FEC (16 §4.7). Receivers ignore unknown members.

interface AudioLossFeedback

kind

kind: "audio_loss"

sourceId

sourceId: AudioSourceId

0 or 2: the reported stream of the sender to.

lossPermille

lossPermille: number

0–1,000: floor(1,000 × lost / expected) over the report interval, before FEC.

latePermille

latePermille: number

0–1,000: floor(1,000 × late / expected).

bufferTargetMs

bufferTargetMs: number

0–1,000: the listener's current jitter-buffer target T for this stream (16 §9.3).

received

received: number

0–65,535: distinct sequence numbers received in the interval, capped.

Source: wire/media.ts:148

AudioRecvCounters interface

Receive counters of AudioStats without the stream key, as used in recvOverflow (16 §13).

interface AudioRecvCounters

framesReceived

framesReceived: number

framesLost

framesLost: number

framesLate

framesLate: number

framesDuplicate

framesDuplicate: number

framesFecRecovered

framesFecRecovered: number

framesConcealed

framesConcealed: number

fadeOuts

fadeOuts: number

decryptFailures

decryptFailures: number

leaseDrops

leaseDrops: number

attestationStops

attestationStops: number

reanchors

reanchors: number

targetMs

targetMs: number

targetMaxMs

targetMaxMs: number

holdP95Ms

holdP95Ms: number

Source: wire/media.ts:422

AudioRecvStats interface

Per-(pid, sourceId) receive counters of AudioStats (16 §13).

interface AudioRecvStats extends AudioRecvCounters

framesReceived

framesReceived: number

framesLost

framesLost: number

framesLate

framesLate: number

framesDuplicate

framesDuplicate: number

framesFecRecovered

framesFecRecovered: number

framesConcealed

framesConcealed: number

fadeOuts

fadeOuts: number

decryptFailures

decryptFailures: number

leaseDrops

leaseDrops: number

attestationStops

attestationStops: number

reanchors

reanchors: number

targetMs

targetMs: number

targetMaxMs

targetMaxMs: number

holdP95Ms

holdP95Ms: number

pid

pid: number

The sender (0–65535).

sourceId

sourceId: AudioSourceId

0 or 2.

Source: wire/media.ts:440

AudioSendStats interface

Per-source sending counters of AudioStats (16 §13).

interface AudioSendStats

sourceId

sourceId: AudioSourceId

0 or 2.

framesSent

framesSent: number

Frames created and handed to at least one transport.

framesDroppedSend

framesDroppedSend: number

Frames discarded by L2 or L3 (16 §7.5).

talkspurts

talkspurts: number

bitrateKbps

bitrateKbps: number

Current target bitrate.

fecLossPerc

fecLossPerc: number

Current OPUS_SET_PACKET_LOSS_PERC.

cbr

cbr: boolean

Whether the encoder is in constant-bitrate mode.

Source: wire/media.ts:405

AudioStats interface

The audio member of 15's diagnostics Sample (16 §13). Counters count since the previous Sample.

interface AudioStats

mode

mode: string & {} | TransmitMode

ptt, vad or open_mic; unknown values are kept as text by collectors.

send

send: AudioSendStats[]

recv

recv: AudioRecvStats[]

At most 64 entries (4 when uploaded); the rest are summed into recvOverflow.

recvOverflow?

recvOverflow?: AudioRecvCounters

invalidDrops

invalidDrops: number

captureGlitches

captureGlitches: number

renderUnderruns

renderUnderruns: number

stalls

stalls: number

transmittingMs

transmittingMs: number

notHeardMs

notHeardMs: number

interruptions

interruptions: number

Source: wire/media.ts:448

AuditChange interface

One field change of an audit entry (10 §11.2).

interface AuditChange

field

field: string

before

before: unknown

after

after: unknown

Source: wire/moderation.ts:721

AuditLogEntry interface

An audit log entry (10 §11.2). Immutable.

interface AuditLogEntry

id

id: string

seq

seq: number

Strictly increasing per server; entries are ordered by seq, never by id.

at

at: string

actor

actor: Actor

action

action: AuditAction

targetType

targetType: AuditTargetType

targetId?

targetId?: string | null

targetAddress?

targetAddress?: string | null

ctx?

ctx?: string | null

reason?

reason?: string | null

changes?

changes?: AuditChange[]

count?

count?: number

reportId?

reportId?: string | null

relatedId?

relatedId?: string | null

restricted

restricted: boolean

Only admins may read entries with restricted: true.

Source: wire/moderation.ts:728

AuditLogPage interface

Response of GET /v1/audit-log (10 §11.4): a collection page plus the server's retention.

interface AuditLogPage extends CollectionPage<AuditLogEntry>

retentionDays

retentionDays: number

items

items: AuditLogEntry[]

The page, in the stable order the owner defines.

nextCursor

nextCursor: string | null

The cursor for the next page, or null at the end. Opaque: never build, change or parse it.

total?

total?: number

Exact or estimated total, where the owner defines one.

Source: wire/moderation.ts:767

AuditLogParams interface

Query of GET /v1/audit-log (10 §11.4).

interface AuditLogParams

action?

action?: string

actor?

actor?: string

Actor's address.

targetAddress?

targetAddress?: string

targetType?

targetType?: string

ctx?

ctx?: string

reportId?

reportId?: string

since?

since?: string

Timestamp.

until?

until?: string

Timestamp.

cursor?

cursor?: string

limit?

limit?: number

1–100, default 50.

Source: wire/moderation.ts:749

AuthApiOptions interface

Options of AuthApi (05 §7.1).

interface AuthApiOptions

encoding?

encoding?: "json" | "form"

Body encoding at /v1/auth/par and /v1/auth/token: form (RFC 6749, default) or JSON (05 §7.1).

random?

random?: RandomSource

Random source for PKCE and state. Default: CSPRNG.

clock?

clock?: Clock

Clock for request_uri expiry. Default: the device clock.

Source: auth/oauth.ts:551

AuthEndpoints interface

The /v1/auth/* URLs of a home server (05 §3.2).

interface AuthEndpoints

par

par: string

authorize

authorize: string

Browser navigation (03 §2.9).

callback

callback: string

Browser navigation: the provider's redirect target, registered at each provider (05 §4.1).

consent

consent: string

Browser navigation: the server's own "Continue to …" form (05 §5.4).

token

token: string

signup

signup: string

logout

logout: string

Source: auth/oauth.ts:270

AuthorizationCodeGrantRequest interface

POST /v1/auth/token with grant_type=authorization_code (05 §7.3).

interface AuthorizationCodeGrantRequest

grant_type

grant_type: "authorization_code"

code

code: string

From 05 §6.6.

redirect_uri

redirect_uri: string

Exactly the value used at /authorize.

client_id

client_id: string

Exactly the value used at /authorize.

code_verifier

code_verifier: string

PKCE verifier (RFC 7636 §4.5).

platform?

platform?: ClientPlatform

For a login that creates a device: desktop, web, ios or android.

client_software?

client_software?: string

For a login that creates a device (05 §5.3).

device_name?

device_name?: string

Suggested device name, 1–64 characters.

shared_computer?

shared_computer?: boolean

Default false; only with platform web or desktop (05 §12.6). A boolean in JSON, true/false in a form.

Source: wire/accounts.ts:373

AuthorizationErrorParams interface

Query parameters of a failed redirect back to the client (05 §6.6).

interface AuthorizationErrorParams

error

error: AuthorizationRedirectError

RFC 6749 §4.1.2.1 code (05 §7.8, right column).

error_description?

error_description?: string

state

state: string

iss

iss: string

sv_code?

sv_code?: string

This document's error code, for example auth.access_denied.

Source: wire/accounts.ts:338

AuthorizationParams interface

The authorization parameters of GET /v1/auth/authorize (05 §6.2), also the body of POST /v1/auth/par (minus request_uri, plus intent, 05 §6.1).

interface AuthorizationParams

client_id

client_id: string

05 §5.1.

response_type

response_type: "code"

code.

redirect_uri

redirect_uri: string

05 §5.2.

code_challenge

code_challenge: string

BASE64URL(SHA-256(code_verifier)), 43 characters.

code_challenge_method

code_challenge_method: "S256"

S256; plain is refused.

state

state: string

Opaque, 1–512 characters, at least 128 random bits.

provider?

provider?: string

A provider ID from auth.providers; absent shows the server's chooser.

prompt?

prompt?: "select_account"

select_account only.

ui_locales?

ui_locales?: string

BCP 47 language tags for the server's pages.

Source: wire/accounts.ts:286

AuthorizationSuccessParams interface

Query parameters of a successful redirect back to the client (05 §6.6).

interface AuthorizationSuccessParams

code

code: string

svc_ + 43 characters; single use, valid 60 s.

state

state: string

The client's state.

iss

iss: string

The home server's base URL (RFC 9207).

Source: wire/accounts.ts:328

AuthProvider interface

One login provider in ServerMetadata auth.providers (02 §7.3.2).

interface AuthProvider

id

id: string

Used in /v1/auth/authorize?provider=<id> (05). 1–32 octets of [a-z0-9_-].

name

name: string

Button label, 1–64 code points.

type

type: string & {} | AuthProviderType

Button styling hint; unknown values: treat as oidc.

icon?

icon?: string

Button icon for oidc providers: https URL ≤ 512 octets. Cosmetic.

signup?

signup?: boolean

Whether this provider may create new accounts (05 §8.3). Absent means true.

Source: wire/discovery.ts:146

Avatar interface

The Avatar object (05 §11.1).

interface Avatar

url

url: string

{base}/v1/users/{local}/profile/avatar?v={profileVersion}.

sha256

sha256: string

base64url SHA-256 of the served image bytes.

contentType

contentType: string & {} | AvatarContentType

image/png, image/jpeg or image/webp.

width

width: number

Pixels, 1–1024.

height

height: number

Pixels, 1–1024.

Source: wire/accounts.ts:141

AvatarImage interface

An avatar image as served (05 §17.2).

interface AvatarImage

bytes

bytes: Uint8Array

contentType

contentType: string | null

Source: api/profiles.ts:19

BackupUpdatedEvent interface

d of backup.updated (08 §14.2).

interface BackupUpdatedEvent

igen

igen: number

ver

ver: number

vgen

vgen: number

phraseId

phraseId: string

updatedAt

updatedAt: string

updatedBy

updatedBy: string

Source: wire/device-setup.ts:655

BackupVersionConflictData interface

data of backup.version_conflict (08 §5.6.2).

interface BackupVersionConflictData

currentVer

currentVer: number

phraseId

phraseId: string

vgen

vgen: number

Source: wire/device-setup.ts:766

Ban interface

A ban (10 §9.1).

interface Ban

id

id: string

UUIDv7.

targetType

targetType: BanTargetType

address?

address?: string

When targetType is address.

domain?

domain?: string

When targetType is domain: lowercase A-label.

canonical

canonical: boolean

false if the target's server couldn't be resolved when the ban was made (10 §9.2).

scope

scope: BanScope

reason?

reason?: string

0–512 characters.

showReason

showReason: boolean

createdBy

createdBy: Actor

createdAt

createdAt: string

expiresAt

expiresAt: string | null

End of a temporary ban (at least 1 h after createdAt), or null for permanent.

reportId?

reportId?: string | null

Source: wire/moderation.ts:334

BanListParams interface

Query of GET /v1/bans (10 §9.6).

interface BanListParams

targetType?

targetType?: "address" | "domain"

scope?

scope?: "community" | "server"

address?

address?: string

domain?

domain?: string

cursor?

cursor?: string

limit?

limit?: number

Source: wire/moderation.ts:379

BannedData interface

data of moderation.banned (10 §9.6). reason only if shown.

interface BannedData

scope

scope: BanScope

expiresAt

expiresAt: string | null

reason?

reason?: string

Source: wire/moderation.ts:1012

BeginLinkOptions interface

Options of beginLink (05 §10.3).

interface BeginLinkOptions

clientId

clientId: string

redirectUri

redirectUri: string

provider

provider: string

The enabled provider ID to link.

uiLocales?

uiLocales?: string

Source: auth/oauth.ts:535

BeginSignInOptions interface

Options of AuthApi.beginSignIn (05 §6.1, §6.2).

interface BeginSignInOptions

clientId

clientId: string

05 §5.1; LOOPBACK_CLIENT_ID for desktop apps.

redirectUri

redirectUri: string

05 §5.2.

provider?

provider?: string

A provider ID from ServerMetadata auth.providers; absent shows the server's chooser.

prompt?

prompt?: "select_account"

select_account for "Use a different account".

uiLocales?

uiLocales?: string

BCP 47 tags for the server's pages.

pushed?

pushed?: boolean

Push the parameters first with POST /v1/auth/par (05 §6.1). Default true.

Source: auth/oauth.ts:516

BootstrapRequest interface

Body of POST /v1/contexts/{ctx}/mls/bootstrap: a GroupBootstrap plus, for DMs, the first commit (13 §7.4).

interface BootstrapRequest extends GroupBootstrap

generation

generation: number

MUST equal the context's current generation, in state none.

groupInfo

groupInfo: string

Epoch-0 GroupInfo with ratchet_tree (one leaf, index 0) and external_pub (base64url).

ekid

ekid: string

ekid(0) computed by the creator (14 §3.2).

commit?

commit?: CommitSubmission

DMs: the first CommitSubmission (epoch 0 → 1) adding the claimed devices, with its Welcome.

Source: wire/mls.ts:403

BootstrapResult interface

201 response of POST …/mls/bootstrap (13 §7.4; unnamed in the spec).

interface BootstrapResult

groupId

groupId: string

generation

generation: number

epoch

epoch: number

Always 0.

ekid

ekid: string

seq

seq: number

commit?

commit?: CommitResult

The first commit's CommitResult, only when a commit was sent.

Source: wire/mls.ts:409

Bot interface

The Bot object: {"account": Account, "devices": [DeviceRecord…]}; devices lists active devices (05 §15.3).

interface Bot

account

account: Account

devices

devices: DeviceRecord[]

Source: wire/accounts.ts:241

BotDeletedPayload interface

bot.deleted payload (05 §18).

interface BotDeletedPayload

addr

addr: string

The bot's canonical address.

Source: wire/accounts.ts:730

BotPayload interface

bot.created and bot.updated payload (05 §18).

interface BotPayload

bot

bot: Bot

Source: wire/accounts.ts:725

BotTokenResponse interface

Response 201 of POST /v1/bots/{local}/tokens (05 §15.4).

interface BotTokenResponse

token

token: string

svb_….

device

device: DeviceRecord

Source: wire/accounts.ts:655

BoxKey interface

A device's box key binding (08 §10.1).

interface BoxKey

did

did: string

igen

igen: number

pub

pub: string

base64url of the 32-byte X25519 public key.

devcert

devcert: string

The device's DeviceCertificate JWS.

sig

sig: string

base64url of the vault-box-key labelled signature over BoxKeyTBS.

createdAt

createdAt: string

Set by the server.

Source: wire/device-setup.ts:510

BoxKeyList interface

Response of GET /v1/me/vault/box-keys (08 §10.1).

interface BoxKeyList

items

items: BoxKey[]

Source: wire/device-setup.ts:527

BuildKeyPackageParams interface

Inputs of buildKeyPackage (13 §9.1).

interface BuildKeyPackageParams

initKey

initKey: Uint8Array

Fresh X25519 public key used in no other KeyPackage (the last-resort KeyPackage excepted).

encryptionKey

encryptionKey: Uint8Array

Fresh X25519 public key, different from initKey. Never the device's box key (13 §3.3 item 5).

signer

signer: Ed25519Signer

The DSK; its public key is the leaf signature_key (13 §3.3 item 2).

credential

credential: Uint8Array<ArrayBufferLike> | SvDeviceCredential

The device's sv_device credential.

lifetime

lifetime: { notBefore: number | bigint; notAfter: number | bigint }

Seconds since the epoch; span at most 90 days (13 §9.1).

capabilities?

capabilities?: MlsCapabilities

Defaults to the sv1 set (13 §3.4).

Source: mls/provider.ts:1001

BuildMessageOptions interface

Options of buildMessageContent.

interface BuildMessageOptions

replyTo?

replyTo?: ReplyRef | null

attachments?

attachments?: AttachmentRef[]

trim?

trim?: boolean

Trim leading and trailing white space (11 §3.2 rule 3, SHOULD). Default true.

isCanonicalAddress?

isCanonicalAddress?: MentionAddressCheck

Source: content.ts:808

Call interface

A call (15 §2.5.1).

interface Call

callId

callId: string

UUIDv7, never reused.

ctx

ctx: CtxRef

The context: ch:…, dm:… or gdm:….

security

security: CallSecurity

insecure or secure; fixed for the call. Clients check the mode themselves (15 §2.1 item 4).

startedAt

startedAt: string

participants

participants: Participant[]

Every seat, in ascending pid order.

videoRoute

videoRoute: VideoRoute

dc (video over the relay) or sfu (video through the SFU) (15 §7.2). Unknown values: treat as dc.

mediaEpoch

mediaEpoch: number | null

Secure calls: the MLS epoch the call most recently switched to (15 §9). Null in insecure calls.

profiles

profiles: MediaProfile[]

Always voice-dc/1 and video-dc/1; also sfu-rtp/1 when the server is SFU-capable.

maxParticipants

maxParticipants: number

The effective maxCallParticipants for this call.

ringing

ringing: Ring | null

The pending ring in a DM call, or null. Always null in channels.

Source: wire/calls.ts:392

CallAlreadyInCallData interface

call.already_in_call error data (15 §2.3, §16.1).

interface CallAlreadyInCallData

ctx

ctx: CtxRef

callId

callId: string

sameDevice

sameDevice: boolean

The existing participation is on this same device.

sameCall

sameCall: boolean

The existing participation is in this same call.

Source: wire/calls.ts:1088

CallContinuityOptions interface

Options of CallContinuity.

interface CallContinuityOptions

ctx

ctx: string

The call's context (ch:…, dm:…, gdm:…).

features?

features?: MediaProfile[]

Media profiles of this device; voice-dc/1 is added if missing. Default all three.

mode?

mode?: TransmitMode

Transmit mode (16 §7.1). Default vad.

selfMuted?

selfMuted?: boolean

Starting self-mute. Default false.

selfDeafened?

selfDeafened?: boolean

Starting self-deafen. Default false.

secure?

secure?: boolean

Whether the call is secure as the client established it (send keys gate restoring → in_call). Default false. A security_upgraded/group_restarted migration always lands in a secure call.

now?

now?: () => number

Monotonic clock in ms. Default performance.now().

newKey?

newKey?: () => string

Idempotency-Key generator. Default UUIDv7.

awaitingReadd?

awaitingReadd?: () => boolean

The device is waiting to be re-added after its user's reset (13 §16 awaiting_readd).

restoreAfterProcessRestart?

restoreAfterProcessRestart?: { callId: string; pid: number; rejoinToken: string; droppedAt: number }

Start in rejoining after the client's own process restarted (15 §10.9): the rejoin token, call ID and pid of the previous process, and when the drop happened (droppedAt) expressed on this instance's clock. Only within 60 s of the restart, if the user hadn't pressed Leave and the call screen is still present. Voice activation and open mic start muted; no video resumes.

Source: calls/continuity.ts:257

CallEndedErrorData interface

call.ended error data (15 §16.1).

interface CallEndedErrorData

reason

reason: CallEndReason

Source: wire/calls.ts:1083

CallEndedEvent interface

call.ended (15 §15).

interface CallEndedEvent

callId

callId: string

reason

reason: CallEndReason

Per 15 §2.4; unknown values are treated like context_closed.

endedAt

endedAt: string

next?

next?: { security: CallSecurity }

{security} for security_upgraded only; a hint, never trusted (15 §2.1 item 4).

Source: wire/calls.ts:961

CallEpochSwitchEvent interface

call.epoch_switch (15 §9.4).

interface CallEpochSwitchEvent

callId

callId: string

epoch

epoch: number

Source: wire/calls.ts:979

CallEvents interface

The event WebSocket events of 15 §15, by type. All are ephemeral client events from the call's hosting server (no seq, never replayed).

interface CallEvents

call.state

call.state: CallStateEvent

call.started

call.started: CallStartedEvent

call.participant_joined

call.participant_joined: CallParticipantJoinedEvent

call.participant_updated

call.participant_updated: CallParticipantUpdatedEvent

call.participant_left

call.participant_left: CallParticipantLeftEvent

call.ended

call.ended: CallEndedEvent

call.ring_updated

call.ring_updated: CallRingUpdatedEvent

call.tick

call.tick: LeaseSnapshot

call.lease_changed

call.lease_changed: VoiceLease

call.epoch_switch

call.epoch_switch: CallEpochSwitchEvent

call.route_changed

call.route_changed: CallRouteChangedEvent

call.moved

call.moved: CallMovedEvent

call.migrate

call.migrate: CallMigrateEvent

call.ringing

call.ringing: CallRingingEvent

call.ring_ended

call.ring_ended: CallRingEndedEvent

sfu.offer

sfu.offer: SfuOfferEvent

sfu.tracks_changed

sfu.tracks_changed: SfuTracksChangedEvent

sfu.closed

sfu.closed: SfuClosedEvent

Source: wire/calls.ts:1057

CallFailureData interface

call_failure data (15 §14.3).

interface CallFailureData

phase

phase: CallFailurePhase

code

code: string | null

The last error code seen, or null.

security

security: CallSecurity

outageMs

outageMs: number

rejoinAttempts

rejoinAttempts: number

iceState

iceState: string

dtlsState

dtlsState: string

samples

samples: CallSample[]

Up to 30 Samples.

Source: wire/calls.ts:876

CallFullData interface

call.full error data (15 §16.1).

interface CallFullData

maxParticipants

maxParticipants: number

Source: wire/calls.ts:1098

CallGroupEpochData interface

call.mls_join_required and call.epoch_unknown error data (15 §16.1).

interface CallGroupEpochData

groupEpoch

groupEpoch: number

Source: wire/calls.ts:1113

CallMigrateEvent interface

call.migrate: planned relay migration (15 §6.9).

interface CallMigrateEvent

callId

callId: string

reason

reason: MigrateReason

drain or rebalance; unknown: treat as drain.

deadlineMs

deadlineMs: number

Source: wire/calls.ts:999

CallMovedData interface

call.moved error data (15 §16.1).

interface CallMovedData

sameCall

sameCall: boolean

Source: wire/calls.ts:1103

CallMovedEvent interface

call.moved: this device's participation was moved (15 §11).

interface CallMovedEvent

callId

callId: string

pid

pid: number

sameCall

sameCall: boolean

true when the user's other device joined this same call.

Source: wire/calls.ts:991

CallNotPermittedData interface

call.not_permitted error data, when a lease blocks it (15 §3.5, §16.1).

interface CallNotPermittedData

blockedBy?

blockedBy?: string & {} | "other" | "no_permission" | "muted_for_everyone" | "server_muted" | "timed_out"

Source: wire/calls.ts:1108

CallParticipantJoinedEvent interface

call.participant_joined (15 §15).

interface CallParticipantJoinedEvent

callId

callId: string

participant

participant: Participant

rejoined?

rejoined?: boolean

A device came back after its seat timed out; play no join sound. Default false.

movedFrom?

movedFrom?: number

Move voice here within the same call: the old pid; play no join or leave sound (15 §11).

Source: wire/calls.ts:936

CallParticipantLeftEvent interface

call.participant_left (15 §15).

interface CallParticipantLeftEvent

callId

callId: string

pid

pid: number

addr

addr: string

reason

reason: SeatRemovalReason

Unknown values: treat as left.

Source: wire/calls.ts:952

CallParticipantUpdatedEvent interface

call.participant_updated (15 §15).

interface CallParticipantUpdatedEvent

callId

callId: string

participant

participant: Participant

Source: wire/calls.ts:946

CallReportBase interface

Common members of a call report (15 §14.3).

interface CallReportBase

client

client: string

Product and version, as in session.hello.

platform

platform: DiagnosticPlatform

ctx

ctx: string

callId?

callId?: string

createdAt?

createdAt?: number | Date

Default: now.

reportId?

reportId?: string

Default: a fresh UUIDv7.

Source: calls/diagnostics.ts:63

CallRingEndedEvent interface

call.ring_ended on the target's me stream (15 §13.1).

interface CallRingEndedEvent

ctx

ctx: CtxRef

callId

callId: string

addr

addr: string

reason

reason: RingEndReason

Unknown values: treat as cancelled.

Source: wire/calls.ts:1021

CallRingingEvent interface

call.ringing on the target's me stream (15 §13.1). by is an object here, unlike Ring's.

interface CallRingingEvent

ctx

ctx: CtxRef

callId

callId: string

by

by: { addr: string; name: string }

The caller. Check name against addr (01) before showing it (15 §2.5.2).

security

security: CallSecurity

video

video: boolean

expiresAt

expiresAt: string

This target's expiry.

Source: wire/calls.ts:1009

CallRingUpdatedEvent interface

call.ring_updated (15 §15).

interface CallRingUpdatedEvent

callId

callId: string

ringing

ringing: Ring | null

ended?

ended?: { addr: string; reason: RingEndReason }

When a target's ring just ended.

Source: wire/calls.ts:971

CallRouteChangedEvent interface

call.route_changed: call control switched the call's videoRoute (15 §7.2, §15).

interface CallRouteChangedEvent

callId

callId: string

videoRoute

videoRoute: VideoRoute

Source: wire/calls.ts:985

CallSample interface

One diagnostics Sample, recorded every 10 s and at call close (15 §14.1). Never addresses, SDP or keys.

interface CallSample

at

at: string

rttMs

rttMs: number

Round-trip time on the relay connection.

jitterMs

jitterMs: number

lossPermille

lossPermille: number

audioFramesSent

audioFramesSent: number

audioFramesReceived

audioFramesReceived: number

concealedMs

concealedMs: number

jitterBufferMs

jitterBufferMs: number

maxTickAgeMs

maxTickAgeMs: number

videoKbpsSent

videoKbpsSent: number

videoKbpsReceived

videoKbpsReceived: number

framesHeld

framesHeld: number

keyframeRequests

keyframeRequests: number

undecryptableFrames

undecryptableFrames: number

Secure calls (18).

attestationFailures

attestationFailures: number

Secure calls (18).

candidateTypes

candidateTypes: string[]

ICE candidate types of the relay connection's selected candidate pair (host or prflx); never addresses.

audio?

audio?: Record<string, unknown>

Optional AudioStats (16 §13).

video?

video?: Record<string, unknown>

Optional VideoStats (17 §14).

Source: wire/calls.ts:848

CallStartedEvent interface

call.started (15 §15).

interface CallStartedEvent

call

call: Call

Source: wire/calls.ts:931

CallStateEvent interface

call.state: the current call or null, sent when a socket gains a full subscription (15 §3.1).

interface CallStateEvent

call

call: Call | null

Source: wire/calls.ts:926

CallSummaryData interface

call_summary data (15 §14.3).

interface CallSummaryData

durationMs

durationMs: number

security

security: CallSecurity

routesUsed

routesUsed: (string & {} | "sfu" | "relay")[]

The routes the device's media used: relay, and sfu when its video went through the SFU.

unexpectedDrops

unexpectedDrops: number

samples

samples: CallSample[]

Source: wire/calls.ts:891

CancelPairingRequest interface

Body of POST /v1/me/pairing/{id}/cancel (08 §6.4.5).

interface CancelPairingRequest

reason

reason: "denied" | "cancelled"

Source: wire/device-setup.ts:190

CannotFollowEntry interface

One account in a plan's cannotFollow list (09 §10.2, §11.2). Unknown reason is read as insecure_account.

interface CannotFollowEntry

addr

addr: string

name

name: string

kind

kind: AccountKind

local?

local?: boolean

Present in a ServerUpgradePlan only.

reason

reason: string & {} | "insecure_account"

Source: wire/communities.ts:210

Category interface

The Category object (09 §6.5).

interface Category

id

id: string

UUIDv7.

name

name: string

1 to 100 scalar values, single line.

position

position: number

Order among categories, from 0.

version

version: number

createdAt

createdAt: string

updatedAt

updatedAt: string

Source: wire/communities.ts:535

CategoryGroup interface

One category with its channels in display order (09 §6.5).

interface CategoryGroup

category

category: Category

channels

channels: Channel[]

Source: api/channels.ts:98

CategoryPatch interface

PATCH /v1/community/categories/{id} body (09 §6.5).

interface CategoryPatch

name?

name?: string

position?

position?: number

ifVersion?

ifVersion?: number

Source: wire/communities.ts:555

ChainAcceptance interface

The result of chainAccepts (02 §12.3).

interface ChainAcceptance

trusted

trusted: TrustedKey[]

T: the key-holder-vouched keys (pinned keys not revoked, plus accepted rotations).

urlBound

urlBound: boolean

The highest element's url equals B, and that element was accepted or is the pinned head.

highestAccepted

highestAccepted: ChainHead | null

The accepted element with the highest n, if any.

status

status: ChainStatus

note?

note?: string

A human-readable note for diagnostics when the status isn't ok or elements were skipped.

Source: discovery/keychain.ts:126

ChainHead interface

A pin's chainHead: n and the SHA-256 (base64url) of one compact KeyRotation (02 §10.1, §12.2).

interface ChainHead

n

n: number

hash

hash: string

Source: discovery/keychain.ts:26

ChainMetadataView interface

The metadata fields chainAccepts reads.

interface ChainMetadataView

canonicalDomain

canonicalDomain: string

keys

keys: readonly ServerKey[]

keyChain

keyChain: readonly string[]

Source: discovery/keychain.ts:147

ChainPinView interface

The pin fields chainAccepts reads (02 §10.1).

interface ChainPinView

canonicalDomain

canonicalDomain: string

keys

keys: readonly PinnedKey[]

revoked

revoked: readonly string[]

chainHead

chainHead: ChainHead | null

Source: discovery/keychain.ts:139

ChangesExpiredData interface

data of message.changes_expired (11 §17.1).

interface ChangesExpiredData

changesFloorSeq

changesFloorSeq: number

Source: wire/messaging.ts:515

Channel interface

The Channel object (09 §6.1).

interface Channel

ctx

ctx: `ch:${string}`

ch:<UUIDv7>. Immutable.

address

address: string

Canonical address; its local part is in the shared namespace (D-020).

name

name: string

Display name, linked to the local part (D-005).

reservedAddresses

reservedAddresses: ReservedAddress[]

Earlier addresses still reserved for this channel, oldest first.

kind

kind: ChannelKind

security

security: ChannelSecurity

securedAt

securedAt: string | null

upgradeSeq

upgradeSeq: number | null

The highest seq before the upgrade (09 §10.4); null for insecure channels and channels created secure.

preUpgradeHistory

preUpgradeHistory: PreUpgradeHistory | null

retentionDays

retentionDays: number | null

1 to 36,500, or null to keep content until deleted (09 §7.3).

topic

topic: string

Up to 1,024 scalar values, single line.

categoryId

categoryId: string | null

position

position: number

memberCount

memberCount: number

membership?

membership?: ChannelMembershipSummary | null

The caller's own membership, or null. In events it may be omitted; the client then keeps its previous value (09 §6.1).

version

version: number

createdAt

createdAt: string

updatedAt

updatedAt: string

createdBy

createdBy: string

Source: wire/communities.ts:421

ChannelAlreadySecureData interface

data of channel.already_secure (09 §10.4, §15.3).

interface ChannelAlreadySecureData

channel

channel: Channel

by

by: string | null

The admin whose upgrade made it secure, or null after a server upgrade.

groupId

groupId: string | null

Of the group's epoch 0; null if no group exists yet.

generation

generation: number | null

ekid

ekid: string | null

Source: wire/communities.ts:1027

ChannelCreatedEvent interface

channel.created payload (09 §14.2).

interface ChannelCreatedEvent

channel

channel: Channel

Source: wire/communities.ts:831

ChannelDeletedEvent interface

channel.deleted payload (09 §14.2). A lost_access one doesn't set a pin's deletedSeenAt (09 §14.1).

interface ChannelDeletedEvent

ctx

ctx: `ch:${string}`

address

address: string

security

security: ChannelSecurity

securedAt

securedAt: string | null

upgradeSeq

upgradeSeq: number | null

reason

reason: string & {} | "deleted" | "lost_access"

Source: wire/communities.ts:857

ChannelDisplayOrder interface

The sidebar in display order (09 §6.5).

interface ChannelDisplayOrder

uncategorized

uncategorized: Channel[]

Uncategorized channels, shown first. Channels naming a category not in the list are placed here.

categories

categories: CategoryGroup[]

Each category by position, each with its channels by position.

Source: api/channels.ts:104

ChannelList interface

GET /v1/channels response (09 §6.6). Never paginated; nextCursor is always null.

interface ChannelList

items

items: Channel[]

categories

categories: Category[]

nextCursor

nextCursor: null

Source: wire/communities.ts:587

ChannelMember interface

The ChannelMember object (09 §4.5).

interface ChannelMember

ctx

ctx: `ch:${string}`

The channel's ch: reference.

addr

addr: string

name

name: string

kind

kind: AccountKind

inc

inc: string

accountSecurity?

accountSecurity?: AccountSecurity

As in CommunityMember, with the same visibility rule.

state

state: ChannelMemberState

reason

reason: ChannelMemberReason | null

joinedAt

joinedAt: string | null

joinSeq

joinSeq: number | null

The seq of the member.joined that started the current membership.

visibleFromSeq

visibleFromSeq: number | null

Secure channels: the seq from which sealed items are served (09 §7.1, 14). null otherwise.

visibleRanges?

visibleRanges?: VisibilityRange[]

Only in HTTP responses to the member itself and to manage_channels holders; never in events (09 §7.2).

version

version: number

updatedAt

updatedAt: string

Source: wire/communities.ts:285

ChannelMembershipSummary interface

The caller's own channel membership inside a Channel object (09 §6.1).

interface ChannelMembershipSummary

state

state: ChannelMemberState

visibleFromSeq

visibleFromSeq: number | null

Source: wire/communities.ts:415

ChannelPatch interface

Settings members of PATCH /v1/channels/{id} (09 §6.4).

interface ChannelPatch

name?

name?: string

topic?

topic?: string

retentionDays?

retentionDays?: number | null

categoryId?

categoryId?: string | null

position?

position?: number

ifVersion?

ifVersion?: number

Source: wire/communities.ts:469

ChannelSecPin interface

A channel secure-state pin (09 §13.2).

interface ChannelSecPin

t

t: "sec_pin"

kind

kind: "channel"

host

host: string

Canonical domain of the hosting server; with ctx, the key.

ctx

ctx: `ch:${string}`

address

address: string

The channel's current address as last seen.

previousAddresses

previousAddresses: ({ address: string; replacedAt: string | null })[]

Earlier addresses; replacedAt is null when learned only from a later Channel object.

securedAt?

securedAt?: string

Pinned; absent until first seen.

upgradeSeq?

upgradeSeq?: number | null

Pinned (null for a channel created secure); absent until seen in a Channel or channel.security_changed.

version?

version?: number

The Channel version in the statement that set securedAt.

firstSeenAt

firstSeenAt: string

lastSeenAt

lastSeenAt: string

deletedSeenAt

deletedSeenAt: string | null

Source: wire/communities.ts:685

ChannelSecurityChangedEvent interface

channel.security_changed payload (09 §14.2), the only event at seq u + 1; marker K1.

interface ChannelSecurityChangedEvent

ctx

ctx: `ch:${string}`

security

security: "secure"

securedAt

securedAt: string

upgradeSeq

upgradeSeq: number

preUpgradeHistory

preUpgradeHistory: PreUpgradeHistory

cause

cause: string & {} | "server_upgrade" | "channel_upgrade"

by

by: string | null

version

version: number

Source: wire/communities.ts:845

ChannelStatement interface

What a server said about one channel (09 §13.3, §13.4). Build it with channelStatementFromChannel, channelStatementFromSecurityChanged or channelStatementFromInvitePreview, or by hand for an address lookup.

interface ChannelStatement

host

host: string

Canonical domain of the server that made the statement; it must host the channel.

ctx

ctx: `ch:${string}`

source

source: "channel" | "security_changed" | "address_lookup" | "invite_preview"

channel: a Channel object (HTTP response, GET /v1/channels entry or a channel.* event). security_changed: a channel.security_changed event. address_lookup, invite_preview: unauthenticated statements, which can create a pin but never fill upgradeSeq (09 §13.3 rule 2).

security

security: ChannelSecurity | null | undefined

address

address: string

The channel's current address.

securedAt?

securedAt?: string | null

Absent when the source doesn't carry it.

upgradeSeq?

upgradeSeq?: number | null

version?

version?: number

The Channel version in the statement, when it carries one.

cached?

cached?: boolean

true when the statement came from a cache (a cached channel list, address lookup or invite preview). A conflicting cached statement never raises W9; the result asks for a refetch with Cache-Control: no-cache (09 §13.4 "Only current statements count").

addressChangedAt?

addressChangedAt?: string | null

For an address change: the ts of the channel.updated that changed it, used as replacedAt (09 §13.2).

Source: api/channels.ts:514

ChannelTombstoneData interface

data of channel.deleted (error, 09 §6.4 step 7, §15.3): the tombstone.

interface ChannelTombstoneData

ctx

ctx: `ch:${string}`

address

address: string

security

security: ChannelSecurity

securedAt

securedAt: string | null

upgradeSeq

upgradeSeq: number | null

Source: wire/communities.ts:1038

ChannelUpdatedEvent interface

channel.updated payload (09 §14.2).

interface ChannelUpdatedEvent

channel

channel: Channel

changed

changed: string[]

Names of the changed members.

previousAddress?

previousAddress?: string

Present on an address change (09 §6.3).

Source: wire/communities.ts:836

ChannelUpgradeConfirmRequest interface

PATCH /v1/channels/{id} body of a channel-upgrade confirmation (09 §10.4). Needs Idempotency-Key.

interface ChannelUpgradeConfirmRequest

security

security: "secure"

dryRun?

dryRun?: false

Default false.

planVersion

planVersion: string

deletePreUpgradeHistory?

deletePreUpgradeHistory?: boolean

Default false.

bootstrap

bootstrap: UpgradeGroupBootstrap

ifVersion?

ifVersion?: number

Source: wire/communities.ts:500

ChannelUpgradeDryRunRequest interface

PATCH /v1/channels/{id} body of a channel-upgrade dry run (09 §10.2).

interface ChannelUpgradeDryRunRequest

security

security: "secure"

dryRun

dryRun: true

ifVersion?

ifVersion?: number

Source: wire/communities.ts:493

ChannelUpgradeOptions interface

Options of the channel-upgrade confirmation (09 §10.4).

interface ChannelUpgradeOptions

planVersion

planVersion: string

From the dry run the person confirmed in W5 (09 §10.3).

bootstrap

bootstrap: UpgradeGroupBootstrap

The caller's one-member group (13 §7.4); generation 1 for a first upgrade.

deletePreUpgradeHistory?

deletePreUpgradeHistory?: boolean

Delete pre-upgrade messages. Default false (W5's checkbox is off by default).

ifVersion?

ifVersion?: number

Source: api/channels.ts:187

ChannelUpgradePlan interface

The UpgradePlan of a channel dry run (09 §10.2).

interface ChannelUpgradePlan

scope

scope: "channel"

ctx

ctx: `ch:${string}`

planVersion

planVersion: string

memberTotal

memberTotal: number

Channel members (active).

cannotFollowCount

cannotFollowCount: number

Members whose accounts are insecure; they will become needs_encryption.

cannotFollow

cannotFollow: CannotFollowEntry[]

Up to 100 of them, ordered by addr.

cannotFollowTruncated

cannotFollowTruncated: boolean

secureBots

secureBots: SecureBotEntry[]

Up to 100 secure bots that will follow (W6), ordered by addr.

secureBotsTruncated

secureBotsTruncated: boolean

needsDeviceSetupCount

needsDeviceSetupCount: number

Informative.

historyMessageCount

historyMessageCount: number

May be approximate.

activeCall

activeCall: boolean

webhookCount

webhookCount: number

Source: wire/communities.ts:512

ChannelUpgradePlanStaleData interface

data of channel.upgrade_plan_stale (09 §10.4).

interface ChannelUpgradePlanStaleData

plan

plan: ChannelUpgradePlan

Source: wire/communities.ts:1022

ChannelVersionConflictData interface

data of channel.version_conflict (09 §2, §15.3).

interface ChannelVersionConflictData

current

current: Channel

Source: wire/communities.ts:995

ClaimedKeyPackage interface

One claimed KeyPackage (13 §9.4).

interface ClaimedKeyPackage

did

did: string

keyPackage

keyPackage: string

mls_key_package, base64url.

lastResort

lastResort: boolean

Source: wire/mls.ts:611

ClientIdMetadataDocument interface

The Client ID Metadata Document served at a URL client_id (05 §5.1).

interface ClientIdMetadataDocument

client_id

client_id: string

MUST equal the URL it was fetched from.

client_name

client_name: string

1–64 characters, shown on the "Continue to …" page.

redirect_uris

redirect_uris: string[]

1–10 redirect URIs (05 §5.2).

client_uri?

client_uri?: string

HTTPS home page.

logo_uri?

logo_uri?: string

HTTPS logo.

Source: wire/accounts.ts:265

Clock interface

A wall clock, injectable for tests. now() returns Unix time in milliseconds.

interface Clock

now

now(): number

Source: core/time.ts:11

CloseCodeEntry interface

One row of the close-code table (03 §5.10).

interface CloseCodeEntry

reason

readonly reason: ClosingReason | readonly ClosingReason[] | null

The session.closing reason that goes with the code, or null where the table has none.

meaning

readonly meaning: string

The meaning of the code.

Source: wire/transport.ts:496

CollectionParams interface

Parameters of a collection list (03 §13.2); extra members are passed as query parameters.

interface CollectionParams

cursor?

cursor?: string

The nextCursor of the previous page; absent for the first page. Opaque.

limit?

limit?: number

1 to 100 by default; an owner may allow up to 1,000.

Source: core/pagination.ts:42

CommitResult interface

200 response of POST …/mls/commits, CommitResult (13 §7.5).

interface CommitResult

groupId

groupId: string

epoch

epoch: number

The new epoch (epoch + 1).

ekid

ekid: string

The reference ekid recorded for the new epoch.

seq

seq: number

The context seq of the mls.handshake event.

commitHash

commitHash: string

base64url SHA-256 of the commit's MLSMessage bytes.

Source: wire/mls.ts:440

CommitSubmission interface

Body of POST /v1/contexts/{ctx}/mls/commits, CommitSubmission (13 §7.5).

interface CommitSubmission

epoch

epoch: number

The epoch the commit was built in; equals the FramedContent epoch.

commit

commit: string

The commit as mls_public_message (base64url).

groupInfo

groupInfo: string

GroupInfo for epoch + 1, signed by the committer, with ratchet_tree and external_pub.

ekid

ekid: string

ekid(epoch + 1) as the committer computed it (14 §3.2).

welcome?

welcome?: string

DM commits with Adds only: the Welcome for every added leaf. MUST be absent otherwise.

Source: wire/mls.ts:426

Community interface

The Community object (09 §3.2). Every member is public, in every mode.

interface Community

domain

domain: string

The server's canonical domain (lowercase A-label). Immutable.

name

name: string

Free-text name, 1 to 64 scalar values; always shown with domain (09 §3.7).

description

description: string

Up to 1,000 scalar values, multi-line; may be empty.

icon

icon: CommunityIcon | null

Icon descriptor, or null.

secure

secure: boolean

true once upgraded (09 §11). Never returns to false.

securedAt

securedAt: string | null

When secure became true; null while insecure. Immutable once set.

joinPolicy

joinPolicy: JoinPolicy

open, invite, request or closed.

requireRulesAcceptance

requireRulesAcceptance: boolean

Whether joining needs acceptance of the current rules (09 §4.3).

rulesText

rulesText: string

Up to 8,000 scalar values; plain text with links made clickable.

rulesVersion

rulesVersion: number

Starts at 0; increases by 1 every time rulesText changes.

localAccountsAreMembers

localAccountsAreMembers: boolean

D-068 toggle (09 §4.4).

defaultChannel

defaultChannel: `ch:${string}` | null

ch: reference opened after joining when nothing else names one, or null.

memberCount

memberCount: number

Members in active or needs_encryption; may be up to 5 min stale.

version

version: number

Increases by 1 on every change; used for ifVersion and to drop stale events.

createdAt

createdAt: string

updatedAt

updatedAt: string

Source: wire/communities.ts:138

CommunityEvents interface

Every 09 event a client can receive on its event WebSocket, mapped to its payload (09 §14.2). All are durable. Events on a channel stream outside the recipient's visibility ranges, and channel.* events on the community stream about a channel the recipient can't view, carry the reduced payload { "withheld": true } instead (09 §7.2, §14.1).

interface CommunityEvents

community.updated

community.updated: CommunityUpdatedEvent

community.security_changed

community.security_changed: CommunitySecurityChangedEvent

community.layout_changed

community.layout_changed: CommunityLayout

community.list_changed

community.list_changed: CommunityListChangedEvent

member.joined

member.joined: WithheldPayload | MemberJoinedEvent

member.left

member.left: WithheldPayload | MemberLeftEvent

member.removed

member.removed: WithheldPayload | MemberRemovedEvent

member.updated

member.updated: WithheldPayload | MemberUpdatedEvent

member.requested

member.requested: MemberRequestedEvent

member.rejected

member.rejected: MemberRejectedEvent

channel.created

channel.created: WithheldPayload | ChannelCreatedEvent

channel.updated

channel.updated: WithheldPayload | ChannelUpdatedEvent

channel.security_changed

channel.security_changed: ChannelSecurityChangedEvent | WithheldPayload

channel.deleted

channel.deleted: ChannelDeletedEvent | WithheldPayload

invite.created

invite.created: InviteCreatedEvent

invite.revoked

invite.revoked: InviteRevokedEvent

Source: wire/communities.ts:885

CommunityIcon interface

The icon descriptor (09 §3.4).

interface CommunityIcon

url

url: string

Absolute HTTPS URL under the server's base URL; changes whenever the image changes.

sha256

sha256: string

base64url SHA-256 of the image bytes. Clients MUST check it after download.

mediaType

mediaType: string & {} | "image/webp" | "image/jpeg" | "image/png"

image/png, image/jpeg or image/webp.

width

width: number

Pixel width, 16 to 1024; equal to height.

height

height: number

Pixel height, 16 to 1024; equal to width.

Source: wire/communities.ts:124

CommunityIconImage interface

A downloaded community icon (09 §3.4).

interface CommunityIconImage

bytes

bytes: Uint8Array

mediaType

mediaType: string

The response's media type.

Source: api/community.ts:60

CommunityLayout interface

A full layout: the payload of community.layout_changed (09 §14.2).

interface CommunityLayout

categories

categories: Category[]

channels

channels: LayoutChannelPosition[]

Source: wire/communities.ts:581

CommunityLayoutRequest interface

PATCH /v1/community/layout body (09 §6.5): every category and every channel exactly once.

interface CommunityLayoutRequest

categories

categories: string[]

channels

channels: LayoutChannelPlacement[]

Source: wire/communities.ts:568

CommunityListChangedEvent interface

community.list_changed payload, on the account stream at the home server (09 §14.2).

interface CommunityListChangedEvent

op

op: string & {} | "remove" | "upsert"

domain

domain: string

entry

entry: CommunityListEntry | null

Source: wire/communities.ts:777

CommunityListEntry interface

The CommunityListEntry object (09 §5.1).

interface CommunityListEntry

domain

domain: string

Canonical domain; the entry's key.

name

name: string

Cached name, at most 64 scalar values.

iconUrl

iconUrl: string | null

secure

secure: boolean

Cached; informative only. Clients rely on their pins (09 §13).

state

state: CommunityListState

position

position: number

Sidebar position, from 0.

local

local: boolean

true for the home server's own community (maintained by the home server).

addedAt

addedAt: string

updatedAt

updatedAt: string

Source: wire/communities.ts:349

CommunityMember interface

The CommunityMember object (09 §4.1).

interface CommunityMember

addr

addr: string

name

name: string

Display name, checked by the receiver against addr (01).

kind

kind: AccountKind

inc

inc: string

The account incarnation (05 §11.1, D-086). A different inc is a different account.

local

local: boolean

true for a local account.

accountSecurity?

accountSecurity?: AccountSecurity

Only in responses to the member itself and to holders of manage_channels or manage_community. Clients MUST NOT display another member's value (09 §18 item 9).

state

state: CommunityMemberState

reason

reason: CommunityMemberReason | null

null for active and pending.

via

via: JoinVia

requestedAt

requestedAt: string | null

joinedAt

joinedAt: string | null

rulesAcceptedVersion

rulesAcceptedVersion: number | null

roles

roles: string[]

Role IDs (UUIDv7); semantics belong to 10.

version

version: number

updatedAt

updatedAt: string

Source: wire/communities.ts:257

CommunityNotificationSettings interface

CommunityNotificationSettings for the community of one hosting server (19 §7.2).

interface CommunityNotificationSettings

host

host: string

Canonical domain of the community's server (read-only; from the path).

level

level: string & {} | "mentions" | "nothing" | "default"

muteUntil

muteUntil: string | null

While in the future, the community's channels don't notify. At most 366 days ahead.

everyone

everyone: boolean | null

Overrides the global everyone; null inherits.

updatedAt

updatedAt: string | null

Read-only.

Source: wire/notifications.ts:283

CommunityPatch interface

Settings members of PATCH /v1/community (09 §3.6). Name only the members to change; null resets defaultChannel. Needs manage_community.

interface CommunityPatch

name?

name?: string

description?

description?: string

joinPolicy?

joinPolicy?: JoinPolicy

requireRulesAcceptance?

requireRulesAcceptance?: boolean

rulesText?

rulesText?: string

localAccountsAreMembers?

localAccountsAreMembers?: boolean

defaultChannel?

defaultChannel?: `ch:${string}` | null

A channel for which previewVisible is true, or null; otherwise 404 core.not_found.

ifVersion?

ifVersion?: number

Optimistic concurrency: 409 community.version_conflict if it doesn't match (09 §2).

Source: wire/communities.ts:175

CommunitySecPin interface

A community secure-state pin (09 §13.2). Never deleted (09 §13.3 rule 4).

interface CommunitySecPin

t

t: "sec_pin"

kind

kind: "community"

host

host: string

ctx

ctx: null

securedAt?

securedAt?: string

version?

version?: number

firstSeenAt

firstSeenAt: string

lastSeenAt

lastSeenAt: string

hidden

hidden: boolean

true after "Leave" on a W9 for this community (09 §13.6).

Source: wire/communities.ts:707

CommunitySecurityChangedEvent interface

community.security_changed payload (09 §14.2).

interface CommunitySecurityChangedEvent

domain

domain: string

secure

secure: true

securedAt

securedAt: string

version

version: number

cause

cause: string & {} | "server_upgrade"

Unknown values are read as no reason.

by

by: string

Source: wire/communities.ts:763

CommunityStatement interface

What a server said about its community (09 §13.3, §13.4 T4).

interface CommunityStatement

host

host: string

Canonical domain of the server.

source

source: "community" | "invite_preview" | "server_metadata"

community: a Community object or community.* event; server_metadata: ServerMetadata (02); invite_preview: §8.4.

secure

secure: boolean | null | undefined

securedAt?

securedAt?: string | null

version?

version?: number

The Community version, when the statement carries one.

cached?

cached?: boolean

true for a cached ServerMetadata or invite preview; see ChannelStatement.cached.

Source: api/channels.ts:786

CommunityUpdatedEvent interface

community.updated payload (09 §14.2). Also emitted for icon changes.

interface CommunityUpdatedEvent

community

community: Community

Source: wire/communities.ts:758

CommunityUpgradePlanStaleData interface

data of community.upgrade_plan_stale (09 §11.4).

interface CommunityUpgradePlanStaleData

plan

plan: ServerUpgradePlan

Source: wire/communities.ts:1017

CommunityVersionConflictData interface

data of community.version_conflict (09 §2, §15.1).

interface CommunityVersionConflictData

current

current: Community

Source: wire/communities.ts:990

ConfirmABody interface

Body of confirm_a (08 §6.6.2).

interface ConfirmABody

ta

ta: string

base64url of the initiator's 32-byte confirmation tag.

Source: wire/device-setup.ts:217

ConsentForm interface

The consent form the server's own "Continue to …" page posts to /v1/auth/consent (05 §5.4). Browser only.

interface ConsentForm

tx

tx: string

The 43-character consent token.

decision

decision: "continue" | "cancel"

Source: wire/accounts.ts:366

ContentByKind interface

The content object type for each kind (11 §3.1).

interface ContentByKind

message

message: MessageContent

edit

edit: EditContent

reaction

reaction: ReactionContent

delete

delete: DeleteContent

Source: wire/messaging.ts:291

ContentIssue interface

One problem found in a content object. field and reason mirror message.invalid_content data (11 §17.1).

interface ContentIssue

field

field: string

JSON-pointer-like path of the member, for example attachments/0/name.

reason

reason: string

Short machine-readable reason.

message

message: string

Source: content.ts:482

ContentWithheldMessage interface

The content-withheld form of a plain Message object, only inside a dm.request (11 §8.3, 12 §8.2). It never appears on the timeline API.

interface ContentWithheldMessage extends Omit<Message, "content">

type?

type?: "message"

"message" in timeline pages (11 §7.1) only.

mid

mid: string

ctx?

ctx?: CtxRef

Present in HTTP; omitted in events.

seq

seq: number

Present in HTTP; omitted in events.

carrier

carrier: CarrierType

sender

sender: Sender

createdAt

createdAt: string

sealed?

sealed?: SealedMessage

sealed, not deleted, not edited: the root SealedMessage.

edit?

edit?: EditEntry | null

sealed only: the latest edit, or null.

mentions?

mentions?: string[]

sealed only: the server-validated mention hint of the root.

mentionAll

mentionAll: boolean

The server-validated mentionAll of the root (11 §4.4).

attachmentIds?

attachmentIds?: string[]

sealed, when any are bound: the IDs currently bound.

editedAt

editedAt: string | null

deleted

deleted: Deletion | null

reactions?

reactions?: ReactionSummary[]

Aggregated plain reactions; absent on tombstones.

reactionEntries?

reactionEntries?: ReactionEntry[]

Up to 100 sealed reaction entries, oldest first.

reactionEntryCount?

reactionEntryCount?: number

Total number of sealed reaction entries, with reactionEntries.

updatedSeq

updatedSeq: number

seq of the latest entry that changed this message.

contentWithheld

contentWithheld: true

Source: wire/messaging.ts:456

ContextNotificationSettings interface

ContextNotificationSettings, addressed by (host, ctx) (19 §7.3).

interface ContextNotificationSettings

host

host: string

Canonical domain of the hosting server (read-only; from the query).

ctx

ctx: CtxRef

The context reference (read-only; from the path).

level

level: NotificationLevel

all only for dm: and gdm: contexts.

muteUntil

muteUntil: string | null

everyone

everyone: boolean | null

calls

calls: boolean | null

DMs only: overrides calls; null inherits. MUST be null for channels.

updatedAt

updatedAt: string | null

Read-only.

Source: wire/notifications.ts:304

ContextSettingsQuery interface

The host query of the per-context settings endpoints (19 §7.3); absent means the home server.

interface ContextSettingsQuery

host?

host?: string

Canonical domain of the hosting server.

Source: api/notifications.ts:76

ControlMessage interface

One sv-control message (15 §6.5). The relay sets from on everything it forwards and ignores a client's from.

interface ControlMessage<T extends string = string, D = Record<string, unknown>>

t

t: T

<area>.<name> (15 §6.5 ABNF).

from?

from?: number

The sending participant's pid. Absent on messages the relay originates.

to?

to?: number

The target pid of a unicast message.

d

d: D

The payload, defined by the owner of t.

Source: wire/calls.ts:758

ControlMessages interface

Control-channel message types and their payloads (15 §6.5, §6.10). media.attestation is owned by 18.

interface ControlMessages

relay.welcome

relay.welcome: RelayWelcome

relay.ping

relay.ping: PingPayload

relay.pong

relay.pong: PingPayload

relay.subscribe

relay.subscribe: RelaySubscribe

relay.closing

relay.closing: RelayClosing

relay.error

relay.error: Problem

A problem object whose code is relay.bad_message, relay.bad_offer, or core.rate_limited; never ends the session by itself.

relay.ice_servers

relay.ice_servers: RelayIceServers

relay.ice_restart

relay.ice_restart: RelayIceRestart

relay.ice_answer

relay.ice_answer: RelayIceAnswer

call.tick

call.tick: LeaseSnapshot

call.media_feedback

call.media_feedback: MediaFeedback

media.attestation

media.attestation: Record<string, unknown>

Source: wire/calls.ts:824

CpaceABody interface

Body of cpace_a (08 §6.6.2, 04 §11.4).

interface CpaceABody

cred

cred: string & {} | PairingCredentialKind

ya

ya: string

base64url of Ya (32 bytes).

ad

ad: string

base64url of ADa (26 bytes).

Source: wire/device-setup.ts:198

CpaceBBody interface

Body of cpace_b (08 §6.6.2).

interface CpaceBBody

yb

yb: string

base64url of Yb (32 bytes).

ad

ad: string

base64url of ADb (26 bytes).

tb

tb: string

base64url of the responder's 32-byte confirmation tag.

Source: wire/device-setup.ts:207

CpaceGenerator interface

The group operation CPace needs beyond X25519: calculate_generator(H, PRS, CI, sid) of the pinned draft (04 §11.1, §11.4). The SDK ships elligator2Generator; a platform with a vetted CPace implementation may supply its own.

interface CpaceGenerator

calculateGenerator

calculateGenerator(prs: Uint8Array, ci: Uint8Array, sid: Uint8Array): Promise<Uint8Array<ArrayBufferLike>>
prs: Uint8Array
ci: Uint8Array
sid: Uint8Array

Source: api/pairing.ts:244

CpaceOptions interface

Options for CPace runs.

interface CpaceOptions

generator?

generator?: CpaceGenerator

random?

random?: RandomSource

The scalar source for sample_scalar (CSPRNG by default; fixed only for vectors).

Source: api/pairing.ts:249

CpaceSessionInputs interface

The CPace inputs the session provides (08 §6.6.1, 04 §11.3).

interface CpaceSessionInputs

pairingId

pairingId: string

The pairing session id (UUIDv7); also sid.

address

address: string

The account's canonical address.

didInitiator

didInitiator: string

The entering device's did (initiator).

didResponder

didResponder: string

The displayer's did (responder).

Source: api/pairing.ts:228

CreateAttachmentRequest interface

The body of POST /v1/contexts/{ctx}/attachments (11 §14.2).

interface CreateAttachmentRequest

purpose?

purpose?: "file" | "thumbnail"

Default file. MUST be file in a secure context.

blobBytes

blobBytes: number

Size of the blob that will be uploaded.

mime

mime: string

Insecure: the file's type. Secure: application/octet-stream.

sha256

sha256: string

base64url SHA-256 of the blob bytes.

Source: wire/messaging.ts:747

CreateAttachmentResponse interface

The 201 answer to upload creation (11 §14.2).

interface CreateAttachmentResponse

attachment

attachment: Attachment

The new object, state: "pending".

upload

upload: UploadInstructions

Source: wire/messaging.ts:771

CreateBanRequest interface

Body of POST /v1/bans (10 §9.6). Exactly one of address and domain.

interface CreateBanRequest extends ModerationCommon

reason?

reason?: string

0–512 Unicode scalar values; stored in the audit log.

showReason?

showReason?: boolean

Show reason to the target. Default false.

reportId?

reportId?: string

Link the audit entry (and the report's actions) to this report.

address?

address?: string

In any form canonicalize() accepts (01 §7.7).

domain?

domain?: string

scope?

scope?: "community" | "server"

Default community. server needs the admin role and an address target.

durationMs?

durationMs?: number

3,600,000 (1 h) or more; absent for permanent.

deleteMessagesWithinMs?

deleteMessagesWithinMs?: number

Absent or 0 for none; otherwise 60,000 to 604,800,000.

Source: wire/moderation.ts:356

CreateBotRequest interface

Body of POST /v1/bots (05 §15.2).

interface CreateBotRequest

name

name: string

The bot's display name; its local part is derived as at sign-up.

about?

about?: string

05 §11.1 limits.

deviceName?

deviceName?: string

Name of the first token's device; default "Bot token 1".

expiresAt?

expiresAt?: string

Expiry of the first token, at most 2 years ahead.

Source: wire/accounts.ts:623

CreateBotResponse interface

Response 201 of POST /v1/bots (05 §15.2). The token is shown only here.

interface CreateBotResponse

bot

bot: Bot

token

token: string

svb_….

Source: wire/accounts.ts:635

CreateBotTokenRequest interface

Body of POST /v1/bots/{local}/tokens (05 §15.4).

interface CreateBotTokenRequest

deviceName?

deviceName?: string

expiresAt?

expiresAt?: string

At most 2 years ahead.

Source: wire/accounts.ts:648

CreateCategoryRequest interface

POST /v1/community/categories body (09 §6.5).

interface CreateCategoryRequest

name

name: string

position?

position?: number

Default: last.

Source: wire/communities.ts:548

CreateChannelRequest interface

POST /v1/channels body (09 §6.4).

interface CreateChannelRequest

name

name: string

Display name; the local part is derived from it (09 §6.3).

kind

kind: "text" | "voice"

security?

security?: "insecure" | "secure"

Default: the server's mode. insecure on a secure server fails with security.server_requires_secure.

retentionDays?

retentionDays?: number | null

topic?

topic?: string

categoryId?

categoryId?: string | null

position?

position?: number

Default: last in its category.

Source: wire/communities.ts:455

CreateDeviceProofInput interface

Input of createDeviceProof (06 §5.2, §5.3).

interface CreateDeviceProofInput

aud

aud: string

The remote server's canonical domain: the assertion's aud.

ajti

ajti: string

The assertion's jti.

signer

signer: Ed25519Signer

The device's DSK. Any Ed25519Signer works: a WebCrypto key pair, or on the web a key-Worker proxy that signs the signing input (D-065).

now?

now?: number | Date

Creation time in ms (a server-corrected clock, 04 §6.6) or a Date. Default: now.

kid?

kid?: string

The DSK thumbprint (dkf). Computed from signer.publicKey when omitted.

Source: auth/remote.ts:537

CreateDmRequest interface

Body of POST /v1/dms (12 §7.2).

interface CreateDmRequest

kind

kind: "direct" | "group"

direct or group.

peer?

peer?: string

For direct: the other participant's canonical address.

participants?

participants?: string[]

For group: the other initial participants (≥ 2, ≤ maxGroupDmParticipants − 1, distinct, not the caller).

expectSecurity

expectSecurity: "insecure" | "secure"

The security the client computed (12 §7.1 step 2, §11.1).

name?

name?: string

Group DMs only: the name (12 §6.1).

communityHints?

communityHints?: string[]

Up to 10 canonical domains of communities on the caller's list in which it saw the recipients (12 §7.1, §10.2).

replaces?

replaces?: DmLink

The closed predecessor, when creating a successor (12 §13.3).

bootstrap?

bootstrap?: GroupBootstrap

For direct with expectSecurity secure only: the GroupBootstrap for generation 1 (13 §7.4). MUST be absent otherwise.

commit?

commit?: CommitSubmission

Only with bootstrap, whenever any KeyPackage was claimed: the first CommitSubmission (13 §7.5).

Source: wire/dms.ts:167

CreateGatewayPushRegistrationRequest interface

Body of POST /v1/me/push-registrations for a gateway registration (19 §9.2).

interface CreateGatewayPushRegistrationRequest

transport

transport: "gateway"

types

types: PushType[]

gatewayUrl

gatewayUrl: string

Without trailing slash.

pushKey

pushKey: string

From {gatewayUrl}/v1/register.

Source: wire/notifications.ts:499

CreateInviteRequest interface

POST /v1/invites body (09 §8.3).

interface CreateInviteRequest

channel?

channel?: `ch:${string}` | null

A channel the creator can view; default null.

maxAgeMs?

maxAgeMs?: number | null

300,000 to 31,536,000,000, or null for never (needs manage_invites). Default 604,800,000.

maxUses?

maxUses?: number | null

1 to 10,000, or null. Default null.

allowSignUp?

allowSignUp?: boolean

Default true; false needs manage_invites.

Source: wire/communities.ts:627

CreatePairingRequest interface

Body of POST /v1/me/pairing (08 §6.4.1).

interface CreatePairingRequest

displayer?

displayer?: PairingRole

Default new_device for an unenrolled caller, enrolled_device for an enrolled one.

Source: wire/device-setup.ts:179

CreatePushTokenInput interface

Input of createPushToken (19 §11.4).

interface CreatePushTokenInput

iss

iss: string

The home server's canonical domain.

kid

kid: string

<iss>#<keyId> of one of the home server's keys of purpose sign (02).

gatewayUrl

gatewayUrl: string

The registration's gatewayUrl: a base URL without a trailing slash (19 §9.1).

body

body: string | Uint8Array<ArrayBufferLike>

The exact request content of POST {gatewayUrl}/v1/push, as it will be sent (06 §8.4).

signer

signer: Ed25519Signer

now?

now?: number | Date

ms timestamp or Date. Default: now.

jti?

jti?: string

For test vectors only: a fixed jti. Senders MUST make a new token with a new jti for every attempt (19 §11.4).

Source: api/push.ts:475

CreateRoleRequest interface

Body of POST /v1/roles (10 §7.3).

interface CreateRoleRequest

name

name: string

permissions?

permissions?: Permission[]

color?

color?: string | null

showSeparately?

showSeparately?: boolean

position?

position?: number

Default 1 (just above everyone); MUST be below the actor's top position.

Source: wire/moderation.ts:91

CreateS2STokenInput interface

Input of createS2SToken (06 §8.2).

interface CreateS2STokenInput

iss

iss: string

The sender's canonical domain.

kid

kid: string

The sending server key ID, <iss>#<keyId>, of an active sign key (06 §3.2).

aud

aud: string

The destination's canonical domain.

method

method: string

The HTTP method.

url

url: string

The full target URI; it is normalized for htu (06 §8.3).

body?

body?: string | Uint8Array<ArrayBufferLike> | null

The exact request content, if any (06 §8.4). Empty content counts as none.

signer

signer: Ed25519Signer

now?

now?: number | Date

ms timestamp or Date. Default: now.

jti?

jti?: string

For test vectors only: a fixed jti. Senders MUST use a fresh one per attempt (06 §8.6).

Source: auth/remote.ts:751

CreateSessionOptions interface

Options of FederationApi.createSession (06 §6.1).

interface CreateSessionOptions extends RequestOptions

renewToken?

renewToken?: string

The current, unexpired remote session token: the request then renews that session (06 §6.1). Omit to create a new session; the request is sent with no Authorization header at all.

signal?

signal?: AbortSignal

Cancels the request and any automatic retry (03 §2.7 item 3).

idempotencyKey?

idempotencyKey?: string

Sent as Idempotency-Key (03 §14.2). Create calls with a client-generated ID (mid) don't need it.

Source: api/federation.ts:41

CreateSessionRequest interface

POST /v1/federation/sessions request body (06 §6.1). Without an Authorization header it creates a session; with the current remote session token it renews that session. At most 64 KiB.

interface CreateSessionRequest

assertion

assertion: string

A HomeAssertion whose aud is the remote server's canonical domain.

deviceProof?

deviceProof?: string

The DeviceProof (06 §5), required when the assertion has enr: true, absent otherwise.

deviceCertificate?

deviceCertificate?: string

The device's DeviceCertificate JWS (07), required when the assertion has enr: true.

identityState?

identityState?: string

The IdentityState JWS returned with the assertion; RECOMMENDED when sec is secure.

client?

client?: string

Client software identifier, 1–128 printable ASCII characters, as in session.hello (03).

Source: wire/federation.ts:152

CreateWebhookRequest interface

The body of POST /v1/contexts/{ctx}/webhooks (11 §15.3).

interface CreateWebhookRequest

name

name: string

allowMentionAll?

allowMentionAll?: boolean

Source: wire/messaging.ts:804

CreateWebPushRegistrationRequest interface

Body of POST /v1/me/push-registrations for a Web Push registration (19 §9.2).

interface CreateWebPushRegistrationRequest

transport

transport: "webpush"

types

types: ("call" | "alert")[]

MUST NOT include background.

webPush

webPush: WebPushSubscriptionKeys

vapidKey

vapidKey: string

The webPushKey actually passed as applicationServerKey.

Source: wire/notifications.ts:509

CredentialLookupRequest interface

Body of POST /v1/contexts/{ctx}/history/credentials/lookup (14 §8.5). 1 to 100 devices.

interface CredentialLookupRequest

devices

devices: ({ addr: string; did: string })[]

Source: wire/history.ts:266

CredentialLookupResponse interface

200 response of the credential lookup (14 §8.5).

interface CredentialLookupResponse

items

items: CredentialRecord[]

missing

missing: ({ addr: string; did: string })[]

Source: wire/history.ts:271

CredentialRecord interface

A CredentialRecord (14 §5.6, §8.5): the hosting server's copy of a sending device's credential.

interface CredentialRecord

addr

addr: string

The sender's canonical address.

did

did: string

dkf

dkf: string

RFC 7638 thumbprint of the DSK.

idc

idc: string

IdentityCertificate JWS.

devcert

devcert: string

DeviceCertificate JWS.

firstSeenAt

firstSeenAt: string

lastSeenAt

lastSeenAt: string

status

status: CredentialRecordStatus

Source: wire/history.ts:250

CurrentSessionOptions interface

Options of the …/sessions/current calls (06 §6.5, §6.6). token sends that remote session token explicitly instead of asking the client's TokenProvider, which is how RemoteSessionProvider itself calls them.

interface CurrentSessionOptions extends RequestOptions

token?

token?: string

A remote session token of this server to use as Authorization: Bearer (06 §6.5).

signal?

signal?: AbortSignal

Cancels the request and any automatic retry (03 §2.7 item 3).

idempotencyKey?

idempotencyKey?: string

Sent as Idempotency-Key (03 §14.2). Create calls with a client-generated ID (mid) don't need it.

Source: api/federation.ts:35

DataChannelSpec interface

One data channel of the relay connection layout (15 §6.4).

interface DataChannelSpec

id

readonly id: number

label

readonly label: string

protocol

readonly protocol: string

ordered

readonly ordered: boolean

maxRetransmits?

readonly maxRetransmits?: number

maxRetransmits for sv-audio; absent means reliable.

maxPacketLifeTime?

readonly maxPacketLifeTime?: number

maxPacketLifeTime in ms for sv-video.

messageType

readonly messageType: "text" | "binary"

Source: wire/calls.ts:722

DeclineRequest interface

POST /v1/contexts/{ctx}/call/decline request (15 §13.2).

interface DeclineRequest

callId

callId: string

Source: wire/calls.ts:569

DecryptedReaction interface

A decrypted sealed reaction entry: the entry and the key from its ReactionContent (11 §5.5 step 3).

interface DecryptedReaction

entry

entry: ReactionEntry

key

key: string

Source: api/reactions.ts:79

DeleteContent interface

Deletes the author's own root message or reaction entry (11 §3.7.3).

interface DeleteContent

target

target: string

mid of the root message or reaction entry to delete.

Source: wire/messaging.ts:282

DeleteEvent interface

d of message.deleted (11 §8.2).

interface DeleteEvent

target

target: string

The deleted root message.

by

by: DeletedBy

mid?

mid?: string

The delete entry's mid, when by is author.

deletedAt

deletedAt: string

Source: wire/messaging.ts:564

Deletion interface

How a root message was deleted (11 §5.4).

interface Deletion

at

at: string

by

by: DeletedBy

Source: wire/messaging.ts:366

DeviceAddedPayload interface

device.added payload (05 §18). via: "login" raises W4d on other devices (05 §12.12).

interface DeviceAddedPayload

device

device: DeviceRecord

via

via: DeviceAddedVia

Source: wire/accounts.ts:714

DeviceCertificateClaims interface

Payload of a DeviceCertificate, typ sv-devcert+jwt, signed by the identity key (07 §6.1).

interface DeviceCertificateClaims

sub

sub: string

igen

igen: number

did

did: string

Device ID, 16 bytes base64url (22 characters).

dsk

dsk: Ed25519PublicJwk

The device signing key (DSK), an Ed25519 OKP JWK.

dbk

dbk: X25519PublicJwk

The device box key, an X25519 OKP JWK (07 §3.6, 08 §10.1).

plat

plat: DevicePlatform

iat

iat: number

Source: wire/identity.ts:117

DeviceCredentials interface

The device credentials an enrolled device presents with each session request (06 §5, §6.1).

interface DeviceCredentials

signer

signer: Ed25519Signer

The device's DSK (04 §4.2). On the web, a proxy to the key Worker (D-065).

certificate

certificate: string | () => string | Promise<string>

The device's DeviceCertificate JWS (07), or a function returning the current one.

Source: auth/remote.ts:1068

DeviceEntry interface

One active enrolled device in an IdentityState (07 §7.1 DeviceEntry).

interface DeviceEntry

did

did: string

dkf

dkf: string

thumb(dsk) of the device's DeviceCertificate for the current igen.

plat

plat: DevicePlatform

Copied from the DeviceCertificate.

since

since: number

NumericDate when the device was listed.

Source: wire/identity.ts:139

DeviceProofClaims interface

DeviceProof claims (06 §5.2).

interface DeviceProofClaims

aud

aud: string

The remote server's canonical domain; equals the assertion's aud.

ajti

ajti: string

The assertion's jti.

iat

iat: number

Creation time, NumericDate.

exp

exp: number

iat < exp ≤ iat + 60; clients SHOULD use exactly iat + 60.

Source: wire/federation.ts:126

DeviceProofHeader interface

Protected header of a DeviceProof: kid is the device DSK's RFC 7638 thumbprint, i.e. the assertion's dkf (06 §5.2).

interface DeviceProofHeader

alg

alg: "EdDSA"

typ

typ: "sv-devproof+jwt"

kid

kid: string

Source: wire/federation.ts:119

DeviceProofInvalidData interface

data of federation.device_proof_invalid (06 §16).

interface DeviceProofInvalidData

reason

reason: DeviceProofInvalidReason

serverTime?

serverTime?: string

When reason is device_proof_expired.

identityReason?

identityReason?: string

07's identity check result (07 §10.6), for diagnostics only.

Source: wire/federation.ts:668

DeviceRecord interface

The DeviceRecord object (05 §12.2). One home session is one device record (05 §12.1).

interface DeviceRecord

did

did: string

Device ID (05 §12.4).

name

name: string

1–64 code points, no control characters.

platform

platform: DevicePlatform

Platform; unknown treated as desktop.

clientSoftware

clientSoftware: string

Client software string (05 §5.3).

state

state: DeviceState

active or revoked; unknown treated as revoked.

enrolled

enrolled: boolean

Whether the device is listed in the latest IdentityState (05 §12.8). Always false for an insecure account.

dkf?

dkf?: string

The DSK fingerprint from the IdentityState, present while enrolled is true.

sharedComputer

sharedComputer: boolean

Shared-computer mode (05 §12.6).

provider

provider: string | null

Provider ID used to create the session; null for bot devices.

authAt

authAt: string | null

The session's authAt (05 §9.1); null for bot devices.

createdAt

createdAt: string

Timestamp.

lastSeenAt

lastSeenAt: string

Last activity, at most 60 s stale (05 §12.5).

expiresAt

expiresAt: string | null

When the device will be revoked if nothing changes; null for bots without expiry and revoked devices.

revokedAt?

revokedAt?: string

When revoked.

revokedReason?

revokedReason?: RevokedReason

When revoked (05 §12.3).

current

current: boolean

true only for the device the request was made from.

tokenHint?

tokenHint?: string

Bot devices only: the last 4 characters of the bot token.

tokenRotatedAt?

tokenRotatedAt?: string

Bot devices only: when the bot token was last issued or rotated.

Source: wire/accounts.ts:183

DeviceRevocationClaims interface

Payload of a DeviceRevocation, typ sv-devrevoke+jwt, signed by the identity key (07 §8.1).

interface DeviceRevocationClaims

sub

sub: string

igen

igen: number

did

did: string

iat

iat: number

Source: wire/identity.ts:131

DeviceRevokedEvent interface

Payload of device.revoked (07 §12.2). rev is a hint, never evidence (07 §8.2 rule 3).

interface DeviceRevokedEvent

sub

sub: string

did

did: string

revokedAt

revokedAt: string

RFC 3339 time of the revocation.

igen

igen: number

dkf?

dkf?: string

Thumbprint of the revoked device's DSK, when the device was listed.

ver

ver: number

state

state: string

The IdentityState JWS after the revocation (unchanged for an unlisted device).

rev?

rev?: string

actor?

actor?: IdentityActor

Source: wire/identity.ts:281

DeviceSetupErrorInfo interface

One row of the 08 error registry.

interface DeviceSetupErrorInfo

status

readonly status: number

retryable

readonly retryable: boolean

userAction

readonly userAction: "none" | "retry" | "wait" | "enable_encryption"

Source: wire/device-setup.ts:719

DeviceSetupEvents interface

Client events of 08 (08 §14): event type to payload. All are ephemeral, on me, never S2S.

interface DeviceSetupEvents

pairing.requested

pairing.requested: PairingSession

pairing.updated

pairing.updated: PairingSession

pairing.message

pairing.message: PairingMessageEvent

backup.updated

backup.updated: BackupUpdatedEvent

vault.changed

vault.changed: VaultChangedEvent

vault.rotation_needed

vault.rotation_needed: VaultRotationNeededEvent

vault.key_rotated

vault.key_rotated: VaultKeyRotatedEvent

vault.grant_needed

vault.grant_needed: VaultGrantNeededEvent

Source: wire/device-setup.ts:704

DeviceSummary interface

A device as the home server describes it in a pairing session (08 §6.2).

interface DeviceSummary

did

did: string

plat

plat: string

desktop, web, ios or android.

client

client: string

Client software and version, at most 64 characters.

name

name: string

Display name, for example "Chrome · Windows", at most 64 characters.

provider

provider: string

OIDC provider ID the device record was created with (05 §12.2).

authAt

authAt: string

RFC 3339 time of the device session's latest provider sign-in.

Source: wire/device-setup.ts:148

DeviceUpdatedPayload interface

device.updated payload (05 §18).

interface DeviceUpdatedPayload

device

device: DeviceRecord

Source: wire/accounts.ts:720

DiagnosticReport interface

POST /v1/diagnostics request (15 §14.3). The request is idempotent on reportId.

interface DiagnosticReport<D = Record<string, unknown>>

reportId

reportId: string

UUIDv7 chosen by the client.

client

client: string

Product and version, as in session.hello (03).

platform

platform: DiagnosticPlatform

createdAt

createdAt: string

ctx?

ctx?: string

The context, for call kinds.

callId?

callId?: string

The call, for call kinds.

data

data: D

Source: wire/calls.ts:901

DiagnosticsResponse interface

POST /v1/diagnostics response, 202 (15 §14.3).

interface DiagnosticsResponse

reportId

reportId: string

Source: wire/calls.ts:917

DirectDmPlan interface

The requests a client sends to start a 1:1 DM (12 §7.1 steps 3 and 6).

interface DirectDmPlan

host

host: string

The rule host (12 §4.2).

ctx

ctx: DmCtx

The dm: reference (12 §5.2).

security

security: "insecure" | "secure"

The computed security (12 §11.1).

register

register: RegisterDmRequest

POST {home}/v1/me/dms body (step 3).

create

create: CreateDmRequest

POST {host}/v1/dms body (step 6). For a secure DM the caller adds bootstrap and commit from its MLS provider (step 5) before sending.

Source: api/dms.ts:353

DiscoveryErrorEntry interface

One row of the discovery.* error registry (02 §17).

interface DiscoveryErrorEntry

status

readonly status: number

retryable

readonly retryable: boolean

userAction

readonly userAction: "none" | "retry" | "wait" | "sign_in" | "enable_encryption" | "set_up_device" | "update_app" | "contact_admin"

retryAfterMs?

readonly retryAfterMs?: number

Fixed retryAfterMs where 02 §17 gives one.

title

readonly title: string

Short title (plain text).

Source: wire/discovery.ts:425

DiscoveryErrorOptions interface

Options of discoveryError.

interface DiscoveryErrorOptions

detail?

detail?: string

Human-readable detail (plain text).

retryAfterMs?

retryAfterMs?: number | null

Overrides the registry's retryAfterMs (02 §17: dns_failure uses the negative-cache lifetime).

cause?

cause?: unknown

The underlying error.

Source: discovery/errors.ts:19

DiscoveryEvents interface

The discovery.* events a client can receive on its event WebSocket (02 §16, 03 index). discovery.peer_suspended and discovery.peer_resumed reach only accounts with the admin system role; ordinary users never receive them (02 §16.3).

interface DiscoveryEvents

discovery.metadata_changed

discovery.metadata_changed: MetadataChangedPayload

discovery.peer_suspended

discovery.peer_suspended: PeerPin

discovery.peer_resumed

discovery.peer_resumed: PeerResumedPayload

Source: wire/discovery.ts:414

DiscoveryResolverOptions interface

Options of DiscoveryResolver.

interface DiscoveryResolverOptions

mode?

mode?: "web" | "native"

native (02 §5.2: TXT through txt, with the .well-known fallback) or web (02 §5.4: /v1/resolve through home, then DoH through txt if configured). Default: native when txt is given, else web.

txt?

txt?: TxtResolver

The TXT resolver: system DNS for native clients (nodeTxtResolver()), DoH for web clients.

home?

home?: HttpClient | ResolveApi

The home (or, before sign-in, bootstrap) server: its /v1/resolve is the web delegation step (02 §5.4), the no-contact lookup (02 §5.8) and pin recovery (02 §10.6).

homeAuthenticated?

homeAuthenticated?: boolean

Send the session token to /v1/resolve (raises its rate limit). Default true.

homeDomains?

homeDomains?: readonly string[]

Domains of the client's home server: no automatic pin recovery for them (02 §10.6).

fetch?

fetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>

fetch for .well-known and /meta. Default globalThis.fetch.

MDN Reference

clock?

clock?: Clock

random?

random?: () => number

Uniform [0, 1) source for event jitter. Default: CSPRNG.

timers?

timers?: DiscoveryTimers

pins?

pins?: ServerPinStore | null

Pin store (02 §10.6). Null or absent disables pinning.

shouldPin?

shouldPin?: (domain: string) => boolean

Which domains to pin. A client MUST pin every server where it holds a session token and SHOULD pin every server whose keys it uses for DM validation (02 §10.6). Default: all.

publicSuffixList?

publicSuffixList?: PublicSuffixList

The Public Suffix List for same-site evidence (02 §9.1). Default NO_PUBLIC_SUFFIX_LIST (conservative; see its notes).

wellKnownCheck?

wellKnownCheck?: boolean | (domain: string) => boolean

Case W-c of 02 §4.3: fetch .well-known to upgrade a record that would be dns-only. Native clients SHOULD for their home server at sign-in and MAY otherwise. Default false. Without a publicSuffixList, records whose host shares its last two labels with the queried domain might be same-site, and the check is skipped for them (02 §4.3 never consults .well-known for a same-site record).

implementedVersions?

implementedVersions?: readonly string[]

Protocol versions this client implements. Default [PROTOCOL_VERSION].

allowSpecialUse?

allowSpecialUse?: boolean

Development setting for special-use names (02 §5.1). Off by default; never in release builds.

onPinConflict?

onPinConflict?: (info: PinConflictInfo) => void

A pin rejected a change (02 §10.6): report diagnostic to the home server as pin_conflict.

onPinChanged?

onPinChanged?: (info: PinChangeInfo) => void

A pin accepted a change (02 §10.2).

onBackgroundError?

onBackgroundError?: (error: unknown, domain: string) => void

Errors of background refreshes (discovery.metadata_changed).

Source: discovery/resolver.ts:111

DiscoveryResult interface

The output of a successful resolution (02 §5.1). Timestamps are RFC 3339 strings.

interface DiscoveryResult

domain

domain: string

The queried domain D.

baseUrl

baseUrl: string

Normalized base URL.

source

source: DelegationSource

evidence

evidence: DelegationEvidence

canonicalDomain

canonicalDomain: string

The server's canonical domain, verified per 02 §5.3.

metadata

metadata: ServerMetadata

The validated metadata (02 §7.4).

resolvedAt

resolvedAt: string

When the delegation was obtained.

delegationExpiresAt

delegationExpiresAt: string

metadataExpiresAt

metadataExpiresAt: string

stale

stale: boolean

True while a stale copy is being used (02 §13.2), or the home server answered from a stale copy.

pin

pin: PinOutcome

What client pinning did (02 §10.6). updated with a new baseUrl means the pin accepted the move under 02 §10.2, so existing session tokens may follow it (token binding, PD-02-8).

Source: discovery/resolver.ts:55

DiscoveryTimers interface

Timer functions, injectable for tests.

interface DiscoveryTimers

setTimeout

setTimeout(fn: () => void, ms: number): unknown
fn: () => void
ms: number

clearTimeout

clearTimeout(handle: unknown): void
handle: unknown

Source: discovery/resolver.ts:105

DisplayNameMismatchData interface

data of address.display_name_mismatch (01 §6.3).

interface DisplayNameMismatchData

Source: wire/addressing.ts:219

Dm interface

The Dm object kept by the hosting server and returned by GET /v1/dms/{ctx} (12 §6.1).

interface Dm

ctx

ctx: DmCtx

dm:… or gdm:… (12 §5).

kind

kind: DmKind

direct or group.

host

host: string

Canonical domain of the hosting server.

security

security: DmSecurity

Current security mode (12 §11).

state

state: DmState

active, upgrading, encryption_pending or closed (12 §6.2).

closedReason

closedReason: DmClosedReason | null

When state is closed: why. Otherwise null.

participants

participants: DmParticipant[]

Every participant the caller may see (12 §6.3, §6.5).

owner

owner: string | null

Group DMs: the owner's canonical address, or null once the creator has left (D-087). 1:1 DMs: null.

name

name: string | null

Group DMs: the name (1–100 scalar values, ≤ 400 bytes, NFC), or null. 1:1 DMs: always null.

createdBy

createdBy: string

Creator's canonical address.

createdAt

createdAt: string

RFC 3339 timestamp.

groupGeneration

groupGeneration: number

Generation of the current MLS group, the last component of its group_id; 0 while no group exists (12 §11.4, 13).

securitySinceSeq

securitySinceSeq: number

seq of the event at which the current security took effect.

lastSeq

lastSeq: number

Highest seq in the DM's timeline.

replaces

replaces: DmLink | null

The predecessor when this DM is a successor (12 §13), else null.

Source: wire/dms.ts:116

DmAddParticipantsResult interface

The result of POST /v1/dms/{ctx}/participants (12 §12.2).

interface DmAddParticipantsResult

dm

dm: Dm

reserved

reserved: boolean

True for 202 Accepted (secure group): the new people are reserved for 60 s, and the caller MUST submit one MLS commit adding them (13) before the reservation lapses (12 §12.2).

status

status: number

Source: api/dms.ts:715

DmBlock interface

One DM block (12 §9.5).

interface DmBlock

addr

addr: string

Canonical address.

createdAt

createdAt: string

Source: wire/dms.ts:415

DmBlockUpdatedEvent interface

dm.block_updated (12 §16.2).

interface DmBlockUpdatedEvent

addr

addr: string

blocked

blocked: boolean

block

block: DmBlock | null

The DmBlock, or null when unblocked.

Source: wire/dms.ts:633

DmCallLoggedEvent interface

dm.call_logged (12 §16.1, §14.1). A started entry is a content event (12 §2.1).

interface DmCallLoggedEvent

callId

callId: string

The call (15).

phase

phase: DmCallPhase

by

by: string

The caller's address.

video

video: boolean

at

at: string

durationMs?

durationMs?: number

For ended.

answered?

answered?: boolean

For ended.

Source: wire/dms.ts:546

DmCallPolicy interface

What calls a DM allows (12 §14). Every DM can have calls, 1:1 and group, insecure and secure, and in every DM all call media travels through the hosting server's relay or SFU: clients never send media to each other (D-094).

interface DmCallPolicy

calls

calls: boolean

Whether the DM can have calls in its current state.

newJoins

newJoins: boolean

Whether new joins are accepted (upgrading refuses them with dm.upgrade_in_progress).

sfu

sfu: boolean

Whether call control may move the call's video to the SFU (videoRoute sfu) on an SFU-capable server: group DMs only. A 1:1 DM call's media always uses the relay (15 §7.2 item 1, 17 §13.1).

Source: api/dms.ts:647

DmClosedData interface

data of dm.closed (12 §17).

interface DmClosedData

reason

reason: DmClosedReason

successor

successor: DmLink | null

For host_secure, the successor if the hosting server knows it; otherwise null.

Source: wire/dms.ts:761

DmClosedEvent interface

dm.closed (12 §16.1).

interface DmClosedEvent

reason

reason: DmClosedReason

marker

marker: DmMarker | null

K5 or null.

Source: wire/dms.ts:588

DmCreatedEvent interface

dm.created (12 §16.1): sequenced at seq 1.

interface DmCreatedEvent

kind

kind: DmKind

createdBy

createdBy: string

security

security: DmSecurity

participants

participants: string[]

Participant addresses.

name

name: string | null

replaces

replaces: DmLink | null

Source: wire/dms.ts:501

DmCreateResult interface

The result of POST /v1/dms (12 §7.2): 201 when this request created the DM, 200 when it already existed (or was reopened).

interface DmCreateResult

dm

dm: Dm

created

created: boolean

True for 201 Created. A client that sent a bootstrap and gets false joins the existing group (12 §5.3, §7.2 step 4).

status

status: number

Source: api/dms.ts:707

DmEncryptionPendingData interface

data of dm.encryption_pending: the insecure participants (12 §13.2).

interface DmEncryptionPendingData

waitingFor

waitingFor: string[]

Source: wire/dms.ts:756

DmEntryActiveData interface

data of dm.entry_active (12 §17).

interface DmEntryActiveData

state

state: DmIndexEntryState

Source: wire/dms.ts:783

DmEntryUpdatedPayload interface

Payload d of the S2S event dm.entry_updated, hosting server → participant's home (12 §8.6).

interface DmEntryUpdatedPayload

ctx

ctx: DmCtx

recipient

recipient: string

The participant, homed at the receiver.

recipientInc

recipientInc: string

kind

kind: DmKind

security

security: DmSecurity

state

state: DmState

closedReason

closedReason: DmClosedReason | null

name

name: string | null

owner

owner: string | null

replaces

replaces: DmLink | null

participants

participants: DmParticipantSummary[]

yourState

yourState: DmParticipationState

The recipient's own participation state.

yourReason

yourReason: DmParticipantReason | null

The recipient's own reason, if any.

lastSeq

lastSeq: number

lastActivityAt

lastActivityAt: string | null

Timestamp of the latest content event, or null.

Source: wire/dms.ts:285

DmErrorEntry interface

One row of the dm.* error registry (12 §17).

interface DmErrorEntry

status

readonly status: number

retryable

readonly retryable: boolean

userAction

readonly userAction: UserAction

data

readonly data: readonly string[]

The members of data, if any.

Source: wire/dms.ts:686

DmEvents interface

Every dm.* event a client can receive on its event WebSocket, mapped to its payload d: the context events of 12 §16.1 (on a DM's context at the hosting server) and the account events of 12 §16.2 (on me at the home server). All are durable.

interface DmEvents

dm.created

dm.created: DmCreatedEvent

dm.participant_added

dm.participant_added: DmParticipantAddedEvent

dm.participant_removed

dm.participant_removed: DmParticipantRemovedEvent

dm.participant_updated

dm.participant_updated: DmParticipantUpdatedEvent

dm.settings_changed

dm.settings_changed: DmSettingsChangedEvent

dm.call_logged

dm.call_logged: DmCallLoggedEvent

dm.security_eligible

dm.security_eligible: DmSecurityEligibleEvent

dm.security_changed

dm.security_changed: DmSecurityChangedEvent

dm.closed

dm.closed: DmClosedEvent

dm.state_changed

dm.state_changed: DmStateChangedEvent

dm.index_updated

dm.index_updated: DmIndexUpdatedEvent

dm.index_removed

dm.index_removed: DmIndexRemovedEvent

dm.request_received

dm.request_received: DmRequestReceivedEvent

dm.request_resolved

dm.request_resolved: DmRequestResolvedEvent

dm.block_updated

dm.block_updated: DmBlockUpdatedEvent

dm.settings_updated

dm.settings_updated: DmSettingsUpdatedEvent

Source: wire/dms.ts:650

DmHostMismatchData interface

data of dm.host_mismatch (12 §17).

interface DmHostMismatchData

ctx

ctx: string

Source: wire/dms.ts:788

DmIndexEntry interface

One DmIndexEntry, kept by the home server per (account, host, ctx) (12 §9.1).

interface DmIndexEntry

id

id: string

UUIDv7 assigned by the home server.

host

host: string

Canonical domain of the hosting server: the DM's current host (12 §4.5).

ctx

ctx: DmCtx

kind

kind: DmKind

state

state: DmIndexEntryState

Entry state (12 §9.2).

origin

origin: DmIndexOrigin

participants

participants: DmParticipantSummary[]

From the latest dm.request or dm.entry_updated; empty until the first one arrives.

security

security: DmSecurity | null

Last known security mode; null until known.

dmState

dmState: DmState | null

Last known Dm state (12 §6.2).

closedReason

closedReason: DmClosedReason | null

name

name: string | null

inviter

inviter: string | null

Canonical address of the inviter, for incoming entries.

requestId

requestId: string | null

The DmRequest for this entry, if one was filed (12 §10.1).

autoAccept

autoAccept: DmAutoAcceptReason | null

Why the entry was accepted automatically, or null.

hidden

hidden: boolean

The user hid the entry from the DM list.

declinedAt

declinedAt: string | null

When the user declined or blocked, starting the 30-day quiet period; null otherwise.

successor

successor: DmLink | null

The successor once known (12 §13.3).

replaces

replaces: DmLink | null

lastSeq

lastSeq: number

From the latest dm.entry_updated; 0 if unknown.

lastActivityAt

lastActivityAt: string | null

createdAt

createdAt: string

updatedAt

updatedAt: string

pendingEvents?

pendingEvents?: DmForwardedEvent[]

Events from an auto-accepted dm.request not yet fetched by devices. Returned by GET /v1/me/dms/{id} only.

Source: wire/dms.ts:331

DmIndexRemovedEvent interface

dm.index_removed (12 §16.2).

interface DmIndexRemovedEvent

id

id: string

Source: wire/dms.ts:615

DmIndexUpdatedEvent interface

dm.index_updated (12 §16.2): emitted on every change to an entry.

interface DmIndexUpdatedEvent

entry

entry: DmIndexEntry

Without pendingEvents.

Source: wire/dms.ts:609

DmInvalidParticipantsData interface

data of dm.invalid_participants (12 §17).

interface DmInvalidParticipantsData

reason?

reason?: DmInvalidParticipantsReason

addr?

addr?: string

Source: wire/dms.ts:729

DmInviter interface

The inviter of a request: the sender of the dm.request (12 §8.2, §10.1).

interface DmInviter

addr

addr: string

name

name: string

kind

kind: DmParticipantKind

inc

inc: string

Source: wire/dms.ts:216

DmLink interface

A link to another DM, { host, ctx }: a predecessor (replaces) or a successor (12 §6.1, §9.1, §13.3).

interface DmLink

host

host: string

Canonical domain of the hosting server.

ctx

ctx: DmCtx

The DM's context reference.

Source: wire/dms.ts:72

DmNotOwnerData interface

data of dm.not_owner (12 §17).

interface DmNotOwnerData

owner

owner: string

Source: wire/dms.ts:768

DmParticipant interface

One DM participant as the hosting server reports it (12 §6.3), filtered for the caller as 12 §6.5 says: a 1:1 peer that is pending or declined is shown as active; in a group, a participant who declined is shown as left and an expired invitation as removed.

interface DmParticipant

addr

addr: string

Canonical address.

name

name: string

Display name as last known to the hosting server. Clients MUST check it against addr (01).

kind

kind: DmParticipantKind

user or bot; unknown values are treated as bot.

inc

inc: string

The participant's account incarnation (05 §11.1, D-086). A different inc is a different account (12 §6.4).

state

state: DmParticipationState

Participation state (12 §6.3), filtered per 12 §6.5.

role

role: DmParticipantRole

owner or member in group DMs; member in 1:1 DMs.

security

security: DmAccountSecurity

The participant's sec as last verified by the hosting server.

ikf

ikf: string | null

RFC 7638 thumbprint of the identity key when security is secure, else null. Informative: clients use their own pins (07).

addedBy

addedBy: string

Inviter's canonical address (equals addr for the creator).

addedAt

addedAt: string

RFC 3339 timestamp of the latest invitation.

joinedSeq

joinedSeq: number

The first seq this participant may read (12 §12.5).

reason

reason: DmParticipantReason | null

For left and removed: why. Null otherwise.

Source: wire/dms.ts:88

DmParticipantAddedEvent interface

dm.participant_added (12 §16.1).

interface DmParticipantAddedEvent

participant

participant: DmParticipant

Filtered per 12 §6.5.

addedBy

addedBy: string

Source: wire/dms.ts:512

DmParticipantRemovedEvent interface

dm.participant_removed (12 §16.1).

interface DmParticipantRemovedEvent

addr

addr: string

reason

reason: DmParticipantReason

As visible to the receiver (12 §6.5).

by

by: string | null

For removed through 12 §12.3: who removed them; null for every other way of leaving.

Source: wire/dms.ts:519

DmParticipantSummary interface

A participant as carried in dm.request, dm.entry_updated, DmIndexEntry and DmRequest (12 §8.2).

interface DmParticipantSummary

addr

addr: string

name

name: string

kind

kind: DmParticipantKind

inc

inc: string

state

state: DmParticipationState

security

security: DmAccountSecurity

Source: wire/dms.ts:206

DmParticipantUpdatedEvent interface

dm.participant_updated (12 §16.1).

interface DmParticipantUpdatedEvent

addr

addr: string

state

state: DmParticipationState

role

role: DmParticipantRole

Source: wire/dms.ts:528

DmPartySecurity interface

A participant and the sec of the newest valid IdentityState the evaluator holds for it (12 §2.2).

interface DmPartySecurity

addr

addr: string

Canonical address.

sec

sec: DmAccountSecurity

sec(addr); an upgrade_required account is insecure (12 §2.2).

Source: api/dms.ts:173

DmRecipientNotFoundData interface

data of dm.recipient_not_found (12 §17).

interface DmRecipientNotFoundData

addr

addr: string

Source: wire/dms.ts:735

DmRegisterResult interface

The result of POST /v1/me/dms (12 §9.3).

interface DmRegisterResult

entry

entry: DmIndexEntry

created

created: boolean

True for 201 (a new entry), false for 200 (an existing entry, now active).

status

status: number

Source: api/dms.ts:726

DmRelayedServerKey interface

A server key relayed by the home server in DmRequest.serverKeys (12 §10.1): a ServerKey of 02 §11.1, with its purpose and status. 02 owns the object; these are its members.

interface DmRelayedServerKey

kty

kty: "OKP"

crv

crv: "Ed25519"

x

x: string

kid

kid: string

purpose

purpose: string & {} | "sign" | "mls-external-sender"

sign or mls-external-sender; a key with an unknown value is ignored (02 §11.1).

status

status: string & {} | "active" | "revoked" | "next" | "retired"

next, active, retired or revoked; a key with an unknown value is ignored (02 §11.1).

nbf

nbf: number

exp

exp: number

retiredAt?

retiredAt?: number

rvt?

rvt?: number

alg?

alg?: "EdDSA"

Source: wire/dms.ts:432

DmRequest interface

A message request waiting at the recipient's home server (12 §10.1).

interface DmRequest

id

id: string

UUIDv7 assigned by the home server.

entryId

entryId: string

The DmIndexEntry.

host

host: string

ctx

ctx: DmCtx

kind

kind: DmKind

security

security: DmSecurity

name

name: string | null

replaces

replaces: DmLink | null

inviter

inviter: DmInviter

participants

participants: DmParticipantSummary[]

state

state: DmRequestState

createdBy

createdBy: string

events

events: DmForwardedEvent[]

All events received in every batch, in seq order (12 §10.1).

welcome

welcome: string | null

identityStates

identityStates: string[]

Verified IdentityStates (12 §8.4 step 7).

serverKeys

serverKeys: Record<string, DmRelayedServerKey[]>

Server keys the client needs before Accept, keyed by canonical domain (12 §10.1, D-049).

truncated

truncated: boolean

True when more events exist than the request carries.

receivedAt

receivedAt: string

updatedAt

updatedAt: string

expiresAt

expiresAt: string

receivedAt + 90 days.

Source: wire/dms.ts:450

DmRequestNotPendingData interface

data of dm.request_not_pending (12 §17).

interface DmRequestNotPendingData

state

state: DmRequestState

Source: wire/dms.ts:778

DmRequestPayload interface

Payload d of the S2S event dm.request, hosting server → recipient home (12 §8.2).

interface DmRequestPayload

invitationId

invitationId: string

UUIDv7 of this invitation.

batch

batch: number

1 for the first batch, then 2, 3, …

truncated

truncated: boolean

True when the size limit stopped further events (12 §8.3).

ctx

ctx: DmCtx

kind

kind: DmKind

host

host: string

Canonical domain of the hosting server; MUST equal the S2S token's iss (06).

recipient

recipient: string

The invited participant, homed at the receiver.

recipientInc

recipientInc: string

The recipient's incarnation as the hosting server recorded it.

inviter

inviter: DmInviter

createdBy

createdBy: string

The creator's canonical address (12 §8.4 step 3).

participants

participants: DmParticipantSummary[]

Current participants, filtered as 12 §6.5 (the recipient's own entry shows pending).

security

security: DmSecurity

state

state: DmState

name

name: string | null

replaces

replaces: DmLink | null

communityHints?

communityHints?: string[]

Batch 1 only: at most 10 community domains (12 §10.2).

identityStates?

identityStates?: string[]

IdentityState JWSs (07) of secure participants, each at most 24 h old (12 §8.2, §8.3).

welcome

welcome: string | null

Secure DMs: base64url MLSMessage carrying the Welcome for the recipient's devices, in the batch that first follows it; else null.

events

events: DmForwardedEvent[]

Durable events in seq order (12 §8.2).

Source: wire/dms.ts:234

DmRequestReceivedEvent interface

dm.request_received (12 §16.2).

interface DmRequestReceivedEvent

request

request: DmRequestListItem

List form (12 §10.3).

batch

batch: number

Source: wire/dms.ts:620

DmRequestResolvedEvent interface

dm.request_resolved (12 §16.2).

interface DmRequestResolvedEvent

id

id: string

state

state: DmRequestState

Source: wire/dms.ts:627

DmReservationExpiredData interface

data of dm.reservation_expired (12 §17).

interface DmReservationExpiredData

addr

addr: string

Source: wire/dms.ts:773

DmResponsePayload interface

Payload d of the S2S event dm.response, recipient home → hosting server (12 §8.5).

interface DmResponsePayload

ctx

ctx: DmCtx

recipient

recipient: string

The responding participant; MUST be homed at the sender.

recipientInc

recipientInc: string

invitationId

invitationId: string | null

The invitation answered; null for unblock and responses not tied to one invitation. Informative.

action

action: DmResponseAction

at

at: string

When the user (or the auto-accept rule) acted. Responses apply last-writer-wins by at.

Source: wire/dms.ts:272

DmS2SEvents interface

The S2S event types of 12 §16.3 and their payloads. These are server-to-server only (06 §10.1) and never arrive on a client's event WebSocket, so they aren't part of DmEvents.

interface DmS2SEvents

dm.request

dm.request: DmRequestPayload

dm.response

dm.response: DmResponsePayload

dm.entry_updated

dm.entry_updated: DmEntryUpdatedPayload

Source: wire/dms.ts:311

DmSecurityChangedEvent interface

dm.security_changed (12 §16.1).

interface DmSecurityChangedEvent

security

security: DmSecurity

previous

previous: DmSecurity

generation

generation: number

The group generation now in force, or the retired one when becoming insecure.

lastSeqBefore

lastSeqBefore: number

The last seq under the previous mode.

marker

marker: DmMarker

K1 or K2.

cause

cause: DmSecurityChangeCause

Source: wire/dms.ts:575

DmSecurityEligibleEvent interface

dm.security_eligible (12 §16.1, §11.4).

interface DmSecurityEligibleEvent

generation

generation: number

The next group generation.

participants

participants: ({ addr: string; security: DmAccountSecurity })[]

Every current participant.

Source: wire/dms.ts:561

DmSecurityMismatchData interface

data of dm.security_mismatch: the computed security and each participant's sec (12 §7.2 step 7).

interface DmSecurityMismatchData

security

security: DmSecurity

participants

participants: ({ addr: string; sec: DmAccountSecurity })[]

Source: wire/dms.ts:745

DmSettings interface

The account's DmSettings (12 §9.4).

interface DmSettings

autoAccept

autoAccept: DmAutoAcceptSetting

Default contacts_and_communities.

requestNotifications

requestNotifications: boolean

Whether a new message request creates a notification record (19). Default true.

Source: wire/dms.ts:407

DmSettingsChangedEvent interface

dm.settings_changed (12 §16.1): only the changed members among name and owner are present.

interface DmSettingsChangedEvent

name?

name?: string | null

owner?

owner?: string | null

by

by: string | null

Who made the change, or null when the hosting server did (for example owner becoming null).

Source: wire/dms.ts:535

DmSettingsUpdatedEvent interface

dm.settings_updated (12 §16.2).

interface DmSettingsUpdatedEvent

settings

settings: DmSettings

Source: wire/dms.ts:641

DmStateChangedEvent interface

dm.state_changed (12 §16.1).

interface DmStateChangedEvent

state

state: DmState

previous

previous: DmState

reason

reason: DmStateChangeReason

Source: wire/dms.ts:598

DmTooManyParticipantsData interface

data of dm.too_many_participants (12 §17).

interface DmTooManyParticipantsData

max

max: number

Source: wire/dms.ts:740

DmUpgradeInProgressData interface

data of dm.upgrade_in_progress (12 §17).

interface DmUpgradeInProgressData

generation

generation: number

Source: wire/dms.ts:751

DmWarningsInput interface

Inputs to dmWarnings.

interface DmWarningsInput

kind

kind: DmKind

security

security: DmSecurity

state

state: DmState

viewer

viewer: string

The viewer's canonical address.

viewerSec

viewerSec: DmAccountSecurity

The viewer's own sec.

participants

participants: readonly (DmPartySecurity & { state: DmParticipationState })[]

Participants with the sec the client verified (or DmParticipant.security until it has), and their state.

securePinned?

securePinned?: boolean

Group DMs: the client holds a secure-state pin for this group (12 §11.1).

Source: api/dms.ts:601

DmWrongHostData interface

data of dm.wrong_host (12 §4.4, §17).

interface DmWrongHostData

host

host: string

The domain the server computed as the rule host.

ctx?

ctx?: string

Source: wire/dms.ts:718

DnsMessage interface

A decoded DNS response (RFC 1035 §4.1).

interface DnsMessage

id

id: number

flags

flags: { qr: boolean; tc: boolean; ad: boolean; rcode: number }

QR, AA, TC, RD, RA, AD, CD flags and RCODE.

answers

answers: DnsRecord[]

authority

authority: DnsRecord[]

message

message: Uint8Array

Source: discovery/doh.ts:51

DnsRecord interface

One resource record of a decoded DNS message.

interface DnsRecord

name

name: string

type

type: number

class

class: number

ttl

ttl: number

data

data: Uint8Array

The RDATA bytes.

dataOffset

dataOffset: number

Offset of the RDATA in the message (for names compressed against the message).

Source: discovery/doh.ts:39

DohResolverOptions interface

Options of dohTxtResolver.

interface DohResolverOptions

url

url: string

The DoH endpoint URI template's base, for example https://dns.example/dns-query. It must allow CORS for web clients (02 §5.4 step 3). The SDK ships no default resolver.

fetch?

fetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>

fetch implementation. Default: globalThis.fetch.

MDN Reference

attemptTimeoutMs?

attemptTimeoutMs?: number

Per-attempt timeout (02 §3.5: 5 s).

attempts?

attempts?: number

Attempts (02 §3.5: at most 2).

Source: discovery/doh.ts:227

EditContent interface

A complete replacement of a root message's content (11 §3.7.1).

interface EditContent

target

target: string

mid of the root message being edited.

text

text: string

The complete new text.

mentions?

mentions?: string[]

mentionAll?

mentionAll?: boolean

replyTo?

replyTo?: ReplyRef | null

A copy of the root message's replyTo; an edit never changes it.

attachments?

attachments?: AttachmentRef[]

The attachments that remain; each one of the target's, with identical members.

Source: wire/messaging.ts:260

EditEntry interface

The latest edit of a sealed root message (11 §5.3).

interface EditEntry

mid

mid: string

seq

seq: number

sender

sender: Sender

createdAt

createdAt: string

sealed

sealed: SealedMessage

Kind edit, ref the root's mid; plaintext is an EditContent.

mentions

mentions: string[]

The edit's server-validated mention hint.

mentionAll

mentionAll: boolean

attachmentIds?

attachmentIds?: string[]

The IDs that remain bound after this edit, when the root had bound attachments.

Source: wire/messaging.ts:372

EditEvent interface

d of message.edited (11 §8.2).

interface EditEvent

target

target: string

The edited root message.

mid

mid: string

The edit entry's mid.

carrier

carrier: CarrierType

sender

sender: Sender

createdAt

createdAt: string

The new editedAt.

content?

content?: EditContent

plain: the edit.

sealed?

sealed?: SealedMessage

sealed: the edit.

mentions?

mentions?: string[]

sealed: the edit's validated hint.

mentionAll

mentionAll: boolean

attachmentIds?

attachmentIds?: string[]

sealed, when the target had bound attachments: the remaining IDs.

Source: wire/messaging.ts:543

EmitterOptions interface

Options for Emitter.

interface EmitterOptions

onListenerError?

onListenerError?: (error: unknown, type: string) => void

Called when a listener throws. The other listeners still run. Default: rethrow asynchronously (like EventTarget), so the error is reported but the emitting code isn't interrupted.

Source: core/emitter.ts:15

EnableEncryptionRequest interface

Body of PUT /v1/me/identity, turning on encryption (07 §11.4).

interface EnableEncryptionRequest

identityCertificate

identityCertificate: string

New IdentityCertificate with igen = expectedIgen + 1.

deviceCertificate

deviceCertificate: string

The calling device's DeviceCertificate under it.

expectedIgen

expectedIgen: number

The account's current igen, as the client last saw it.

Source: wire/identity.ts:207

EncryptVaultRecordInput interface

Input of encryptVaultRecord.

interface EncryptVaultRecordInput

kVid

kVid: Uint8Array

K_vid (to compute rid and bucket from the plaintext).

kVault

kVault: Uint8Array

The current generation's key.

vgen

vgen: number

igen

igen: number

addr

addr: string

The account's canonical address.

plaintext

plaintext: VaultPlaintext

The plaintext; its t is the record type. Serialized with JSON.stringify.

ifVer

ifVer: number

0 to create, or the current ver to replace. The ciphertext is bound to ifVer + 1.

nonce?

nonce?: Uint8Array<ArrayBufferLike>

random?

random?: RandomSource

Source: api/vault.ts:199

EntryAck interface

The 201 answer to a posted entry, also returned for an idempotent resend (11 §4.6).

interface EntryAck

mid

mid: string

kind

kind: EntryKind

seq

seq: number

The seq assigned.

createdAt

createdAt: string

The server timestamp.

Source: wire/messaging.ts:338

Envelope interface

One WebSocket message (03 §6.1, 00 §7.4). T is the message or event type, D the payload type defined by the owner of t.

interface Envelope<T extends string = string, D = unknown>

v

v: 1

Envelope version, 1.

t

t: T

Message or event type, <area>.<name> (03 §11.1), or error.

id

id: string

UUIDv7 of this envelope; fixed for a durable event across deliveries and replays.

re?

re?: string

On replies (and on session.pong from a client): the id being answered.

ctx?

ctx?: StreamName

On events: the stream the event belongs to (03 §8.3). Absent on control messages.

seq?

seq?: number

On durable events only: the event's sequence number in its stream, 1 to 2^53 − 1 (03 §7).

ts?

ts?: string

Server timestamp (03 §9). Required from the server, optional and ignored from clients.

d

d: D

The payload; {} when there is nothing to carry.

Source: wire/transport.ts:244

EpochAck interface

EpochAck, the mls.epoch_ack message posted to POST …/mls/epoch-ack (13 §7.8).

interface EpochAck

epoch

epoch: number

The newest epoch the device has fully processed.

ekid

ekid: string

ekid(epoch) as the device computed it (14 §3.2).

extPub

extPub: string

base64url SHA-256 of the external_pub public key the device derived for that epoch.

Source: wire/mls.ts:513

EpochAckResult interface

200/202 answer of POST …/mls/epoch-ack (13 §7.8). Unknown status: treat as match.

interface EpochAckResult

epoch

epoch: number

status

status: EpochAckStatus

Source: wire/mls.ts:523

EpochReadyRequest interface

POST /v1/contexts/{ctx}/call/epoch-ready request (15 §3.7).

interface EpochReadyRequest

callId

callId: string

epoch

epoch: number

The MLS epoch whose SFrame receive and send keys this device has installed (18).

Source: wire/calls.ts:555

EpochSwitchInput interface

Inputs of decideEpochSwitch (15 §9.3).

interface EpochSwitchInput

mediaEpoch

mediaEpoch: number

The call's current mediaEpoch.

pending

pending: readonly ({ epoch: number; sequencedAt: number })[]

Epochs higher than mediaEpoch the Delivery Service has sequenced, with when their commit was sequenced.

seats

seats: readonly ({ pid: number; state: string })[]

Every seat with its state.

hasLeaf

hasLeaf: (pid: number, epoch: number) => boolean

Whether the seat's device has a leaf in epoch (devices removed by commits up to epoch don't).

readyEpoch

readyEpoch: (pid: number) => number | undefined

The highest epoch each seat has posted in call.epoch_ready.

now

now: number

Source: calls/lease.ts:287

ErrorRegistryEntry interface

A registry entry: one status, one retryable value and one userAction per code (03 §10.4 rule 2).

interface ErrorRegistryEntry

status

readonly status: number

The HTTP status (for session.*, the status member value, 03 §10.6).

retryable

readonly retryable: boolean | "varies"

retryable; 'varies' where the entry makes it depend on a stated condition (03 §10.4 rule 2).

userAction

readonly userAction: "none" | "retry" | "wait" | "sign_in" | "enable_encryption" | "set_up_device" | "update_app" | "contact_admin"

userAction.

Source: wire/transport.ts:178

EventBatchRequest interface

POST /v1/federation/events request body: 1–100 events from one origin to one destination (06 §9.3).

interface EventBatchRequest

events

events: S2SEvent<string, Record<string, unknown>>[]

Source: wire/federation.ts:392

EventBatchResponse interface

POST /v1/federation/events 200 response body: one result per request event, same order (06 §9.3).

interface EventBatchResponse

results

results: EventResult[]

Source: wire/federation.ts:417

EventInvalidData interface

data of the per-event federation.event_invalid (06 §16, §9.4).

interface EventInvalidData

detail

detail: string

Source: wire/federation.ts:713

EventMap interface

Every event type a client can receive on its event WebSocket, mapped to the type of its payload d (03 §6.1, §11.3). The session.* control messages and error (03 §5, §6.3) come from 03; every other type comes from the document that registers it (03 §11.2):

A receiver ignores unknown types (00 §7.8, 03 §12.3); use EventSocket.onAny to see them.

interface EventMap extends SessionEvents, DiscoveryEvents, AccountEvents, FederationEvents, IdentityEvents, DeviceSetupEvents, CommunityEvents, ModerationEvents, MessagingEvents, DmEvents, MlsEvents, HistoryEvents, CallEvents, MediaEvents, NotificationEvents

account.updated

account.updated: AccountUpdatedPayload

account.deleted

account.deleted: AccountDeletedPayload

auth.provider_linked

auth.provider_linked: ProviderLinkedPayload

auth.provider_unlinked

auth.provider_unlinked: ProviderUnlinkedPayload

device.added

device.added: DeviceAddedPayload

device.updated

device.updated: DeviceUpdatedPayload

bot.created

bot.created: BotPayload

bot.updated

bot.updated: BotPayload

bot.deleted

bot.deleted: BotDeletedPayload

call.state

call.state: CallStateEvent

call.started

call.started: CallStartedEvent

call.participant_joined

call.participant_joined: CallParticipantJoinedEvent

call.participant_updated

call.participant_updated: CallParticipantUpdatedEvent

call.participant_left

call.participant_left: CallParticipantLeftEvent

call.ended

call.ended: CallEndedEvent

call.ring_updated

call.ring_updated: CallRingUpdatedEvent

call.tick

call.tick: LeaseSnapshot

call.lease_changed

call.lease_changed: VoiceLease

call.epoch_switch

call.epoch_switch: CallEpochSwitchEvent

call.route_changed

call.route_changed: CallRouteChangedEvent

call.moved

call.moved: CallMovedEvent

call.migrate

call.migrate: CallMigrateEvent

call.ringing

call.ringing: CallRingingEvent

call.ring_ended

call.ring_ended: CallRingEndedEvent

sfu.offer

sfu.offer: SfuOfferEvent

sfu.tracks_changed

sfu.tracks_changed: SfuTracksChangedEvent

sfu.closed

sfu.closed: SfuClosedEvent

community.updated

community.updated: CommunityUpdatedEvent

community.security_changed

community.security_changed: CommunitySecurityChangedEvent

community.layout_changed

community.layout_changed: CommunityLayout

community.list_changed

community.list_changed: CommunityListChangedEvent

member.joined

member.joined: WithheldPayload | MemberJoinedEvent

member.left

member.left: WithheldPayload | MemberLeftEvent

member.removed

member.removed: WithheldPayload | MemberRemovedEvent

member.updated

member.updated: WithheldPayload | MemberUpdatedEvent

member.requested

member.requested: MemberRequestedEvent

member.rejected

member.rejected: MemberRejectedEvent

channel.created

channel.created: WithheldPayload | ChannelCreatedEvent

channel.updated

channel.updated: WithheldPayload | ChannelUpdatedEvent

channel.security_changed

channel.security_changed: ChannelSecurityChangedEvent | WithheldPayload

channel.deleted

channel.deleted: ChannelDeletedEvent | WithheldPayload

invite.created

invite.created: InviteCreatedEvent

invite.revoked

invite.revoked: InviteRevokedEvent

pairing.requested

pairing.requested: PairingSession

pairing.updated

pairing.updated: PairingSession

pairing.message

pairing.message: PairingMessageEvent

backup.updated

backup.updated: BackupUpdatedEvent

vault.changed

vault.changed: VaultChangedEvent

vault.rotation_needed

vault.rotation_needed: VaultRotationNeededEvent

vault.key_rotated

vault.key_rotated: VaultKeyRotatedEvent

vault.grant_needed

vault.grant_needed: VaultGrantNeededEvent

discovery.metadata_changed

discovery.metadata_changed: MetadataChangedPayload

discovery.peer_suspended

discovery.peer_suspended: PeerPin

discovery.peer_resumed

discovery.peer_resumed: PeerResumedPayload

dm.created

dm.created: DmCreatedEvent

dm.participant_added

dm.participant_added: DmParticipantAddedEvent

dm.participant_removed

dm.participant_removed: DmParticipantRemovedEvent

dm.participant_updated

dm.participant_updated: DmParticipantUpdatedEvent

dm.settings_changed

dm.settings_changed: DmSettingsChangedEvent

dm.call_logged

dm.call_logged: DmCallLoggedEvent

dm.security_eligible

dm.security_eligible: DmSecurityEligibleEvent

dm.security_changed

dm.security_changed: DmSecurityChangedEvent

dm.closed

dm.closed: DmClosedEvent

dm.state_changed

dm.state_changed: DmStateChangedEvent

dm.index_updated

dm.index_updated: DmIndexUpdatedEvent

dm.index_removed

dm.index_removed: DmIndexRemovedEvent

dm.request_received

dm.request_received: DmRequestReceivedEvent

dm.request_resolved

dm.request_resolved: DmRequestResolvedEvent

dm.block_updated

dm.block_updated: DmBlockUpdatedEvent

dm.settings_updated

dm.settings_updated: DmSettingsUpdatedEvent

federation.session_ended

federation.session_ended: SessionEndedPayload

history.shared

history.shared: HistorySharedEvent

identity.changed

identity.changed: IdentityChangedEvent

device.revoked

device.revoked: DeviceRevokedEvent

identity.refresh_hint

identity.refresh_hint: IdentityRefreshHintEvent

message.created

message.created: WithheldPayload | MessageCreatedEvent

message.edited

message.edited: WithheldPayload | EditEvent | WithheldTargetPayload

message.deleted

message.deleted: WithheldPayload | DeleteEvent

message.purged

message.purged: PurgeEvent

reaction.added

reaction.added: WithheldPayload | WithheldTargetPayload | ReactionAddedEvent

reaction.removed

reaction.removed: WithheldPayload | ReactionRemovedEvent

read.updated

read.updated: ReadState

typing.started

typing.started: TypingEvent

typing.stopped

typing.stopped: TypingEvent

presence.updated

presence.updated: Presence

presence.snapshot

presence.snapshot: PresenceSnapshot

mls.group_created

mls.group_created: MlsGroupCreatedEvent

mls.handshake

mls.handshake: MlsHandshakeEvent

mls.proposal

mls.proposal: MlsProposalEvent

mls.group_retired

mls.group_retired: MlsGroupRetiredEvent

mls.commit_needed

mls.commit_needed: MlsCommitNeededEvent

mls.welcome

mls.welcome: MlsWelcomeEvent

mls.resync_required

mls.resync_required: MlsResyncRequiredEvent

mls.keypackages_low

mls.keypackages_low: MlsKeyPackagesLowEvent

role.created

role.created: RoleEvent

role.updated

role.updated: RoleEvent

role.deleted

role.deleted: RoleDeletedEvent

role.reordered

role.reordered: RoleReorderedEvent

role.member_added

role.member_added: RoleMemberEvent

role.member_removed

role.member_removed: RoleMemberEvent

permission.overwrite_set

permission.overwrite_set: OverwriteSetEvent

permission.overwrite_removed

permission.overwrite_removed: OverwriteRemovedEvent

permission.changed

permission.changed: PermissionChangedEvent

moderation.applied

moderation.applied: ModerationAppliedEvent

moderation.lifted

moderation.lifted: ModerationLiftedEvent

moderation.server_mute_changed

moderation.server_mute_changed: ServerMuteChangedEvent

moderation.policy_updated

moderation.policy_updated: PolicyUpdatedEvent

moderation.logged

moderation.logged: ModerationLoggedEvent

report.created

report.created: ReportCreatedEvent

report.updated

report.updated: ReportUpdatedEvent

report.resolved

report.resolved: ReportResolvedEvent

notify.triggered

notify.triggered: NotifyTriggered

notification.created

notification.created: NotificationCreated

notification.updated

notification.updated: NotificationUpdated

notification.state_changed

notification.state_changed: NotificationStateChanged

notification.settings_changed

notification.settings_changed: NotificationSettingsChanged

push.registration_removed

push.registration_removed: PushRegistrationRemoved

session.ready

session.ready: SessionReady

session.subscribed

session.subscribed: SessionSubscribed

session.unsubscribed

session.unsubscribed: SessionUnsubscribed

session.subscription_ended

session.subscription_ended: SessionSubscriptionEnded

session.heads

session.heads: SessionHeads

session.ping

session.ping: SessionPing

session.pong

session.pong: SessionPong

session.closing

session.closing: SessionClosing

session.reauthed

session.reauthed: SessionReauthed

session.resync_required

session.resync_required: SessionResyncRequired

error

error: Problem

Source: wire/events.ts:56

EventResult interface

One EventResult (06 §9.3).

interface EventResult

id

id: string

The event's id.

status

status: EventResultStatus

error?

error?: Problem

Problem object; present when rejected, MAY be present with deferred.

retryAfterMs?

retryAfterMs?: number

With deferred: the earliest useful retry.

Source: wire/federation.ts:406

EventSocketCloseOptions interface

Options for EventSocket.close ("the app no longer needs this server, or the user signs out", 03 §5.3).

interface EventSocketCloseOptions

discardPositions?

discardPositions?: boolean

Discard every stream position: the user signed out or the account was deleted (03 §7.3 rule 5).

Source: events/socket.ts:259

EventSocketDiagnostic interface

A diagnostic record. Never contains tokens (03 §3.2 rule 7).

interface EventSocketDiagnostic

message

message: string

data?

data?: Record<string, unknown>

Source: events/socket.ts:160

EventSocketLifecycleEvents interface

SDK-level events of an EventSocket, separate from the wire events.

interface EventSocketLifecycleEvents

state

state: { state: EventSocketState; previous: EventSocketState }

The client state changed (03 §5.3).

resync

resync: ResyncRequest

A stream needs a resync: see ResyncRequest (03 §7.5).

subscription_refused

subscription_refused: { stream: StreamName; level: SubscriptionLevel; problem: Problem | null }

A subscription was refused; show the problem's userAction if the user is looking at it (03 §5.6).

stopped

stopped: { reason: EventSocketStopReason; problem: Problem | null; code: number | null }

The socket stopped and won't reconnect by itself; connect() starts it again.

disconnected

disconnected: { code: number; reason: string; closing: SessionClosing | null; initiatedBy: "server" | "client" }

A socket closed, by the server or by this client.

reconnect_scheduled

reconnect_scheduled: { delayMs: number; attempt: number; code: number }

A reconnect is scheduled (03 §5.11).

reconnecting

reconnecting: { reconnecting: boolean }

Whether to show the small "Reconnecting…" status line: true only after 5 s without a ready socket, false once ready again (03 §5.11 item 5). Never a dialog.

reauth_failed

reauth_failed: { problem: Problem }

session.reauth was refused; the current deadline stands (03 §5.13 item 3).

slow_consumer

slow_consumer: { movedToHeads: CtxRef[] }

After 4011, streams moved to heads before reconnecting (03 §7.6).

diagnostic

diagnostic: EventSocketDiagnostic

Something worth recording (03 §5.10, §7.3, §7.5).

Source: events/socket.ts:167

EventSocketOptions interface

Options for EventSocket.

interface EventSocketOptions

baseUrl

baseUrl: string

The server's base URL (https://…, no trailing slash, 03 §2.1). The socket is at {base}/v1/events with wss (03 §5.1).

tokens

tokens: TokenProvider

The client session's credentials; its token goes in session.hello and session.reauth (03 §5.4, §5.13).

onTransportFailure?

onTransportFailure?: () => void

Called when a connection attempt fails before the handshake completes (connection refused, TLS or network failure): a 02 §13.4 trigger to refresh the server's delegation, which is how a server move is found.

client

client: string

Product and version, 1 to 128 printable ASCII characters, e.g. my-bot/1.0 (03 §5.4).

features?

features?: readonly string[]

Features the client supports, at most 64 (03 §5.4, §12.2). Default none.

protocol?

protocol?: string

The protocol version the client implements (03 §12.1). Default PROTOCOL_VERSION.

subscribe?

subscribe?: readonly StreamName[]

Streams to follow at level full from the start (resumed if a position is known). me is always followed.

heads?

heads?: readonly CtxRef[]

Context references to follow at level heads from the start (03 §5.7).

foreground?

foreground?: boolean

Initial foreground state (03 §5.8). Default false; a client with a visible UI MUST send true when visible.

seqStore?

seqStore?: SeqStore

Where stream positions are kept (03 §7.3). Default: in memory.

limits?

limits?: ServerLimits | null

ServerMetadata limits (02): maxEventBytes and maxSubscriptions are used; absent limits take their floors (03 §16.1 rule 3).

WebSocket?

WebSocket?: WebSocketConstructor

The WebSocket constructor. Default: the global WebSocket.

clock?

clock?: Clock

The device clock. Default Date.now.

serverClock?

serverClock?: ServerClock

A server clock to calibrate from envelope ts (03 §2.3 item 4) and to compare authExpiresAt with. Default: one built on clock.

timers?

timers?: Timers

Timers. Default: the global setTimeout/clearTimeout.

random?

random?: () => number

Uniform [0, 1) source for reconnect jitter. Default: CSPRNG.

newId?

newId?: () => string

Generator of envelope ids (UUIDv7, 03 §6.1). Default: a monotonic UUIDv7 generator on the server clock.

isSingleInstance?

isSingleInstance?: () => boolean

Whether this process knows that no other instance of the client is running for this client session (web: it holds the Web Locks lock or SharedWorker leadership; desktop and mobile: a single-instance lock). Only then does it reconnect silently once after 4010 (03 §5.12 item 3). Default: can't tell.

isViewing?

isViewing?: (ctx: CtxRef) => boolean

Whether the user is viewing a context; after 4011 streams that aren't viewed move to heads (03 §7.6).

checkMeta?

checkMeta?: (signal: AbortSignal) => Promise<MetaCheckResult>

Read {base}/meta and apply versions and minClient (03 §5.1 item 5, §12.1, §12.4, 02 §7.4). Called before the first connection and after every 3 consecutive handshake failures. A rejection counts as "unknown" and the socket keeps backing off.

messageRate?

messageRate?: { messages: number; windowMs: number }

Client-to-server message budget. Default 20 messages per 10 s, the floor a server MUST accept (03 §7.6, §15.3); session.pong never counts.

Source: events/socket.ts:197

EventTicketRef interface

An event ticket (19 §4.7): bearer credential for GET {host}/v1/me/notifications/events.

interface EventTicketRef

token

token: string

At most 64 base64url characters, optionally prefixed such as et_.

expiresAt

expiresAt: string

72 h after issue.

Source: wire/notifications.ts:111

EventTooLargeData interface

data of the per-event federation.event_too_large (06 §16): the destination's maxFederationEventBytes.

interface EventTooLargeData

limit

limit: number

Source: wire/federation.ts:718

EvidenceInput interface

Inputs of classifyEvidence.

interface EvidenceInput

domain

domain: string

The queried domain D.

source

source: DelegationSource

Where the delegation came from.

host

host: string

The host H of the base URL.

dnssecSecure?

dnssecSecure?: boolean

The TXT answer, including every CNAME in the chain, was validated Secure by a resolver the verifier trusts (02 §3.5). Ignored for web clients, which never record dnssec.

wellKnownConfirmed?

wellKnownConfirmed?: boolean

Case W-c of 02 §4.3: the .well-known document named the same normalized base URL.

web?

web?: boolean

True for a web client (02 §5.4 step 3): never dnssec.

psl?

psl?: PublicSuffixList

The Public Suffix List; default NO_PUBLIC_SUFFIX_LIST.

Source: discovery/evidence.ts:174

ExecuteWebhookRequest interface

The body of POST /v1/contexts/{ctx}/webhooks/{id}/messages (11 §15.4).

interface ExecuteWebhookRequest

mid?

mid?: string

A UUIDv7 for idempotency; without it the request isn't idempotent.

content

content: WebhookContent

Source: wire/messaging.ts:828

ExpectedAuthorizationResponse interface

What the client expects on the redirect back (05 §6.6).

interface ExpectedAuthorizationResponse

state

state: string

The state the client sent.

issuer

issuer: string

The base URL it started with: the authorization server's issuer (05 §3.3).

Source: auth/oauth.ts:383

ExtendSessionRequest interface

POST /v1/federation/sessions/current/extend request body (06 §6.6).

interface ExtendSessionRequest

reason

reason: "home_unreachable"

Source: wire/federation.ts:231

ExtensionLimitData interface

data of federation.extension_limit (06 §16).

interface ExtensionLimitData

extendableUntil

extendableUntil: string

Source: wire/federation.ts:703

ExternalSender interface

One ExternalSender (RFC 9420 §12.1.8.1) with a basic credential (13 §6.2).

interface ExternalSender

signatureKey

signatureKey: Uint8Array

Raw 32-byte Ed25519 public key.

credentialType

credentialType: number

Credential type; basic (0x0001) in sv1.

identity

identity: string

For basic: the identity, "<canonical-domain>#<keyId>" in sv1.

Source: mls/provider.ts:385

ExternalSenderKeyInfo interface

A hosting-server key with purpose mls-external-sender, as the client knows it from ServerMetadata (02).

interface ExternalSenderKeyInfo

keyId

keyId: string

The key ID (the part after #).

publicKey

publicKey: Uint8Array

Raw 32-byte Ed25519 public key.

status

status: string & {} | "active" | "revoked" | "next" | "retired"

ServerMetadata status.

Source: mls/provider.ts:425

ExtractedMentions interface

What the tokens of a text say (11 §3.4).

interface ExtractedMentions

mentions

mentions: string[]

Distinct addresses of user-mention tokens, in order of first appearance.

mentionAll

mentionAll: boolean

Whether <@everyone> appears outside code.

channels

channels: string[]

Distinct addresses of channel references.

Source: content.ts:393

FeatureEntry interface

Registry entry of a feature (03 §12.2).

interface FeatureEntry

owner

readonly owner: string

servers

readonly servers: "mandatory" | "optional"

clients

readonly clients: string

meaning

readonly meaning: string

Source: wire/transport.ts:675

FederationBlock interface

A federation block (06 §12.2).

interface FederationBlock

domain

domain: string

The blocked server's canonical domain, or the domain as entered (lowercase A-label) if it couldn't be resolved.

resolved

resolved: boolean

Whether domain is a canonical domain obtained from discovery.

includeSubdomains

includeSubdomains: boolean

When true, the block also covers every domain ending with "." + domain.

note?

note?: string

Private administrator note, at most 500 characters. Never sent to any peer.

createdAt

createdAt: string

createdBy

createdBy: string

Canonical address of the administrator.

Source: wire/federation.ts:529

FederationDomainData interface

data of federation.blocked, federation.issuer_unreachable and federation.home_unreachable (06 §16).

interface FederationDomainData

domain?

domain?: string

The peer's (or home's) canonical domain, when known.

discovery?

discovery?: string

For issuer_unreachable: the 02 code of the failed resolution.

Source: wire/federation.ts:695

FederationEvents interface

Federation events a client receives on its event WebSocket (06 §17.2). The S2S event types of 06 §10.1 never reach a client and are left out; those that are also client events (identity.changed, account.deleted, …) belong to their owners' maps.

interface FederationEvents

federation.session_ended

federation.session_ended: SessionEndedPayload

Source: wire/federation.ts:732

FederationKeyPackageClaim interface

Body of the S2S POST /v1/federation/keypackages/claim (13 §9.5; unnamed in the spec). Server-to-server only, authenticated with sv-s2s+jwt (06); typed here, not called by the SDK.

interface FederationKeyPackageClaim

claimant

claimant: string

Canonical address of the claimant; its domain MUST equal the token's iss.

purpose

purpose: KeyPackageClaimPurpose

ctx?

ctx?: string

claimId?

claimId?: string

targets

targets: KeyPackageClaimTarget[]

Source: wire/mls.ts:638

FederationPolicy interface

The federation policy (06 §12.2).

interface FederationPolicy

allows

allows: string[]

Canonical domains federated with in allowlist mode; empty in open mode.

blockCount

blockCount: number

Number of FederationBlocks.

Source: wire/federation.ts:547

FetchEventsOptions interface

Options of NotificationsApi.fetchEvents (19 §8.6, §13.1).

interface FetchEventsOptions extends RequestOptions

hostApi?

hostApi?: string

The hosting server's base URL: the record's hostApi, or the app's own discovery result for host, which it SHOULD prefer (19 §13.1). Omit it when this API's client is the hosting server's.

timeoutMs?

timeoutMs?: number

Per-attempt timeout; extensions use 5,000 ms (19 §13.8).

signal?

signal?: AbortSignal

Cancels the request and any automatic retry (03 §2.7 item 3).

idempotencyKey?

idempotencyKey?: string

Sent as Idempotency-Key (03 §14.2). Create calls with a client-generated ID (mid) don't need it.

Source: api/notifications.ts:64

FetchHttpClientOptions interface

Options for FetchHttpClient.

interface FetchHttpClientOptions

baseUrl

baseUrl: string

The server's base URL from discovery (02): https, no query or fragment. A trailing slash is removed.

tokens?

tokens?: TokenProvider | null

Credentials for auth: 'session' requests. Without one, such requests carry no Authorization.

fetch?

fetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>

fetch implementation. Default: globalThis.fetch.

MDN Reference

clock?

clock?: Clock

Clock used for Retry-After dates. Default: the device clock.

sleep?

sleep?: Sleep

Sleep used between retries. Default: setTimeout.

random?

random?: () => number

Uniform [0, 1) source for retry jitter. Default: CSPRNG.

serverClock?

serverClock?: ServerClock

Receives each response's Date header to estimate the clock offset to this server (03 §2.3 item 4).

userAgent?

userAgent?: string

User-Agent as <product>/<version> (03 §2.3 item 6). Sent only outside browsers, including Web, Shared and Service Workers: there it would be ignored or break the CORS preflight (03 §4).

timeoutMs?

timeoutMs?: number

Per-attempt timeout (03 §2.3 item 5). Default 30 s.

maxAttempts?

maxAttempts?: number

Maximum attempts of one request, the first included (03 §2.7). Default 5.

headers?

headers?: Record<string, string>

Extra headers on every request, such as Accept-Language. Authorization isn't allowed here.

onResponse?

onResponse?: (info: ResponseInfo) => void

Called for every response read, including errors and redirects that were followed.

allowInsecureHttp?

allowInsecureHttp?: boolean

Allow http: URLs. Non-conforming (03 §2.2 item 1: HTTPS only); for local test servers only.

onTransportFailure?

onTransportFailure?: (info: { kind: "network" | "not_found"; status: number | null }) => void

Called for the failures 02 §13.4 lists as refresh triggers on this base URL: a network or TLS failure (not a timeout or an abort), and a 404 or 410 without a problem object under {base}/. A client wires it to DiscoveryResolver.refreshAfterFailure, which is how a server move is found.

homeServer?

homeServer?: boolean

Whether this server is the account's home server (00 §3). Default: true unless tokens is a remote session. On any other server a problem whose userAction is sign_in is reported with userAction: 'wait', because only the home server's answer may lead to the sign-in screen (03 §10.2 scope rules 1 and 2); the server's own value stays in error.problem.userAction. SloppyVoiceClient sets it for every server client, anonymous ones included.

Source: core/http.ts:459

FetchMetadataOptions interface

Options of fetchMetadata.

interface FetchMetadataOptions

fetch?

fetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>

MDN Reference

signal?

signal?: AbortSignal

domain?

domain?: string

The queried domain, for error data.

etag?

etag?: string | null

A known ETag, sent as If-None-Match.

noCache?

noCache?: boolean

Bypass caches: sends Cache-Control: no-cache (02 §13.5).

corsSafe?

corsSafe?: boolean

Web clients (02 §5.4): keep the request CORS-simple apart from If-None-Match. Cache-Control isn't a CORS-safelisted request header and isn't in the Access-Control-Allow-Headers that servers must send (00 §7.3, 03 §4), so a browser's preflight for it would fail. With this set, a cache bypass uses the fetch cache: "no-cache" mode instead, which makes the browser revalidate (it sends Cache-Control: max-age=0 itself). Runtimes whose Request doesn't support that mode have no CORS and get the header.

nowMs?

nowMs?: number

Source: discovery/fetch.ts:192

FetchTokenRequestOptions interface

Options of the calls a notification extension makes (19 §9.3, §13.1): a fetch token instead of the session, and the per-request timeout of 19 §13.8 (5 s).

interface FetchTokenRequestOptions extends RequestOptions

fetchToken?

fetchToken?: string

The registration's fetch token (19 §9.3), sent as Authorization: Bearer. It is accepted only by NotificationsApi.get and by NotificationsApi.markRead with the ids selector; an invalid one gives 401 core.unauthenticated (no session recovery runs).

timeoutMs?

timeoutMs?: number

Per-attempt timeout; extensions use 5,000 ms (19 §13.8).

signal?

signal?: AbortSignal

Cancels the request and any automatic retry (03 §2.7 item 3).

idempotencyKey?

idempotencyKey?: string

Sent as Idempotency-Key (03 §14.2). Create calls with a client-generated ID (mid) don't need it.

Source: api/notifications.ts:52

FetchWellKnownOptions interface

Options of fetchWellKnown.

interface FetchWellKnownOptions

fetch?

fetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>

MDN Reference

signal?

signal?: AbortSignal

nowMs?

nowMs?: number

Clock for Expires (Unix ms).

corsBlockedIsAbsent?

corsBlockedIsAbsent?: boolean

Web clients on the DoH path (02 §5.4 step 3): a document CORS blocks is treated as absent. Browsers report a CORS block as a network error, so every network error counts as absent.

Source: discovery/fetch.ts:87

FileReportItem interface

One item of a POST /v1/reports body (10 §10.3).

interface FileReportItem

mid

mid: string

role

role: "reported" | "context"

kMsg?

kMsg?: string

Secure contexts: the revealed K_msg, base64url.

sealed?

sealed?: Record<string, unknown>

The reporter's own copy of a sealed message the server no longer stores (14 §13.3).

credential?

credential?: ReportCredential

Only in 10 §10.10 reports.

attachments?

attachments?: ({ attachmentId: string; fileKey?: string })[]

Source: wire/moderation.ts:558

FileReportRequest interface

Body of POST /v1/reports (10 §10.3).

interface FileReportRequest

ctx

ctx: CtxRef | string & {} | null

host?

host?: string

For 10 §10.10 reports: the hosting server's canonical domain.

requestId?

requestId?: string

For a message-request report: the request (12) at the reporter's home server.

kind

kind: "member" | "messages"

category

category: KnownReportCategory

target?

target?: string

For member reports and 10 §10.10 reports.

did?

did?: string

Only for kind: member with category: impersonation.

note?

note?: string

routing?

routing?: "moderators" | "admins"

Default moderators.

includeContext?

includeContext?: boolean

Default true.

allowForward?

allowForward?: boolean

Default true.

items?

items?: FileReportItem[]

For messages: 1 to maxReportItems reported items, at most 10 context items each side.

Source: wire/moderation.ts:571

ForbiddenData interface

data of core.forbidden (03 §10.5, 10 §6.3).

interface ForbiddenData

permission?

permission?: string

The registry permission that was missing.

ctx?

ctx?: string

The context in which it was checked.

missingRole?

missingRole?: string

A required system role, admin when 10's admin role is needed.

Source: wire/transport.ts:110

ForwardReportResponse interface

Response of POST /v1/reports/{id}/forward (202, 10 §10.8).

interface ForwardReportResponse

forwardedTo

forwardedTo: string[]

Source: wire/moderation.ts:620

GatewayPushRequest interface

Body of POST {gatewayUrl}/v1/push (19 §11.3): 1–100 pushes, ≤ 256 KiB. Server side.

interface GatewayPushRequest

pushes

pushes: PushRequest[]

Source: wire/notifications.ts:598

GatewayPushResponse interface

Response of POST {gatewayUrl}/v1/push (19 §11.3).

interface GatewayPushResponse

results

results: PushResult[]

Source: wire/notifications.ts:615

GatewayRegisterRequest interface

Body of POST {gatewayUrl}/v1/register (19 §11.2). Unauthenticated; called by the app.

interface GatewayRegisterRequest

platform

platform: GatewayPlatform

appId

appId: string

Bundle ID (APNs) or package name (FCM), 1–255 characters.

environment?

environment?: GatewayEnvironment

Required for apns and apns_voip.

token

token: string

APNs device token as lowercase hex, or the FCM registration token. At most 4,096 characters.

home

home: string

Canonical domain of the account's home server.

Source: wire/notifications.ts:566

GatewayRegisterResponse interface

Response of POST {gatewayUrl}/v1/register (19 §11.2).

interface GatewayRegisterResponse

pushKey

pushKey: string

1–1,024 characters from ALPHA / DIGIT / "-" / "." / "_" / "~".

Source: wire/notifications.ts:579

GetCallResponse interface

GET /v1/contexts/{ctx}/call response (15 §3.2).

interface GetCallResponse

call

call: Call | null

Source: wire/calls.ts:475

GroupBootstrap interface

GroupBootstrap (13 §7.4): the normative object for creating a group, also embedded as bootstrap by 09's channel-upgrade PATCH and 12's POST /v1/dms.

interface GroupBootstrap

generation

generation: number

MUST equal the context's current generation, in state none.

groupInfo

groupInfo: string

Epoch-0 GroupInfo with ratchet_tree (one leaf, index 0) and external_pub (base64url).

ekid

ekid: string

ekid(0) computed by the creator (14 §3.2).

Source: wire/mls.ts:393

GroupDmPlan interface

The request a client sends to start a group DM (12 §7.1 step 6). Registration follows creation, with the ctx from the response.

interface GroupDmPlan

host

host: string

host_group(…) (12 §4.3).

security

security: "insecure" | "secure"

create

create: CreateDmRequest

POST {host}/v1/dms body. Send it with an Idempotency-Key (12 §7.2).

Source: api/dms.ts:404

GroupDmSecPin interface

A group DM secure-state pin (09 §13.2; semantics 12 §11.1).

interface GroupDmSecPin

t

t: "sec_pin"

kind

kind: "group_dm"

host

host: string

ctx

ctx: `gdm:${string}`

The gdm: reference.

firstSeenAt

firstSeenAt: string

lastSeenAt

lastSeenAt: string

hidden

hidden: boolean

Source: wire/communities.ts:721

GroupInfoQuery interface

Query of GET …/mls/groupinfo (13 §7.3).

interface GroupInfoQuery

include?

include?: "identityStates"

identityStates adds the roster's cached IdentityStates (channels only).

intent?

intent?: "join"

join marks a fetch made to build an external commit; the join queue paces it (13 §11.5).

Source: wire/mls.ts:364

GroupInfoResponse interface

GET /v1/contexts/{ctx}/mls/groupinfo response, GroupInfoResponse (13 §7.3).

interface GroupInfoResponse

groupId

groupId: string

generation

generation: number

epoch

epoch: number

ekid

ekid: string | null

groupInfo

groupInfo: string

mls_group_info, with ratchet_tree and external_pub (base64url).

pendingProposals

pendingProposals: ServerProposal[]

Full ServerProposal objects for this epoch.

identityStates?

identityStates?: Record<string, string>

Canonical address → IdentityState JWS (only with include=identityStates).

Source: wire/mls.ts:372

HandshakePage interface

One page of the handshake log (13 §7.6). Continue with fromEpoch = the last item's newEpoch.

interface HandshakePage

items

items: HandshakeRecord[]

hasMore

hasMore: boolean

Source: wire/mls.ts:492

HandshakeRecord interface

HandshakeRecord (13 §7.6), also the full payload of mls.handshake (13 §8.3).

interface HandshakeRecord

groupId

groupId: string

epoch

epoch: number

The epoch the commit was made in.

newEpoch

newEpoch: number

epoch + 1.

kind

kind: HandshakeKind

commit

commit: string

The commit exactly as submitted (base64url mls_public_message).

committer

committer: MlsLeafRef

The committer's address, device ID and leaf index in the new epoch.

proposals

proposals: ServerProposal[]

The full ServerProposals the commit references.

identityStates

identityStates: string[]

IdentityState JWSs attached by the server; never empty (13 §8.3).

ekid

ekid: string

Reference ekid of newEpoch (settled value once settled, else provisional).

ekidSettled

ekidSettled: boolean

Always false in the mls.handshake event.

commitHash

commitHash: string

welcomeFor?

welcomeFor?: MlsDeviceRef[]

DMs: each device added by Welcome.

at

at: string

Acceptance time.

Source: wire/mls.ts:465

HandshakesQuery interface

Query of GET …/mls/handshakes (13 §7.6).

interface HandshakesQuery

fromEpoch

fromEpoch: number

Required, integer ≥ 0.

limit?

limit?: number

1 to 100, default 50.

Source: wire/mls.ts:457

Head interface

One stream's head in session.heads (03 §5.7).

interface Head

headSeq

headSeq: number

The stream's latest seq.

lastItemSeq?

lastItemSeq?: number

seq of the latest timeline item this account would receive in full; absent if none.

lastItemAt?

lastItemAt?: string

That event's ts.

Source: wire/transport.ts:441

HistoryDisabledData interface

data of history.disabled (14 §15). Unknown values: treat as insecure.

interface HistoryDisabledData

reason

reason: string & {} | "insecure"

Source: wire/history.ts:385

HistoryEvents interface

The history.* events a client receives on its event WebSocket (14 §9). No sealed.* events exist in v1.

interface HistoryEvents

history.shared

history.shared: HistorySharedEvent

Source: wire/history.ts:291

HistoryKeyEntry interface

One history-key entry of the client key store (14 §3.7). Keys are raw bytes here, never on the wire.

interface HistoryKeyEntry

host

host: string

Canonical domain of the hosting server.

ctx

ctx: string

gen

gen: number

epoch

epoch: number

key

key: Uint8Array

K_hist, 32 bytes.

ekid

ekid: Uint8Array

ekid of key, 8 bytes.

source

source: HistoryKeySource

confirmed

confirmed: boolean

Source: wire/history.ts:102

HistoryShare interface

A HistoryShare as the sharer posts it (14 §7.4, §8.3). Producers MUST NOT add other members; receivers ignore unknown members, which the signature doesn't cover.

interface HistoryShare

v

v: number

Format version, 1.

ctx

ctx: string

Context reference; MUST equal the path's context.

shareId

shareId: string

UUIDv7 generated by the sharing client.

recipient

recipient: string

Canonical address of the recipient account.

did

did: string

Device ID of the sharing device; MUST equal the session's device.

fromSeq

fromSeq: number

First seq of the range.

toSeq

toSeq: number

Last seq of the range, inclusive.

count

count: number

Items in the bundle, 1 to 5,000.

nonce

nonce: string

Bundle AES-GCM nonce, 16 characters.

ct

ct: string

Encrypted bundle plus tag: decoded length exactly 5 + 48 × count + 16.

keys

keys: HistoryShareKeyWrap[]

1 to 100 key wraps with distinct dids.

sig

sig: string

Labelled signature history-share by the sharing device's DSK, 86 characters.

Source: wire/history.ts:165

HistoryShareCreated interface

201 response of POST /v1/contexts/{ctx}/history/shares (14 §7.7, §8.3).

interface HistoryShareCreated

shareId

shareId: string

seq

seq: number

createdAt

createdAt: string

Source: wire/history.ts:202

HistorySharedEvent interface

history.shared payload (14 §9.1). Durable, on the context stream; carries no keys or content.

interface HistorySharedEvent

shareId

shareId: string

sharer

sharer: string

recipient

recipient: string

fromSeq

fromSeq: number

toSeq

toSeq: number

count

count: number

Source: wire/history.ts:281

HistoryShareDiagnosticData interface

data of the history_share diagnostic (14 §9.4).

interface HistoryShareDiagnosticData

shareId

shareId: string

sharer

sharer: string

did

did: string

step

step: HistoryShareStep

mid?

mid?: string

Only for step item.

Source: wire/history.ts:318

HistoryShareForbiddenData interface

data of history.share_forbidden (14 §15). Unknown values: treat as permission.

interface HistoryShareForbiddenData

reason

reason: "bot" | string & {} | "self" | "permission" | "recipient_not_member" | "recipient_not_in_group"

Source: wire/history.ts:390

HistoryShareKeyWrap interface

One key wrap of a HistoryShare (14 §7.4): K_share HPKE-sealed to one recipient device's box key.

interface HistoryShareKeyWrap

did

did: string

The recipient device, 22 characters.

enc

enc: string

HPKE encapsulated key, 43 characters (32 bytes).

ct

ct: string

HPKE ciphertext of K_share, 64 characters (48 bytes).

Source: wire/history.ts:152

HistoryShareRangeInvalidData interface

data of history.share_range_invalid (14 §15). Unknown values: treat as not_visible.

interface HistoryShareRangeInvalidData

reason

reason: string & {} | "count" | "beyond_head" | "not_visible"

Source: wire/history.ts:395

HistorySharesQuery interface

Query of GET /v1/contexts/{ctx}/history/shares (14 §8.4).

interface HistorySharesQuery

shareId?

shareId?: string

Return only this share.

cursor?

cursor?: string

limit?

limit?: number

1 to 10, default 5.

Source: wire/history.ts:209

HistoryShareTooLargeData interface

data of history.share_too_large (14 §15).

interface HistoryShareTooLargeData

max

max: number

Source: wire/history.ts:400

HistoryState interface

GET /v1/contexts/{ctx}/history response, HistoryState (14 §8.2).

interface HistoryState

ctx

ctx: string

visibleFromSeq

visibleFromSeq: number

The seq at which the account's current membership began (14 §10.2).

earlierWithheld

earlierWithheld: boolean

Whether content below visibleFromSeq is withheld (equivalent to a non-null withheldBeforeSeq, 11 §7.1).

grants

grants: VisibilityGrantSummary[]

The account's grants in this context, oldest first.

Source: wire/history.ts:232

HomeAssertionClaims interface

HomeAssertion claims (06 §4.3). igen, ikf and dkf are present exactly when enr is true (06 §4.3, §6.3 V7). An object containing nbf is rejected (04 §6.6). Unknown claims are ignored.

interface HomeAssertionClaims

iss

iss: string

The home server's canonical domain (lowercase A-label).

sub

sub: string

The account's canonical address (01); its domain part equals iss.

aud

aud: string

The remote server's canonical domain; never equal to iss.

iat

iat: number

Issue time, NumericDate.

exp

exp: number

Expiry, NumericDate; iat < exp ≤ iat + 300.

jti

jti: string

Assertion ID: ≥ 16 random bytes, base64url, 22–86 characters. Single use at the audience.

kind

kind: AssertionAccountKind

Account kind (05).

inc

inc: string

The account's incarnation (05 §11.1, D-086): 16 bytes, base64url (22 characters).

sec

sec: SecurityState

The account security state.

did

did: string

The device ID (05), 22 base64url characters.

enr

enr: boolean

Whether the device is enrolled (06 §4.2 step 6). Always false when sec is insecure.

isv

isv: number

The ver of the IdentityState the claims were derived from; at least 1.

igen?

igen?: number

The identity generation; only when enr is true.

ikf?

ikf?: string

RFC 7638 thumbprint of the identity key (43 characters); only when enr is true.

dkf?

dkf?: string

RFC 7638 thumbprint of this device's DSK (43 characters); only when enr is true.

name?

name?: string

The account's display name (01), 1–128 octets of UTF-8. Optional.

Source: wire/federation.ts:55

HomeAssertionHeader interface

Protected header of a HomeAssertion: kid is <home canonical domain>#<keyId> (06 §4.3, §3.2).

interface HomeAssertionHeader

alg

alg: "EdDSA"

typ

typ: "sv-assert+jwt"

kid

kid: string

Full server key ID, <canonical-domain>#<keyId>; its domain part equals iss (06 §3.2).

Source: wire/federation.ts:43

HomeSessionEnded interface

Why a home session ended (05 §14, §14.1).

interface HomeSessionEnded

code

code: string

signed_out for a local sign-out; otherwise the error code that ended it, such as auth.session_revoked or auth.refresh_reused.

reason

reason: RevokedReason | null

data.reason of auth.session_revoked, or the reason implied (token_reuse for auth.refresh_reused, signed_out for a sign-out).

problem

problem: Problem | null

The problem that ended it, or null for a local sign-out.

Source: auth/session.ts:65

HomeSessionOptions interface

Options of HomeSession (05 §7.6, §7.7).

interface HomeSessionOptions

clock?

clock?: Clock

Clock. Default: the device clock.

sleep?

sleep?: Sleep

Sleep between refresh retries. Default: setTimeout.

refreshMarginMs?

refreshMarginMs?: number

Refresh this long before the access token expires. Default 120 s, the margin of 03 §5.13 item 5.

persist?

persist?: (state: HomeSessionState) => void | Promise<void>

Store the new state after each refresh, before the new token is used (05 §7.7). The old refresh token is rotated once the server answers, so a failure here leaves only the in-memory copy. Never called for a shared-computer session, whose tokens MUST stay in memory only (05 §7.7, §12.6).

lock?

lock?: (fn: () => Promise<T>) => Promise<T>

Run fn exclusively across every process and tab that shares this session (05 §7.7: one refresh in flight at a time; web clients use the Web Locks API). Default: exclusive within this object only. See webLocks.

load?

load?: () => HomeSessionState | Promise<HomeSessionState | null> | null

Read the newest stored state inside the lock, so that a refresh done by another tab or process is adopted instead of presenting a rotated token (which would revoke the device, 05 §7.6 rule 3).

maxRefreshAttempts?

maxRefreshAttempts?: number

Attempts of one refresh while the response may have been lost, all within the 30 s retry window (05 §7.6 rule 2). Default 3.

onError?

onError?: (error: unknown) => void

Receives errors of persist and of listeners. Default: rethrown asynchronously.

Source: auth/session.ts:75

HomeSessionState interface

The persistent state of a home session. Native clients keep the refresh token in the platform's secure storage; web clients in IndexedDB, or in memory only in shared-computer mode, never in localStorage or cookies (05 §7.7).

interface HomeSessionState

clientId

clientId: string

The client ID the token family was issued to; every refresh must repeat it (05 §7.6).

accessToken

accessToken: string

sva_….

accessTokenExpiresAt

accessTokenExpiresAt: string

When the access token expires (RFC 3339), computed from expires_in at receipt.

refreshToken

refreshToken: string

svr_…, the only valid refresh token of the family (05 §7.6 rule 1).

authAt

authAt: string | null

The session's authAt (05 §9.1), or null if unknown.

did?

did?: string

This device's did, if known.

address?

address?: string

The account's canonical address, if known.

sharedComputer?

sharedComputer?: boolean

Shared-computer mode (05 §12.6): keep the state in memory only.

baseUrl?

baseUrl?: string

The normalized base URL of the home server that issued the token family. The tokens are sent only there, or to a base URL the client's own pin accepted as a move (02 §10.6 token binding, 03 §3.2 rule 3). Filled in by HomeSession.fromTokenResponse; a state without it counts as unbound, and SloppyVoiceClient refuses to send it to a base URL it can't tie to the issuer.

Source: auth/session.ts:38

HttpClient interface

What every resource API codes against.

interface HttpClient

baseUrl

readonly baseUrl: string

The server's base URL, https, without trailing slash (03 §2.1).

request

request<T = unknown>(req: HttpRequest): Promise<T>

Send one request; resolves with the parsed body or rejects with SloppyVoiceError.

Source: core/http.ts:138

HttpRequest interface

One request to a server (03 §2).

interface HttpRequest extends RequestOptions

signal?

signal?: AbortSignal

Cancels the request and any automatic retry (03 §2.7 item 3).

idempotencyKey?

idempotencyKey?: string

Sent as Idempotency-Key (03 §14.2). Create calls with a client-generated ID (mid) don't need it.

method

method: HttpMethod

path

path: string

Path relative to the base URL, starting with '/', built with the path tag.

query?

query?: Record<string, QueryValue>

body?

body?: unknown

JSON body (serialized with JSON.stringify, Content-Type: application/json).

rawBody?

rawBody?: BodyInit

Non-JSON body (attachment bytes, form-encoded OAuth) with its content type.

contentType?

contentType?: string

auth?

auth?: "none" | "session" | { scheme: "Bearer" | "Bot"; token: string }

'session' (default) uses the client's TokenProvider; 'none' sends no Authorization; an explicit credential is used as-is (sign-up token, fetch token, webhook token, RelayTicket).

headers?

headers?: Record<string, string>

expect?

expect?: "none" | "json" | "response"

'json' (default): parse JSON body; 'none': expect 204/empty; 'response': return the raw Response.

url?

url?: string

Absolute URL for endpoints outside {base} ({relayUrl}/connect, {gatewayUrl}/v1/..., capability URLs). The session token is never sent to an absolute URL (03 §3.2 rule 3).

idempotent?

idempotent?: boolean

Mark a POST or PATCH as idempotent so that automatic retries are allowed (03 §2.7 item 2): set it when the body carries a client-generated ID such as mid (03 §14.1), or for a PATCH its owner declares idempotent (03 §2.5). Requests with idempotencyKey, and GET, PUT and DELETE, are idempotent already.

timeoutMs?

timeoutMs?: number

Per-attempt timeout in ms when the endpoint's owner states a bound other than 30 s (03 §2.3 item 5).

retry?

retry?: RetryMode

Which failures are retried automatically; see RetryMode. Default 'auto'.

followRedirect?

followRedirect?: boolean

Internal: in browsers, let fetch follow a redirect of this authenticated GET itself. Set only for the one /v1/ endpoint the spec lets redirect, the attachment download (11 §14.4). Without it a browser's opaque redirect of a request that carries Authorization is refused, because the SDK can't see the target to apply 03 §3.2 rule 3.

Source: core/http.ts:98

IconInvalidData interface

data of community.icon_invalid (09 §15.1); reason values aren't enumerated by 09.

interface IconInvalidData

reason

reason: string

Source: wire/communities.ts:1012

IdempotencyConflictData interface

data of core.idempotency_conflict (03 §10.5). retryable is true for in_progress, false for mismatch.

interface IdempotencyConflictData

Source: wire/transport.ts:133

IdentityActor interface

actor: the initiating device, sent only to the subject's own devices (07 §12.1).

interface IdentityActor

did

did: string

plat

plat: DevicePlatform

changedAt

changedAt: string

RFC 3339 time of the change.

Source: wire/identity.ts:254

IdentityAlreadySecureData interface

data of identity.already_secure (07 §19).

interface IdentityAlreadySecureData

igen

igen: number

Source: wire/identity.ts:406

IdentityCertificateClaims interface

Payload of an IdentityCertificate, typ sv-idcert+jwt (07 §5.1). Self-signed by ik.

interface IdentityCertificateClaims

sub

sub: string

Canonical address of the account (07 §4.2).

ik

ik: Ed25519PublicJwk

The identity public key, an OKP JWK with exactly kty, crv, x (07 §4.1).

igen

igen: number

Identity generation, 1 to 4,294,967,295.

kind

kind: IdentityKind

The account's kind.

iat

iat: number

NumericDate of issue.

Source: wire/identity.ts:103

IdentityChangedEvent interface

Payload of identity.changed (07 §12.1): d on the WebSocket (durable, stream me) and the S2S event body. Everything but state is a hint; only the verified state is evidence (07 §12.3).

interface IdentityChangedEvent

sub

sub: string

change

change: IdentityChangeKind

ver

ver: number

igen

igen: number

prevIgen

prevIgen: number

sec

sec: string & {} | IdentitySecurity

state

state: string

The IdentityState JWS after the change.

device?

device?: { did: string; plat: DevicePlatform }

The added device, when change is device_added.

actor?

actor?: IdentityActor

Only on delivery to the subject's own devices.

Source: wire/identity.ts:265

IdentityDiagnosticData interface

data of a 15 diagnostic report with kind identity_check (07 §13.6 S4).

interface IdentityDiagnosticData

subject

subject: string

Canonical address of the member.

did?

did?: string

Device ID of the leaf.

reason

reason: IdentityCheckResult

ver?

ver?: number

ver of the IdentityState involved.

Source: wire/identity.ts:318

IdentityErrorInfo interface

One row of the identity.* error registry (07 §19).

interface IdentityErrorInfo

status

readonly status: number

userAction

readonly userAction: "none" | "sign_in" | "enable_encryption" | "set_up_device"

retryable

readonly retryable: boolean

Source: wire/identity.ts:421

IdentityEvents interface

Client events of 07 (07 §12): event type to payload. identity.changed and device.revoked also travel S2S (06) with the same body minus actor.

interface IdentityEvents

identity.changed

identity.changed: IdentityChangedEvent

device.revoked

device.revoked: DeviceRevokedEvent

identity.refresh_hint

identity.refresh_hint: IdentityRefreshHintEvent

Source: wire/identity.ts:308

IdentityGenerationMismatchData interface

data of identity.generation_mismatch (07 §19).

interface IdentityGenerationMismatchData

currentIgen

currentIgen: number

ver

ver: number

Source: wire/identity.ts:400

IdentityKeyReusedData interface

data of identity.key_reused (07 §19).

interface IdentityKeyReusedData

which

which: "ik" | "dsk"

Source: wire/identity.ts:411

IdentityMismatchData interface

data of federation.identity_mismatch (06 §16).

interface IdentityMismatchData

reason

reason: IdentityMismatchReason

identityReason?

identityReason?: string

Source: wire/federation.ts:683

IdentityRefreshHintEvent interface

Payload of identity.refresh_hint (07 §12.3): client WebSocket only, ephemeral, targeted on me.

interface IdentityRefreshHintEvent

sub

sub: string

ver

ver: number

state

state: string

Source: wire/identity.ts:297

IdentityResponse interface

IdentityResponse, returned by every endpoint of 07 §11 (07 §11.1).

interface IdentityResponse

address

address: string

The canonical address.

state

state: string

The current IdentityState JWS.

deviceCertificates

deviceCertificates: string[]

The DeviceCertificate JWS of each entry of devices, in the same order; empty when insecure.

Source: wire/identity.ts:185

IdentityStateClaims interface

Payload of an IdentityState, typ sv-idstate+jwt, signed by the home server (07 §7.1).

interface IdentityStateClaims

iss

iss: string

The home server's canonical domain; equals the domain of sub and of the header kid.

sub

sub: string

inc

inc: string

The account's incarnation (05 §11.1, D-086): 16 bytes base64url.

ver

ver: number

Version, 1 to 2^53 − 1, strictly increasing on every content change (07 §7.3).

igen

igen: number

Current identity generation, 0 to 4,294,967,295.

idc?

idc?: string

The IdentityCertificate JWS of igen; present exactly when sec is secure.

devices

devices: DeviceEntry[]

Active enrolled devices, ordered by since then did; empty when insecure; at most 64.

revoked

revoked: RevokedEntry[]

Recently revoked devices; at most 50, at most 8 with rev.

iat

iat: number

exp

exp: number

exp − iat is 1 to 86,400.

Source: wire/identity.ts:159

IdentitySubjectMismatchData interface

data of identity.subject_mismatch (07 §19).

interface IdentitySubjectMismatchData

expected

expected: string

The caller's canonical address.

Source: wire/identity.ts:394

IdentityTooManyDevicesData interface

data of identity.too_many_devices (07 §19).

interface IdentityTooManyDevicesData

max

max: number

Source: wire/identity.ts:416

InvalidAddressData interface

data of address.invalid (01 §12.1).

interface InvalidAddressData

reason

reason: InvalidAddressReason

Source: wire/addressing.ts:188

InvalidCertificateData interface

data of identity.invalid_certificate (07 §19).

interface InvalidCertificateData

object

object: string & {} | "identityCertificate" | "deviceCertificate" | "revocation"

reason

reason: IdentityCheckResult

Source: wire/identity.ts:388

InvalidContentData interface

data of message.invalid_content (11 §17.1).

interface InvalidContentData

field?

field?: string

reason?

reason?: string

Source: wire/messaging.ts:503

InvalidDomainData interface

data of address.invalid_domain (01 §4.2).

interface InvalidDomainData

reason

reason: DomainFailureReason

Source: wire/addressing.ts:200

InvalidDurationData interface

data of moderation.invalid_duration (10 §14).

interface InvalidDurationData

minMs?

minMs?: number

maxMs?

maxMs?: number

Source: wire/moderation.ts:1031

InvalidLinkData interface

data of address.invalid_link (01 §12.1).

interface InvalidLinkData

reason

reason: InvalidLinkReason

Source: wire/addressing.ts:205

InvalidLocalPartData interface

data of address.invalid_local_part (01 §3.9).

interface InvalidLocalPartData

reason

reason: LocalPartFailureReason

index?

index?: number

Zero-based code-point index, only when one code point is to blame (01 §3.9).

Source: wire/addressing.ts:193

InvalidRequestData interface

data of core.invalid_request: at most 32 items (03 §10.5).

interface InvalidRequestData

errors?

errors?: InvalidRequestErrorItem[]

Source: wire/transport.ts:105

InvalidRequestErrorItem interface

One item of core.invalid_request data.errors (03 §10.5).

interface InvalidRequestErrorItem

source

source: InvalidRequestSource

Where the problem is.

pointer?

pointer?: string

RFC 6901 JSON Pointer to the offending member, when source is body.

name?

name?: string

The parameter or header name, when source isn't body.

reason

reason: InvalidRequestReason

What is wrong.

detail?

detail?: string

Plain-text detail for developers.

Source: wire/transport.ts:91

Invite interface

The Invite object (09 §8.1).

interface Invite

id

id: string

UUIDv7.

code

code: string

Canonical 12-character code (09 §8.2).

channel

channel: `ch:${string}` | null

Channel to open after joining, or null for defaultChannel.

createdBy

createdBy: string

createdAt

createdAt: string

expiresAt

expiresAt: string | null

maxUses

maxUses: number | null

1 to 10,000, or null for unlimited.

uses

uses: number

state

state: InviteState

allowSignUp

allowSignUp: boolean

Whether the invite also allows sign-up under registration policy invite (05, 09 §8.7).

uri

uri: string

The sloppyv URI carrying the code (01 §10.3).

Source: wire/communities.ts:604

InviteCreatedEvent interface

invite.created payload (09 §14.2), to the creator and manage_invites holders.

interface InviteCreatedEvent

invite

invite: Invite

Source: wire/communities.ts:867

InvitePreview interface

GET /v1/invites/{code} response, the public preview (09 §8.4).

interface InvitePreview

code

code: string

community

community: InvitePreviewCommunity

channel

channel: InvitePreviewChannel | null

null when the invite names no channel or one whose previewVisible is false.

createdBy

createdBy: { addr: string; name: string }

expiresAt

expiresAt: string | null

Source: wire/communities.ts:668

InvitePreviewChannel interface

The channel part of an invite preview (09 §8.4).

interface InvitePreviewChannel

ctx

ctx: `ch:${string}`

address

address: string

name

name: string

kind

kind: ChannelKind

security

security: ChannelSecurity

Source: wire/communities.ts:659

InvitePreviewCommunity interface

The community part of an invite preview (09 §8.4).

interface InvitePreviewCommunity

domain

domain: string

name

name: string

icon

icon: CommunityIcon | null

secure

secure: boolean

joinPolicy

joinPolicy: JoinPolicy

requireRulesAcceptance

requireRulesAcceptance: boolean

memberCount

memberCount: number

Source: wire/communities.ts:648

InviteRevokedEvent interface

invite.revoked payload (09 §14.2).

interface InviteRevokedEvent

id

id: string

code

code: string

by

by: string

Source: wire/communities.ts:872

JoinChannelResponse interface

POST /v1/channels/{id}/join 200 response (09 §4.5).

interface JoinChannelResponse

member

member: ChannelMember

channel

channel: Channel

Source: wire/communities.ts:594

JoinCommunityRequest interface

POST /v1/community/join body (09 §4.3).

interface JoinCommunityRequest

invite?

invite?: string

An invite code in any accepted input form (09 §8.2).

acceptRules?

acceptRules?: number

The rulesVersion the person accepted; required when requireRulesAcceptance is true.

Source: wire/communities.ts:308

JoinCommunityResponse interface

POST /v1/community/join response body, for 200 and 202 alike (09 §4.3).

interface JoinCommunityResponse

member

member: CommunityMember

community

community: Community

openChannel

openChannel: `ch:${string}` | null

The invite's channel if it has one the member can view, otherwise defaultChannel.

inviteIgnored

inviteIgnored: string & {} | "invite.not_found" | "invite.expired" | "invite.used_up" | "invite.revoked" | "invite.not_allowed" | "invite.limit_reached" | null

Error code of a supplied invite that was invalid but not needed (09 §9.2 C8), else null.

Source: wire/communities.ts:316

JoinCommunityResult interface

The result of POST /v1/community/join (09 §4.3): the body plus whether the account is now a requester.

interface JoinCommunityResult extends JoinCommunityResponse

status

status: 200 | 202

200 when the account is a member (active or needs_encryption), 202 when it is pending.

member

member: CommunityMember

community

community: Community

openChannel

openChannel: `ch:${string}` | null

The invite's channel if it has one the member can view, otherwise defaultChannel.

inviteIgnored

inviteIgnored: string & {} | "invite.not_found" | "invite.expired" | "invite.used_up" | "invite.revoked" | "invite.not_allowed" | "invite.limit_reached" | null

Error code of a supplied invite that was invalid but not needed (09 §9.2 C8), else null.

Source: api/community.ts:54

JoinOptions interface

Options of CallsApi.join.

interface JoinOptions extends RequestOptions

onSend?

onSend?: (idempotencyKey: string) => void

Called with the Idempotency-Key just before the request is first sent. Record the time on your audio engine's monotonic clock: the join response's tick counts as received at that moment for coverage (15 §3.3.3, 16 §12.1 item 1). Automatic retries reuse the key and don't call it again.

timeoutMs?

timeoutMs?: number

Give up on one attempt after this many ms (default: the HTTP client's). An auto-rejoin driver sets it so that an attempt that gets no answer fails in time for the next scheduled attempt (15 §10.4, §10.5). Note that the HTTP client may still retry a keyed join after a network error or a retryable problem (03 §2.7); pass signal to stop it.

signal?

signal?: AbortSignal

Cancels the request and any automatic retry (03 §2.7 item 3).

idempotencyKey?

idempotencyKey?: string

Sent as Idempotency-Key (03 §14.2). Create calls with a client-generated ID (mid) don't need it.

Source: api/calls.ts:60

JoinRequest interface

POST /v1/contexts/{ctx}/call/join request (15 §3.3.1).

interface JoinRequest

features

features: MediaProfile[]

Media profiles this device supports in this call; voice-dc/1 MUST be present.

create?

create?: boolean

Start a call if none is active. Default true.

takeOver?

takeOver?: boolean

Resolve a one-call conflict by ending the user's existing participation on this server (15 §11). Default false.

rejoinToken?

rejoinToken?: string

The token of a participation of this device, to restore its seat (15 §10.2).

planned?

planned?: boolean

Only with rejoinToken: this rejoin is a planned migration (15 §10.8). Default false.

selfMuted?

selfMuted?: boolean

Initial self-mute state. Default false.

selfDeafened?

selfDeafened?: boolean

Initial self-deafen state. Default false.

ring?

ring?: boolean

DM contexts only: whether starting a call rings. Default true. Every automatic join sends false (15 §3.3.1).

video?

video?: boolean

The caller starts with webcam on; copied into the ring. Default false.

Source: wire/calls.ts:480

JoinResponse interface

POST /v1/contexts/{ctx}/call/join response (15 §3.3.3).

interface JoinResponse

call

call: Call

The call after admission.

pid

pid: number

This participation's index.

rejoinToken

rejoinToken: string

Fresh rejoin token (15 §10.2). Keep it in memory; delete it when the participation ends.

seatRestored

seatRestored: boolean

true when a rejoin kept the earlier seat and pid.

lease

lease: VoiceLease

This participant's rights (15 §4.1).

tick

tick: LeaseSnapshot

The snapshot that admitted this pid: the client's first lease tick. Its receipt time is when the first join with this request's Idempotency-Key was sent (15 §3.3.3, 16 §12.1 item 1).

relay

relay: RelayInfo

Source: wire/calls.ts:511

JtiStore interface

The set of jti values a relay has accepted (15 §5.2 item 6). Each is remembered until exp + 60 s. In-memory; a relay that runs several processes behind one URL needs a shared store with the same interface.

interface JtiStore

add

add(jti: string, forgetAt: number, now: number): boolean | Promise<boolean>

Record jti until forgetAt (seconds). Returns false if it was already present.

jti: string
forgetAt: number
now: number

Source: calls/relay-ticket.ts:110

KeyBackup interface

The KeyBackup object as the server returns it (08 §5.1).

interface KeyBackup extends KeyBackupContent

v

v: number

Format version, 1.

addr

addr: string

The account's canonical address.

igen

igen: number

The identity generation whose keys the backup holds.

ikf

ikf: string

RFC 7638 thumbprint (43 characters) of the identity public key in the backup.

vgen

vgen: number

The newest vault generation whose key the payload holds.

phraseId

phraseId: string

base64url of the 16-byte phrase ID.

kdf

kdf: Argon2idParams

nonce

nonce: string

base64url of the 12-byte AES-GCM nonce.

ct

ct: string

base64url of the AES-256-GCM ciphertext and tag (08 §5.4).

ver

ver: number

Server version, increased on every accepted write, never reused.

state

state: KeyBackupState

updatedAt

updatedAt: string

RFC 3339.

updatedBy

updatedBy: string

did of the writing device.

Source: wire/device-setup.ts:62

KeyBackupContent interface

The members of a KeyBackup a client sets (08 §5.1).

interface KeyBackupContent

v

v: number

Format version, 1.

addr

addr: string

The account's canonical address.

igen

igen: number

The identity generation whose keys the backup holds.

ikf

ikf: string

RFC 7638 thumbprint (43 characters) of the identity public key in the backup.

vgen

vgen: number

The newest vault generation whose key the payload holds.

phraseId

phraseId: string

base64url of the 16-byte phrase ID.

kdf

kdf: Argon2idParams

nonce

nonce: string

base64url of the 12-byte AES-GCM nonce.

ct

ct: string

base64url of the AES-256-GCM ciphertext and tag (08 §5.4).

Source: wire/device-setup.ts:41

KeyBackupMeta interface

GET /v1/me/backup?part=meta (08 §5.5.1): the KeyBackup without nonce and ct, plus planning members.

interface KeyBackupMeta extends Omit<KeyBackup, "nonce" | "ct">

v

v: number

Format version, 1.

addr

addr: string

The account's canonical address.

igen

igen: number

The identity generation whose keys the backup holds.

ikf

ikf: string

RFC 7638 thumbprint (43 characters) of the identity public key in the backup.

vgen

vgen: number

The newest vault generation whose key the payload holds.

phraseId

phraseId: string

base64url of the 16-byte phrase ID.

kdf

kdf: Argon2idParams

ver

ver: number

Server version, increased on every accepted write, never reused.

state

state: KeyBackupState

updatedAt

updatedAt: string

RFC 3339.

updatedBy

updatedBy: string

did of the writing device.

downloadAllowed

downloadAllowed: boolean

Whether a full GET by this session would pass 08 §5.7 now (ignoring rate limits).

phraseChangePending

phraseChangePending: boolean

Whether a new recovery phrase is required before the KeyBackup may be rewritten (08 §10.8).

Source: wire/device-setup.ts:73

KeyBackupPayload interface

The KeyBackup plaintext (08 §5.2). Readers ignore unknown members.

interface KeyBackupPayload

v

v: number

addr

addr: string

igen

igen: number

ik

ik: string

base64url of the 32-byte Ed25519 seed of the identity key.

idc

idc: string

The IdentityCertificate JWS, exactly as registered.

vaultIdKey

vaultIdKey: string

base64url of K_vid (32 bytes).

vaultKeys

vaultKeys: PayloadVaultKey[]

phrase

phrase: string

base64url of the phrase entropy E (10 bytes).

phraseId

phraseId: string

base64url of the 16-byte phrase ID.

createdAt

createdAt: string

RFC 3339.

Source: wire/device-setup.ts:93

KeyframeRequestFeedback interface

keyframe_request: a viewer asks the sender for a keyframe of a source (17 §7.2).

interface KeyframeRequestFeedback

kind

kind: "keyframe_request"

sourceId

sourceId: VideoSourceId

1 or 3.

reason

reason: KeyframeRequestReason

Source: wire/media.ts:166

KeyPackageClaim interface

Body of POST /v1/keypackages/claim, KeyPackageClaim (13 §9.4).

interface KeyPackageClaim

purpose

purpose: KeyPackageClaimPurpose

ctx?

ctx?: string

The dm: or gdm: context, when it already exists.

claimId?

claimId?: string

A UUIDv7; a retry of a claim whose answer was lost MUST reuse it (idempotent for 10 minutes).

targets

targets: KeyPackageClaimTarget[]

1 to 64 targets.

Source: wire/mls.ts:600

KeyPackageClaimResult interface

200 response of POST /v1/keypackages/claim, KeyPackageClaimResult (13 §9.4).

interface KeyPackageClaimResult

results

results: KeyPackageClaimTargetResult[]

One entry per target, in request order.

Source: wire/mls.ts:629

KeyPackageClaimTarget interface

One target of a KeyPackage claim (13 §9.4).

interface KeyPackageClaimTarget

addr

addr: string

Canonical address.

devices?

devices?: string[]

Optional device IDs; when absent, one KeyPackage per active device.

Source: wire/mls.ts:592

KeyPackageClaimTargetResult interface

One per-target result of a claim (13 §9.4).

interface KeyPackageClaimTargetResult

addr

addr: string

status

status: KeyPackageClaimStatus

identityState?

identityState?: string

The target's current IdentityState JWS (for ok and no_devices).

keyPackages?

keyPackages?: ClaimedKeyPackage[]

For ok: one entry per device that had a KeyPackage.

Source: wire/mls.ts:619

KeyPackageStatus interface

KeyPackageStatus (13 §9.2): answer of every /v1/me/keypackages method.

interface KeyPackageStatus

did

did: string

available

available: number

Regular KeyPackages stored.

lastResort

lastResort: boolean

Whether a last-resort KeyPackage is stored.

lastResortUsed

lastResortUsed: boolean

Whether the last-resort KeyPackage has been handed out since it was uploaded.

lowWatermark

lowWatermark: number

target

target: number

Source: wire/mls.ts:577

KeyPackageUpload interface

Body of POST /v1/me/keypackages, KeyPackageUpload (13 §9.2).

interface KeyPackageUpload

keyPackages

keyPackages: string[]

0 to 100 KeyPackages (mls_key_package, base64url).

lastResort?

lastResort?: string

One KeyPackage to store as the last-resort KeyPackage, replacing any previous one.

Source: wire/mls.ts:568

KeyRotationClaims interface

KeyRotation claims (02 §12.1). There is no exp: a KeyRotation is permanent.

interface KeyRotationClaims

iss

iss: string

The server's canonical domain.

n

n: number

Position in the server's chain: 1, 2, 3, …

iat

iat: number

NumericDate when it was signed.

prev

prev: string

Thumbprint of the signing key.

key

key: KeyRotationKey

The new key.

url

url: string

The normalized base URL the server authorises from this rotation on.

Source: wire/discovery.ts:268

KeyRotationHeader interface

The protected header of a KeyRotation (02 §12.1).

interface KeyRotationHeader

alg

alg: "EdDSA"

typ

typ: "sv-keyrot+jwt"

kid

kid: string

The kid of the signing key.

Source: wire/discovery.ts:251

KeyRotationKey interface

The new key in a KeyRotation: exactly kty, crv, x, kid and purpose (02 §12.1).

interface KeyRotationKey

kty

kty: "OKP"

crv

crv: "Ed25519"

x

x: string

kid

kid: string

purpose

purpose: ServerKeyPurpose

Source: wire/discovery.ts:259

KeyStorageDiagnosticData interface

data of a key_storage diagnostic (08 §16.4).

interface KeyStorageDiagnosticData

keyProtection

keyProtection: "platform" | "file" | "hardware"

Source: wire/device-setup.ts:642

KeyTimes interface

The key fields the usability test needs: those of a ServerKey or of a pinned key.

interface KeyTimes

purpose

purpose: string

status

status: string

nbf

nbf: number

exp

exp: number

retiredAt?

retiredAt?: number

Source: discovery/keys.ts:185

KeyUsabilityInput interface

Inputs of keyUnusableReason.

interface KeyUsabilityInput

purpose

purpose: ServerKeyPurpose

The purpose the verifier needs (sign for every JWS, 02 §11.6).

iat

iat: number

The JWS iat (NumericDate).

nowSec

nowSec: number

The verifier's current time (NumericDate).

revoked?

revoked?: boolean

Whether the key's thumbprint is in the pin's revoked set.

staleExpiredAtSec?

staleExpiredAtSec?: number | null

When the verifier is using a stale result (02 §13.2): the NumericDate at which that result expired. If it expired more than 24 h ago, only objects signed before it are accepted.

Source: discovery/keys.ts:194

KickRequest interface

Body of POST /v1/moderation/kicks (10 §8.4).

interface KickRequest extends ModerationCommon

reason?

reason?: string

0–512 Unicode scalar values; stored in the audit log.

showReason?

showReason?: boolean

Show reason to the target. Default false.

reportId?

reportId?: string

Link the audit entry (and the report's actions) to this report.

member

member: string

The member's address.

deleteMessagesWithinMs?

deleteMessagesWithinMs?: number

Absent or 0 for none; otherwise 60,000 to 604,800,000 ms.

Source: wire/moderation.ts:252

KickResult interface

Response of POST /v1/moderation/kicks (10 §8.4).

interface KickResult

auditId

auditId: string

Source: wire/moderation.ts:260

LayoutChannelPlacement interface

One channel's place in a layout (09 §6.5).

interface LayoutChannelPlacement

ctx

ctx: `ch:${string}`

categoryId

categoryId: string | null

Source: wire/communities.ts:562

LayoutChannelPosition interface

One channel's resulting place in a layout, as community.layout_changed carries it (09 §14.2).

interface LayoutChannelPosition

ctx

ctx: `ch:${string}`

categoryId

categoryId: string | null

position

position: number

Source: wire/communities.ts:574

LeaseSeatInput interface

One seat's inputs to the lease computation (15 §4.1).

interface LeaseSeatInput

pid

pid: number

speakAndShare

speakAndShare: boolean

The account has speak_and_share in the context (channels: effective permission, 10; DMs: always).

mutedForEveryone?

mutedForEveryone?: boolean

A Mute for everyone exists for the account in this channel (15 §3.6).

serverMuted?

serverMuted?: boolean

A ServerMute applies (channels only, 10 §8.6).

timedOut?

timedOut?: boolean

The account is timed out (10).

Source: calls/lease.ts:225

LeaseSnapshot interface

A room-wide statement of current leases (15 §4.2). Delivered to participants as a lease tick (call.tick) over the relay and over the WebSocket (15 §4.4). Each array is ascending without duplicates; audio and video are subsets of listeners.

interface LeaseSnapshot

callId

callId: string

seq

seq: number

Strictly increasing per call; MAY skip values.

validMs

validMs: number

Always 3000 in v1; receivers use 3,000 ms whatever it says.

audio

audio: number[]

pids allowed to send sources 0 and 2.

video

video: number[]

pids allowed to send sources 1 and 3.

listeners

listeners: number[]

pids allowed to receive anything.

epoch?

epoch?: number

Secure calls only: the call's current mediaEpoch. Absent in insecure calls.

Source: wire/calls.ts:439

LeaveRequest interface

POST /v1/contexts/{ctx}/call/leave request (15 §3.4).

interface LeaveRequest

callId

callId: string

Source: wire/calls.ts:532

LimitEntry interface

A limit definition: default and floor, and the owning document (03 §16.1 rule 2).

interface LimitEntry

default

readonly default: number

floor

readonly floor: number

owner

readonly owner: string

Source: wire/transport.ts:759

LimitReachedData interface

data of role.limit_reached (10 §14).

interface LimitReachedData

limit

limit: number

Source: wire/moderation.ts:1040

LinkProviderRequest interface

Body of POST /v1/me/providers (05 §10.3).

interface LinkProviderRequest

provider

provider: string

An enabled provider ID.

clientId

clientId: string

As client_id (05 §5.1).

redirectUri

redirectUri: string

As redirect_uri (05 §5.2).

codeChallenge

codeChallenge: string

As code_challenge.

codeChallengeMethod

codeChallengeMethod: "S256"

S256.

state

state: string

As state.

uiLocales?

uiLocales?: string

As ui_locales.

Source: wire/accounts.ts:585

LinkProviderResponse interface

Response 201 of POST /v1/me/providers (05 §10.3).

interface LinkProviderResponse

requestUri

requestUri: string

authorizeUrl

authorizeUrl: string

The URL the client opens in the browser.

expiresInMs

expiresInMs: number

Source: wire/accounts.ts:603

LinkTokenResponse interface

The code exchange's answer for intent link (05 §7.3, §10.3): a new access token without a refresh token, plus link.

interface LinkTokenResponse

access_token

access_token: string

token_type

token_type: "Bearer"

expires_in

expires_in: number

authAt?

authAt?: string

Source: wire/accounts.ts:465

ListBotsParams interface

Options of BotsApi.list (05 §15.3).

interface ListBotsParams

all?

all?: boolean

Every bot on the server instead of the caller's own (?all=true, requires manage_bots).

limit?

limit?: number

Page size (03 §13.2).

Source: api/bots.ts:34

ListChannelMembersParams interface

Query of GET /v1/channels/{id}/members (09 §4.7).

interface ListChannelMembersParams

state?

state?: readonly ChannelMemberState[]

Subset of active, needs_encryption, left (left needs manage_channels).

q?

q?: string

cursor?

cursor?: string

limit?

limit?: number

Source: wire/communities.ts:336

ListCommunityMembersParams interface

Query of GET /v1/community/members (09 §4.7).

interface ListCommunityMembersParams

state?

state?: readonly CommunityMemberState[]

Subset of the states; default active,needs_encryption. pending needs manage_invites, banned ban_members, left view_audit_log.

q?

q?: string

1 to 64 characters; prefix match on the local part and display-name words (01 minimalPrepare).

cursor?

cursor?: string

limit?

limit?: number

Source: wire/communities.ts:326

ListDevicesParams interface

Options of DevicesApi.list.

interface ListDevicesParams

includeRevoked?

includeRevoked?: boolean

Also list devices revoked in the last 30 days, after the active ones (?include=revoked, 05 §12.9).

Source: api/devices.ts:19

ListDmIndexParams interface

Query of GET /v1/me/dms (12 §9.3).

interface ListDmIndexParams

state?

state?: string | readonly DmIndexEntryState[]

States to list; default active,requested. Sent comma-separated.

kind?

kind?: "direct" | "group"

direct or group.

includeHidden?

includeHidden?: boolean

Include hidden entries; default false.

cursor?

cursor?: string

limit?

limit?: number

1–100, default 50.

Source: wire/dms.ts:384

ListDmRequestsParams interface

Query of GET /v1/me/dm-requests (12 §10.3).

interface ListDmRequestsParams

state?

state?: DmRequestState

Default pending.

cursor?

cursor?: string

limit?

limit?: number

Source: wire/dms.ts:489

ListInvitesParams interface

Query of GET /v1/invites (09 §8.3).

interface ListInvitesParams

state?

state?: readonly InviteState[]

Filter by invite state (values not specified by 09 §8.3; sent comma-separated).

cursor?

cursor?: string

limit?

limit?: number

Source: wire/communities.ts:639

ListNotificationsParams interface

Query of GET /v1/me/notifications (19 §8.3).

interface ListNotificationsParams

state?

state?: readonly NotificationState[]

Default unread. Sent comma-separated.

host?

host?: string

Filter by hosting server.

ctx?

ctx?: CtxRef

Filter by context; requires host.

kind?

kind?: readonly NotificationKind[]

Sent comma-separated.

cursor?

cursor?: string

limit?

limit?: number

1–100, default 50.

Source: wire/notifications.ts:390

ListPinsParams interface

GET /v1/resolve/pins query (02 §10.5). limit 1–100, default 50.

interface ListPinsParams

state?

state?: PeerPinState

cursor?

cursor?: string

limit?

limit?: number

Source: wire/discovery.ts:355

LogoutOthersResponse interface

Response 200 of POST /v1/auth/logout with scope: others (05 §14).

interface LogoutOthersResponse

revoked

revoked: string[]

The dids revoked.

Source: wire/accounts.ts:530

LogoutRequest interface

Body of POST /v1/auth/logout (05 §14).

interface LogoutRequest

scope?

scope?: LogoutScope

current (default) or others (fresh authentication). Bots may use current only.

revocation?

revocation?: string

With scope: current, a DeviceRevocation JWS for this device (07).

Source: wire/accounts.ts:522

MarkNotificationsReadResponse interface

Response of POST /v1/me/notifications/read (19 §8.3).

interface MarkNotificationsReadResponse

updated

updated: number

badge

badge: number

Source: wire/notifications.ts:434

MediaAttestationData interface

The d of a media.attestation control-channel message (18 §9.5). Senders add no other members; receivers ignore unknown members, which aren't signed.

interface MediaAttestationData

v

v: number

Format version, 1. A receiver ignores any other value.

callId

callId: string

The call's callId (UUIDv7, lowercase hyphenated).

epoch

epoch: number

The MLS epoch of the KID's keys; its low 4 bits equal the KID's residue.

src

src: SourceId

The KID's sourceId, 0–3, in clear for routing.

kid

kid: string

The KID as a decimal kid-string (18 §4.1): it can exceed 2^53 − 1.

first

first: number

First counter of the batch, 0 to 2^32 − 1.

last

last: number

Last counter: first ≤ last ≤ first + 255, and ≤ 2^32 − 1.

hashes

hashes: string

base64url of the 8-octet frame hashes, exactly 8 × (last − first + 1) octets.

sig

sig: string

base64url of the 64-octet labelled signature (label media-attest, 18 §9.4).

Source: wire/media.ts:282

MediaAttestationMessage interface

A media.attestation control-channel message (18 §9.5) in 15's envelope (15 §6.5): the relay sets from to the sender's pid.

interface MediaAttestationMessage

t

t: "media.attestation"

from?

from?: number

Source: wire/media.ts:307

MediaAttestationReportData interface

The data of a diagnostics report of kind media_attestation (18 §10.3). It carries no KID, counter, hash, nonce or key.

interface MediaAttestationReportData

senderPid

senderPid: number

The pid whose stream was stopped, or to whose stream the invalid attestation was attributed.

sourceId

sourceId: SourceId

0–3.

route

route: MediaRoute

relay or sfu: the route on which the stream's frames arrived; the server stores an unknown value as other.

playedUnverifiedMs

playedUnverifiedMs: number

Milliseconds of media of the stop list that were played; 0 for invalid.

stopsInCall

stopsInCall: number

Counted stops in this call so far, for all streams.

Source: wire/media.ts:547

MediaControlMessages interface

Control-channel (sv-control) message types that 18 defines, mapped to their d payloads (18 §9.5). call.media_feedback is 15's message; its d kinds are MediaFeedbackPayload.

interface MediaControlMessages

media.attestation

media.attestation: MediaAttestationData

Source: wire/media.ts:581

MediaEvents interface

Event-WebSocket events of 16, 17 and 18. There are none: these documents define no event types (16 "Conformance and status", 17 §1.1, 18 §1.2). Their messages travel on the call's data channels instead; see MediaControlMessages. The interface exists so wire/events.ts can compose the EventMap uniformly.

interface MediaEvents

Source: wire/media.ts:575

MediaFeedback interface

call.media_feedback (15 §6.6). Kinds are owned by 16 and 17; receivers ignore unknown kinds.

interface MediaFeedback

kind

kind: MediaFeedbackKind

Source: wire/calls.ts:802

MeIdentityResponse interface

Response of GET /v1/me/identity (07 §11.3).

interface MeIdentityResponse extends IdentityResponse

address

address: string

The canonical address.

state

state: string

The current IdentityState JWS.

deviceCertificates

deviceCertificates: string[]

The DeviceCertificate JWS of each entry of devices, in the same order; empty when insecure.

thisDevice

thisDevice: ThisDeviceStatus

Source: wire/identity.ts:202

MemberLeftEvent interface

member.left payload (09 §14.2).

interface MemberLeftEvent

scope

scope: MemberEventScope

addr

addr: string

reason

reason: string & {} | "account_deleted" | "left" | "banned" | "kicked" | "unbanned" | "server_upgraded" | "account_downgraded" | "community_left" | "lost_access" | "channel_upgraded"

Source: wire/communities.ts:792

MemberLike interface

What the algorithm needs of a member (from 09's CommunityMember and 10's Timeout).

interface MemberLike

address

address: string

Canonical address (D-032).

state

state: MemberState | null | undefined

09 membership state; null/undefined for no record.

roleIds

roleIds: readonly string[]

IDs of the roles held, admin included; everyone is implied (listing it is harmless).

kind?

kind?: "bot" | string & {} | "user"

user or bot (05); granting a bot's roles also needs manage_bots (10 §4.4).

timeoutUntil?

timeoutUntil?: string | null

End of an active Timeout (10 §8.5), if any.

joinedAt?

joinedAt?: string | null

When the membership last became active (09 §4.1), for the new-member restriction (10 §12.2).

Source: permissions.ts:179

MemberRejectedEvent interface

member.rejected payload (09 §14.2), to the requester.

interface MemberRejectedEvent

reason

reason: "closed" | "expired" | string & {} | "rejected"

Source: wire/communities.ts:826

MemberRemovedEvent interface

member.removed payload (09 §14.2). Never names who removed the member.

interface MemberRemovedEvent

scope

scope: MemberEventScope

addr

addr: string

reason

reason: MemberRemovedReason

Source: wire/communities.ts:808

MemberRequestedEvent interface

member.requested payload (09 §14.2), to holders of manage_invites.

interface MemberRequestedEvent

member

member: CommunityMember

State pending.

Source: wire/communities.ts:820

MemberRoles interface

Response of GET /v1/roles/members/{address} (10 §7.2).

interface MemberRoles

address

address: string

Canonical address.

roleIds

roleIds: string[]

Ordinary and admin roles held, by position descending; everyone is implied.

top

top: number

Top position (10 §2).

permissions

permissions: Permission[]

Effective community permissions (10 §6.1 with no channel).

channelPermissions?

channelPermissions?: Permission[]

Present only when ctx was given: effective permissions in that channel.

timeoutUntil?

timeoutUntil?: string | null

Present only when the caller is the member or holds timeout_members.

Source: wire/moderation.ts:150

MembershipCheckRequest interface

POST /v1/community/membership-check body, S2S only (09 §5.2). Typed only in this SDK.

interface MembershipCheckRequest

onBehalfOf

onBehalfOf: string

One of the asking server's own accounts that is a member here.

onBehalfOfInc

onBehalfOfInc: string

Its incarnation (05 §11.1).

addrs

addrs: string[]

1 to 20 canonical addresses.

Source: wire/communities.ts:382

MembershipCheckResponse interface

POST /v1/community/membership-check 200 body (09 §5.2), results in request order.

interface MembershipCheckResponse

results

results: MembershipCheckResult[]

Source: wire/communities.ts:400

MembershipCheckResult interface

One result of the membership check (09 §5.2). An unknown state is read as null.

interface MembershipCheckResult

addr

addr: string

member

member: boolean

state

state: string & {} | "active" | "needs_encryption" | null

inc

inc: string | null

Source: wire/communities.ts:392

MentionHint interface

The cleartext mention hint of a secure carrier (11 §4.4).

interface MentionHint

mentions

mentions: string[]

mentionAll

mentionAll: boolean

Source: content.ts:882

MentionMatch interface

How a received message or edit concerns the reader (11 §4.4 receiver rules).

interface MentionMatch

byName

byName: boolean

A user-mention token in the text names the reader. The tokens are authoritative, not mentions (11 §3.4 rule 4).

byReply

byReply: boolean

The message replies to the reader with ping not false (11 §3.5, §4.4).

byEveryone

byEveryone: boolean

<@everyone> is in the text and the server-validated mentionAll is true (11 §3.9, §4.4).

any

any: boolean

Any of the above.

Source: content.ts:919

MeResponse interface

Response of GET /v1/me (05 §11.5).

interface MeResponse

account

account: Account

device

device: DeviceRecord

The caller's own device record.

authAt?

authAt?: string

Equals device.authAt; absent for bot tokens.

Source: wire/accounts.ts:540

MergedReaction interface

One merged reaction for display (11 §5.2, §5.5 step 3).

interface MergedReaction

key

key: string

The key as first seen.

count

count: number

Accounts with this key, each counted once.

me

me: boolean

Whether self is among them, when known.

entries

entries: ({ mid: string; sender: Sender })[]

The reaction entries behind the count that this client knows of (sealed ones, decrypted).

Source: api/reactions.ts:67

MergeResult interface

Result of a merge after vault.version_conflict (08 §8.9): the device fetched the stored record (theirs), merged its own version (ours) into it, and writes the result with ifVer = the stored ver.

interface MergeResult<T>

merged

merged: T

changed

changed: boolean

True when the merged record differs from the stored one (theirs), so the device writes it. False when the merge changed nothing, so the device skips the write (08 §8.9).

localChanged

localChanged: boolean

True when the merged record differs from this device's own version (ours): update the local copy.

diagnostics

diagnostics: string[]

Source: api/vault.ts:642

Message interface

The folded, current view of one root message, or its tombstone (11 §5.2, §5.4). Members are keyed on the carrier type of the root message.

interface Message

type?

type?: "message"

"message" in timeline pages (11 §7.1) only.

mid

mid: string

ctx?

ctx?: CtxRef

Present in HTTP; omitted in events.

seq

seq: number

Present in HTTP; omitted in events.

carrier

carrier: CarrierType

sender

sender: Sender

createdAt

createdAt: string

content?

content?: MessageContent

plain, not deleted: the current content.

sealed?

sealed?: SealedMessage

sealed, not deleted, not edited: the root SealedMessage.

edit?

edit?: EditEntry | null

sealed only: the latest edit, or null.

mentions?

mentions?: string[]

sealed only: the server-validated mention hint of the root.

mentionAll

mentionAll: boolean

The server-validated mentionAll of the root (11 §4.4).

attachmentIds?

attachmentIds?: string[]

sealed, when any are bound: the IDs currently bound.

editedAt

editedAt: string | null

deleted

deleted: Deletion | null

reactions?

reactions?: ReactionSummary[]

Aggregated plain reactions; absent on tombstones.

reactionEntries?

reactionEntries?: ReactionEntry[]

Up to 100 sealed reaction entries, oldest first.

reactionEntryCount?

reactionEntryCount?: number

Total number of sealed reaction entries, with reactionEntries.

updatedSeq

updatedSeq: number

seq of the latest entry that changed this message.

Source: wire/messaging.ts:417

MessageContent interface

The content object of a root message (11 §3.2).

interface MessageContent

text

text: string

SV-Markdown text (11 §3.3), at most 4,000 Unicode scalar values.

mentions?

mentions?: string[]

Canonical addresses mentioned by a <@addr> token in text (11 §3.4). Default [].

mentionAll?

mentionAll?: boolean

true if and only if text contains <@everyone>. Default false.

replyTo?

replyTo?: ReplyRef | null

The root message this one replies to. Default null.

attachments?

attachments?: AttachmentRef[]

Attached files, at most 10. Default [].

Source: wire/messaging.ts:246

MessageDeletionRequest interface

Body of POST /v1/moderation/message-deletions (10 §8.3). Give either mids, or author with withinMs.

interface MessageDeletionRequest extends ModerationCommon

reason?

reason?: string

0–512 Unicode scalar values; stored in the audit log.

showReason?

showReason?: boolean

Show reason to the target. Default false.

reportId?

reportId?: string

Link the audit entry (and the report's actions) to this report.

ctx?

ctx?: string

Required unless author is given with allChannels: true.

mids?

mids?: string[]

1–100 message IDs in ctx.

author?

author?: string

Canonical address whose recent messages are deleted.

withinMs?

withinMs?: number

With author: 60,000 to 604,800,000 ms.

allChannels?

allChannels?: boolean

With author: every channel of the community the actor has manage_messages in. Default false.

Source: wire/moderation.ts:226

MessageDeletionResult interface

Response of POST /v1/moderation/message-deletions (10 §8.3).

interface MessageDeletionResult

deleted

deleted: string[]

notFound

notFound: string[]

protected

protected: string[]

Skipped because the author's top position is at or above the actor's.

more

more: boolean

An author deletion stopped at 10,000 messages: repeat the request.

auditId

auditId: string

The primary audit entry.

Source: wire/moderation.ts:240

MessagePage interface

A timeline page of GET /v1/contexts/{ctx}/messages (11 §7.1). Items are in ascending seq, except for the changes feed, where they are in ascending updatedSeq (11 §7.4).

interface MessagePage

items

items: TimelineItem[]

hasMore

hasMore: boolean

hasMoreBefore?

hasMoreBefore?: boolean

Only for around.

hasMoreAfter?

hasMoreAfter?: boolean

Only for around.

headSeq

headSeq: number

The context's latest seq when the page was read.

ranges

ranges: SeqRange[]

The seq ranges the caller may read, ascending and merged.

grants

grants: [number, number][]

The caller's VisibilityGrant ranges (14), ascending and merged.

withheldBeforeSeq

withheldBeforeSeq: number | null

In a secure context, the seq where K6 applies; otherwise null.

purgedThroughSeq

purgedThroughSeq: number

Every root message with seq ≤ this has been purged; 0 if none.

Source: wire/messaging.ts:483

MessagePageParams interface

Parameters of one timeline page (11 §7.1). At most one of before, after, around and changedAfter.

interface MessagePageParams

before?

before?: number

after?

after?: number

around?

around?: number

changedAfter?

changedAfter?: number

through?

through?: number

Only with changedAfter.

limit?

limit?: number

1 to 100; default 50.

Source: api/messages.ts:148

MessageTooLargeData interface

data of message.too_large (11 §17.1).

interface MessageTooLargeData

limit?

limit?: number

size?

size?: number

Source: wire/messaging.ts:509

MessagingApiOptions interface

Options shared by the messaging resource APIs.

interface MessagingApiOptions

limits?

limits?: LimitsSource

The hosting server's ServerMetadata limits (or a getter); absent limits mean the floors (11 §2.3).

newMid?

newMid?: () => string

Generates mids (11 §2.4). Default: uuidv7.

isCanonicalAddress?

isCanonicalAddress?: MentionAddressCheck

Canonical-address check for mention validation (01 §7.5).

Source: api/messages.ts:56

MessagingEvents interface

The events of 11 a client receives on its event WebSocket, mapped to their d payloads (11 §8.1). Durable events may arrive as a reduced payload { "withheld": true }, and on replay message.edited and reaction.added may arrive as { "target": …, "withheld": true } (11 §8.3).

interface MessagingEvents

message.created

message.created: WithheldPayload | MessageCreatedEvent

message.edited

message.edited: WithheldPayload | EditEvent | WithheldTargetPayload

message.deleted

message.deleted: WithheldPayload | DeleteEvent

message.purged

message.purged: PurgeEvent

reaction.added

reaction.added: WithheldPayload | WithheldTargetPayload | ReactionAddedEvent

reaction.removed

reaction.removed: WithheldPayload | ReactionRemovedEvent

read.updated

read.updated: ReadState

typing.started

typing.started: TypingEvent

typing.stopped

typing.stopped: TypingEvent

presence.updated

presence.updated: Presence

presence.snapshot

presence.snapshot: PresenceSnapshot

Source: wire/messaging.ts:917

MetadataAuth interface

ServerMetadata auth (02 §7.3.2).

interface MetadataAuth

providers

providers: AuthProvider[]

0–16 providers, in display order.

registration

registration: string & {} | RegistrationPolicy

Who may create an account here; unknown values: treat as closed.

Source: wire/discovery.ts:163

MetadataChangedPayload interface

discovery.metadata_changed payload (02 §16.1). Ephemeral on the client WebSocket (ctx = me), and also an S2S event. Only a trigger: receivers never take values from it.

interface MetadataChangedPayload

canonicalDomain

canonicalDomain: string

updatedAt

updatedAt: string

changes

changes: (string & {} | MetadataChangeKind)[]

urgent

urgent: boolean

True when a key was revoked (02 §11.7).

Source: wire/discovery.ts:391

MetadataContact interface

ServerMetadata contact (02 §7.3.5). Every member optional; each invalid member is ignored.

interface MetadataContact

operator?

operator?: string

Operator name, ≤ 100 code points.

admin?

admin?: string

mailto: or https: URI.

abuse?

abuse?: string

mailto: or https: URI; RECOMMENDED.

security?

security?: string

mailto: or https: URI.

url?

url?: string

"About this server" page, https.

Source: wire/discovery.ts:185

MetadataEndpoints interface

ServerMetadata endpoints (02 §7.3.1).

interface MetadataEndpoints

api

api: string

The server's normalized base URL; equals the URL the metadata was fetched from.

relayUrl

relayUrl: string

Base URL of the server's default media relay, normalized (02 §3.3); the connection is {relayUrl}/connect (15).

push

push: MetadataPush

Source: wire/discovery.ts:134

MetadataLinks interface

ServerMetadata links (02 §7.3.4).

interface MetadataLinks

join?

join?: string

RFC 6570 template (level ≤ 3, variables local, domain, invite) for HTTPS share links.

web?

web?: string

A web client that serves this server; its origin identifies the server's own web client (20 §16.11).

terms?

terms?: string

Terms of service (https). Cosmetic.

privacy?

privacy?: string

Privacy notice (https). Cosmetic.

help?

help?: string

Help page (https). Cosmetic.

Source: wire/discovery.ts:171

MetadataPush interface

endpoints.push (02 §7.3.1): how this server, as a home server, delivers pushes (19).

interface MetadataPush

gatewayPolicy

gatewayPolicy: string & {} | PushGatewayPolicy

any or listed; unknown values: treat as listed.

gateways?

gateways?: string[]

Normalized push gateway base URLs; required when gatewayPolicy is listed. 0–32 elements.

webPushKey?

webPushKey?: string

VAPID public key (RFC 8292): base64url of the 65-octet uncompressed P-256 point.

Source: wire/discovery.ts:124

MetadataSoftware interface

ServerMetadata software (02 §7.3.6). Diagnostics only; never changes behaviour.

interface MetadataSoftware

name?

name?: string

≤ 64 code points.

version?

version?: string

≤ 32 code points.

Source: wire/discovery.ts:199

MethodNotAllowedData interface

data of core.method_not_allowed (03 §10.5).

interface MethodNotAllowedData

allow?

allow?: string[]

Source: wire/transport.ts:125

MlsCapabilities interface

The leaf Capabilities every LeafNode carries (13 §3.4); GREASE values may be added.

interface MlsCapabilities

versions

versions: number[]

cipherSuites

cipherSuites: number[]

extensions

extensions: number[]

proposals

proposals: number[]

credentials

credentials: number[]

Source: mls/provider.ts:300

MlsCommitBusyData interface

data of mls.commit_busy (13 §11.5): the 1-based join-queue position, for queued joiners only.

interface MlsCommitBusyData

position?

position?: number

Source: wire/mls.ts:807

MlsCommitNeededEvent interface

mls.commit_needed payload (13 §8.5). Ephemeral; sent to the designated committer only.

interface MlsCommitNeededEvent

groupId

groupId: string

epoch

epoch: number

The epoch whose pending proposals need a commit.

proposalRefs

proposalRefs: string[]

Every pending proposal's ref (may be empty for group_info_refresh).

reason

reason: CommitNeededReason

deadlineMs

deadlineMs: number

round

round: number

1 for the first pass over the candidates, then 2, 3…

Source: wire/mls.ts:695

MlsCommitParams interface

What to put in a member commit (13 §12). Every commit carries an UpdatePath (13 §3.9).

interface MlsCommitParams

proposalRefs?

proposalRefs?: Uint8Array<ArrayBufferLike>[]

ProposalRefs of pending server proposals the commit covers by reference (13 §12.1 M2/M3, §12.2 D1).

add?

add?: Uint8Array<ArrayBufferLike>[]

DMs only: KeyPackage MLSMessages to Add by value (13 §12.2 D2).

remove?

remove?: number[]

DMs only: leaf indices to Remove by value (13 §12.2 D3).

groupContextExtensions?

groupContextExtensions?: MlsExtension[]

DMs only: a by-value GroupContextExtensions proposal (13 §12.2 D4).

Source: mls/provider.ts:1199

MlsCredentialRejectedData interface

data of mls.credential_rejected (13 §6.1.1, §18).

interface MlsCredentialRejectedData

subject

subject: string

The leaf's canonical address.

membershipCode?

membershipCode?: string

With not_permitted: the code 09 or 10 would return, e.g. moderation.banned.

Source: wire/mls.ts:812

MlsDeviceRef interface

A device: canonical address and device ID (13 §7.6 welcomeFor, §7.9 addedBy).

interface MlsDeviceRef

addr

addr: string

did

did: string

Source: wire/mls.ts:276

MlsEpochConflictData interface

data of mls.epoch_conflict (13 §11.3).

interface MlsEpochConflictData

epoch

epoch: number

pendingProposals

pendingProposals: ServerProposal[]

groupInfo?

groupInfo?: GroupInfoResponse

Only for an external commit not held back by the join queue.

Source: wire/mls.ts:793

MlsEvents interface

The mls.* events a client receives on its event WebSocket (13 §8.1).

interface MlsEvents

mls.group_created

mls.group_created: MlsGroupCreatedEvent

mls.handshake

mls.handshake: MlsHandshakeEvent

mls.proposal

mls.proposal: MlsProposalEvent

mls.group_retired

mls.group_retired: MlsGroupRetiredEvent

mls.commit_needed

mls.commit_needed: MlsCommitNeededEvent

mls.welcome

mls.welcome: MlsWelcomeEvent

mls.resync_required

mls.resync_required: MlsResyncRequiredEvent

mls.keypackages_low

mls.keypackages_low: MlsKeyPackagesLowEvent

Source: wire/mls.ts:735

MlsExporter interface

Something with an MLS exporter: a group handle or a pending commit.

interface MlsExporter

export

export(label: string, context: Uint8Array, length: number): Promise<Uint8Array<ArrayBufferLike>>
label: string
context: Uint8Array
length: number

Source: mls/provider.ts:1364

MlsExtension interface

An MLS Extension: extension_type and opaque extension_data (RFC 9420 §13.4).

interface MlsExtension

type

type: number

data

data: Uint8Array

Source: mls/provider.ts:272

MlsForkDetectedData interface

data of mls.fork_detected: the settled reference (13 §7.8, §18).

interface MlsForkDetectedData

epoch

epoch: number

ekid

ekid: string

extPub

extPub: string

Source: wire/mls.ts:870

MlsGenerationRetiredData interface

data of mls.generation_retired (13 §18).

interface MlsGenerationRetiredData

generation

generation: number

nextGeneration

nextGeneration: number | null

Source: wire/mls.ts:854

MlsGroupCreatedEvent interface

mls.group_created payload (13 §8.2). Durable.

interface MlsGroupCreatedEvent

groupId

groupId: string

generation

generation: number

epoch

epoch: number

ekid

ekid: string

creator

creator: MlsDeviceRef

Source: wire/mls.ts:655

MlsGroupExistsData interface

data of mls.group_exists (13 §7.4): a GroupInfoResponse plus the accepted bootstrap.

interface MlsGroupExistsData extends GroupInfoResponse

groupId

groupId: string

generation

generation: number

epoch

epoch: number

ekid

ekid: string | null

groupInfo

groupInfo: string

mls_group_info, with ratchet_tree and external_pub (base64url).

pendingProposals

pendingProposals: ServerProposal[]

Full ServerProposal objects for this epoch.

identityStates?

identityStates?: Record<string, string>

Canonical address → IdentityState JWS (only with include=identityStates).

bootstrap

bootstrap: { creator: MlsDeviceRef; ekid: string }

Source: wire/mls.ts:844

MlsGroupFullData interface

data of mls.group_full (13 §17.1, §18).

interface MlsGroupFullData

maxSecureLeaves

maxSecureLeaves: number

Source: wire/mls.ts:860

MlsGroupHandle interface

One MLS group a provider holds (RFC 9420 state for one group_id).

interface MlsGroupHandle

groupId

readonly groupId: Uint8Array

epoch

epoch(): number

The current epoch.

ownLeafIndex

ownLeafIndex(): number

This device's leaf index.

export

export(label: string, context: Uint8Array, length: number): Promise<Uint8Array<ArrayBufferLike>>

MLS-Exporter(label, context, length) of the current epoch (RFC 9420 §8.5). Only labels of 04 §8.6.

label: string
context: Uint8Array
length: number

externalPub

externalPub(): Promise<Uint8Array<ArrayBufferLike>>

The current epoch's external_pub public key (RFC 9420 §8.3), for extPub (13 §7.8).

extensions

extensions(): Promise<MlsExtension[]>

The current GroupContext extensions, in order.

members

members(): Promise<MlsLeafInfo[]>

The non-blank leaves of the current ratchet tree.

groupInfo

groupInfo(): Promise<Uint8Array<ArrayBufferLike>>

A GroupInfo of the current epoch with ratchet_tree and external_pub (13 §3.6), e.g. epoch 0 for a bootstrap.

processProposal

processProposal(message: Uint8Array): Promise<Uint8Array<ArrayBufferLike>>

Verify and store a server proposal of the current epoch (13 §6.3, §8.4). Rejects anything 13 §6.2 items 3–4 forbid. Returns its ProposalRef.

message: Uint8Array

processCommit

processCommit(message: Uint8Array): Promise<MlsProcessedCommit>

Process another device's sequenced commit of the current epoch (13 §11.2 item 5). Throws MlsProviderError with unprocessable (13 §15.4: resync) or rejected (positive rejection).

message: Uint8Array

createCommit

createCommit(params: MlsCommitParams): Promise<MlsPendingCommit>

Build a pending member commit (13 §11.2 item 1).

mergePendingCommit

mergePendingCommit(): Promise<void>

Merge the pending commit after the server accepted it (13 §11.2 item 2).

clearPendingCommit

clearPendingCommit(): Promise<void>

Discard the pending commit after a rejection (13 §11.2 item 3).

Source: mls/provider.ts:1228

MlsGroupIdMismatchData interface

data of mls.group_id_mismatch (13 §18).

interface MlsGroupIdMismatchData

expected

expected: string

Source: wire/mls.ts:849

MlsGroupInfoSummary interface

What a provider found in a GroupInfo (13 §10.2 step 2), after RFC 9420 §12.4.3 verification.

interface MlsGroupInfoSummary

groupId

groupId: Uint8Array

epoch

epoch: number

extensions

extensions: MlsExtension[]

members

members: MlsLeafInfo[]

Source: mls/provider.ts:1271

MlsGroupNotFoundData interface

data of mls.group_not_found (13 §7.3, §18).

interface MlsGroupNotFoundData

groupId

groupId: string

generation

generation: number

bootstrapAllowed

bootstrapAllowed: boolean

Source: wire/mls.ts:837

MlsGroupPin interface

What a client pinned for one (hosting canonical domain, context reference), 13 §4.4: the highest generation seen and its current epoch in that generation (null before it holds one).

interface MlsGroupPin

generation

generation: number

epoch

epoch: number | null

Source: mls/provider.ts:595

MlsGroupRetiredEvent interface

mls.group_retired payload (13 §8.2). Durable.

interface MlsGroupRetiredEvent

groupId

groupId: string

generation

generation: number

reason

reason: GroupRetiredReason

nextGeneration

nextGeneration: number | null

The next generation, or null when the context is no longer secure.

Source: wire/mls.ts:664

MlsGroupStatus interface

GET /v1/contexts/{ctx}/mls response (13 §7.2).

interface MlsGroupStatus

ctx

ctx: string

groupId

groupId: string

The group_id of the current generation, even in state none.

generation

generation: number

state

state: MlsGroupState

epoch

epoch: number | null

Null in none and retired.

ekid

ekid: string | null

Reference ekid of the current epoch (provisional until settled), or null.

ekidSettled

ekidSettled: boolean

leafCount

leafCount: number

maxSecureLeaves

maxSecureLeaves: number

pendingProposals

pendingProposals: ServerProposalSummary[]

lastCommitAt

lastCommitAt: string | null

self

self: MlsSelfLeaf | null

Null if the calling device has no leaf.

removedFor

removedFor: MlsRemovalReason | null

The §13.1 reason of this device's most recent removal in this generation, when known.

bootstrapAllowed

bootstrapAllowed: boolean

Source: wire/mls.ts:337

MlsHandshakeReduced interface

Reduced mls.handshake payload for subscribers that aren't eligible devices (13 §8.1).

interface MlsHandshakeReduced

groupId

groupId: string

epoch

epoch: number

newEpoch

newEpoch: number

kind

kind: HandshakeKind

Source: wire/mls.ts:673

MlsKeyPackageInvalidData interface

data of mls.keypackage_invalid (13 §9.2).

interface MlsKeyPackageInvalidData

index

index: number | "lastResort"

reason

reason: string

Source: wire/mls.ts:877

MlsKeyPackageLimitData interface

data of mls.keypackage_limit (13 §9.2).

interface MlsKeyPackageLimitData

max

max: number

Source: wire/mls.ts:883

MlsKeyPackagesLowEvent interface

mls.keypackages_low payload (13 §9.3 item 3). Ephemeral, ctx me, from the home server.

interface MlsKeyPackagesLowEvent

did

did: string

available

available: number

lastResort

lastResort: boolean

lastResortUsed

lastResortUsed: boolean

target

target: number

Source: wire/mls.ts:725

MlsLeafInfo interface

One non-blank leaf of the ratchet tree, as a provider exposes it.

interface MlsLeafInfo

leafIndex

leafIndex: number

credential

credential: Uint8Array

The raw Credential bytes (an sv_device credential, 13 §3.3).

signatureKey

signatureKey: Uint8Array

Raw 32-byte Ed25519 key: the device's DSK (13 §3.3 item 2).

encryptionKey

encryptionKey: Uint8Array

Raw 32-byte X25519 HPKE key.

Source: mls/provider.ts:1170

MlsLeafRef interface

A leaf: canonical address, device ID and leaf index (13 §7.6 committer, §7.7 target).

interface MlsLeafRef extends MlsDeviceRef

addr

addr: string

did

did: string

leaf

leaf: number

Source: wire/mls.ts:282

MlsLogTruncatedData interface

data of mls.log_truncated (13 §7.6).

interface MlsLogTruncatedData

oldestEpoch

oldestEpoch: number

Source: wire/mls.ts:865

MlsNotMemberData interface

data of mls.not_member (13 §18).

interface MlsNotMemberData

reason

reason: MlsNotMemberReason

removedFor?

removedFor?: MlsRemovalReason | null

Source: wire/mls.ts:831

MlsPendingCommit interface

A commit the provider built but hasn't merged: a pending commit (13 §11.2). Nothing of the new epoch may be used, stored or acknowledged until the server accepts it (14 §3.1).

interface MlsPendingCommit

epoch

epoch: number

The epoch the commit was built in.

commit

commit: Uint8Array

MLSMessage (mls_public_message).

groupInfo

groupInfo: Uint8Array

The GroupInfo of epoch + 1, with ratchet_tree and external_pub (13 §3.6).

welcome?

welcome?: Uint8Array<ArrayBufferLike>

The Welcome, for commits with Adds (13 §12.3).

export

export(label: string, context: Uint8Array, length: number): Promise<Uint8Array<ArrayBufferLike>>

The exporter of the pending epoch, used only to compute ekid(epoch + 1) (14 §3.1).

label: string
context: Uint8Array
length: number

Source: mls/provider.ts:1214

MlsPendingJoin interface

A pending external join: the external commit and the group it would create (13 §10.2).

interface MlsPendingJoin extends MlsPendingCommit

epoch

epoch: number

The epoch the commit was built in.

commit

commit: Uint8Array

MLSMessage (mls_public_message).

groupInfo

groupInfo: Uint8Array

The GroupInfo of epoch + 1, with ratchet_tree and external_pub (13 §3.6).

welcome?

welcome?: Uint8Array<ArrayBufferLike>

The Welcome, for commits with Adds (13 §12.3).

export

export(label: string, context: Uint8Array, length: number): Promise<Uint8Array<ArrayBufferLike>>

The exporter of the pending epoch, used only to compute ekid(epoch + 1) (14 §3.1).

label: string
context: Uint8Array
length: number

merge

merge(): Promise<MlsGroupHandle>

Merge after the server accepted the external commit and return the joined group.

discard

discard(): Promise<void>

Discard after a rejection.

Source: mls/provider.ts:1263

MlsPolicyViolationData interface

data of mls.policy_violation (13 §18).

interface MlsPolicyViolationData

rule

rule: MlsPolicyRule

Source: wire/mls.ts:826

MlsProcessedCommit interface

What a processed commit changed, for the client's AS checks (07 §13–§14) and roster.

interface MlsProcessedCommit

epoch

epoch: number

The new epoch.

committerLeafIndex

committerLeafIndex: number | null

Leaf index of the committer in the new epoch (null for an external commit before the provider knows it).

external

external: boolean

True for an external commit (sender new_member_commit).

added

added: MlsLeafInfo[]

removed

removed: number[]

updated

updated: MlsLeafInfo[]

Leaves whose LeafNode an UpdatePath replaced (the committer's).

extensions?

extensions?: MlsExtension[]

The GroupContext extensions after the commit, if they changed.

selfRemoved

selfRemoved: boolean

True if this device's own leaf was removed.

Source: mls/provider.ts:1181

MlsProposalReduced interface

Reduced mls.proposal payload for subscribers that aren't eligible devices (13 §8.1).

interface MlsProposalReduced

groupId

groupId: string

epoch

epoch: number

ref

ref: string

type

type: ServerProposalType

Source: wire/mls.ts:681

MlsProposalsData interface

data of mls.commit_required and mls.proposals_changed (13 §13.3, §18).

interface MlsProposalsData

epoch

epoch: number

proposals

proposals: ServerProposal[]

Source: wire/mls.ts:801

MlsProvider interface

What an RFC 9420 implementation must provide so the SDK and an app can run the sv1 profile (13). The profile fixes everything a provider must enforce: ciphersuite 0x0001, PublicMessage handshakes only, an UpdatePath on every commit, empty authenticated_data, the extension sets of 13 §3.5–§3.6, and the commit policy of 13 §12. The provider stores its own group state and the private keys of its KeyPackages.

The SDK's helpers that sit on top of a provider are exportHistoryKey, epochAckFor, commitSubmissionFor and groupBootstrapFor.

interface MlsProvider

name

readonly name: string

A label for diagnostics, e.g. the library's name and version.

createGroup

createGroup(params: { groupId: Uint8Array; credential: Uint8Array; signer: Ed25519Signer; extensions: MlsExtension[] }): Promise<MlsGroupHandle>

Create a one-leaf group at epoch 0 (13 §10.1 item 2) with the given group_id, the device's credential and DSK, and the GroupContext extensions of 13 §3.5.

params: { groupId: Uint8Array; credential: Uint8Array; signer: Ed25519Signer; extensions: MlsExtension[] }

joinFromWelcome

joinFromWelcome(params: { welcome: Uint8Array }): Promise<MlsGroupHandle>

Join from a Welcome (13 §10.3), using the private keys of the KeyPackage it names.

params: { welcome: Uint8Array }

externalJoin

externalJoin(params: { groupInfo: Uint8Array; credential: Uint8Array; signer: Ed25519Signer; removeOwnLeaf?: number }): Promise<MlsPendingJoin>

Build an external commit from a GroupInfo (13 §10.2, §12.1 E1–E5): one ExternalInit, an UpdatePath with the device's credential, and a Remove of removeOwnLeaf when resyncing.

params: { groupInfo: Uint8Array; credential: Uint8Array; signer: Ed25519Signer; removeOwnLeaf?: number }

inspectGroupInfo

inspectGroupInfo(groupInfo: Uint8Array): Promise<MlsGroupInfoSummary>

Verify a GroupInfo (signature, tree and parent hashes, RFC 9420 §12.4.3) and summarize it.

groupInfo: Uint8Array

loadGroup

loadGroup(groupId: Uint8Array): Promise<MlsGroupHandle | null>

Load a group this provider holds, or null.

groupId: Uint8Array

deleteGroup

deleteGroup(groupId: Uint8Array): Promise<void>

Discard all MLS state of a group (13 §10.5 item 2: history keys are kept elsewhere).

groupId: Uint8Array

generateKeyPackages

generateKeyPackages(params: { count: number; credential: Uint8Array; signer: Ed25519Signer; lifetime: { notBefore: number; notAfter: number }; lastResort?: boolean }): Promise<Uint8Array<ArrayBufferLike>[]>

Generate count KeyPackages (13 §9.1), keeping their private keys. With lastResort, one KeyPackage meant for reuse (13 §9.3). Returns MLSMessage bytes. buildKeyPackage does the encoding and signing for providers that want it.

params: { count: number; credential: Uint8Array; signer: Ed25519Signer; lifetime: { notBefore: number; notAfter: number }; lastResort?: boolean }

Source: mls/provider.ts:1304

MlsReport interface

Body of POST /v1/contexts/{ctx}/mls/reports, MlsReport (13 §7.10). Answered 202 with no body.

interface MlsReport

kind

kind: MlsReportKind

generation

generation: number

epoch

epoch: number

The epoch concerned.

commitHash?

commitHash?: string

mid?

mid?: string

Required for fork_suspected: the mid of the SealedMessage whose ekid differs (13 §15.3).

subject?

subject?: Partial<MlsLeafRef> & MlsDeviceRef

reason?

reason?: string

A short machine reason, at most 64 characters (e.g. unlisted_identity, ekid_mismatch, epoch_rollback, external_sender).

detail?

detail?: string

At most 1,024 characters. MUST NOT contain message content or key material.

Source: wire/mls.ts:548

MlsResyncRequiredEvent interface

mls.resync_required payload (13 §8.6). Ephemeral; resync after a random 0–2 s delay.

interface MlsResyncRequiredEvent

groupId

groupId: string

generation

generation: number

epoch

epoch: number

The server's current epoch.

reason

reason: ResyncReason

Source: wire/mls.ts:716

MlsSelfLeaf interface

The calling device's leaf in MlsGroupStatus (13 §7.2).

interface MlsSelfLeaf

leaf

leaf: number

lastAckedEpoch

lastAckedEpoch: number | null

removalPending

removalPending: boolean

Source: wire/mls.ts:326

MlsVerificationFailedData interface

data of mls.verification_failed (13 §18).

interface MlsVerificationFailedData

reason

reason: MlsVerificationReason

Source: wire/mls.ts:821

MlsWelcomeEvent interface

mls.welcome payload (13 §8.1). Ephemeral; sent to each device added by Welcome.

interface MlsWelcomeEvent

groupId

groupId: string

generation

generation: number

epoch

epoch: number

Source: wire/mls.ts:709

ModerationAppliedEvent interface

moderation.applied payload (10 §13.2). Never names the moderator.

interface ModerationAppliedEvent

action

action: ModerationAppliedAction

scope

scope: "community" | "server" | string & {} | null

ctx

ctx: string | null

until

until: string | null

reason

reason: string | null

Source: wire/moderation.ts:866

ModerationCommon interface

Members every moderation action accepts (10 §8.2 rules 2 and 3).

interface ModerationCommon

reason?

reason?: string

0–512 Unicode scalar values; stored in the audit log.

showReason?

showReason?: boolean

Show reason to the target. Default false.

reportId?

reportId?: string

Link the audit entry (and the report's actions) to this report.

Source: wire/moderation.ts:216

ModerationEvents interface

The client events of 10 §13.2, mapped to payload types. The S2S event report.forwarded (10 §13.3) is typed as ReportForwardedPayload and isn't in this map.

interface ModerationEvents

role.created

role.created: RoleEvent

role.updated

role.updated: RoleEvent

role.deleted

role.deleted: RoleDeletedEvent

role.reordered

role.reordered: RoleReorderedEvent

role.member_added

role.member_added: RoleMemberEvent

role.member_removed

role.member_removed: RoleMemberEvent

permission.overwrite_set

permission.overwrite_set: OverwriteSetEvent

permission.overwrite_removed

permission.overwrite_removed: OverwriteRemovedEvent

permission.changed

permission.changed: PermissionChangedEvent

moderation.applied

moderation.applied: ModerationAppliedEvent

moderation.lifted

moderation.lifted: ModerationLiftedEvent

moderation.server_mute_changed

moderation.server_mute_changed: ServerMuteChangedEvent

moderation.policy_updated

moderation.policy_updated: PolicyUpdatedEvent

moderation.logged

moderation.logged: ModerationLoggedEvent

report.created

report.created: ReportCreatedEvent

report.updated

report.updated: ReportUpdatedEvent

report.resolved

report.resolved: ReportResolvedEvent

Source: wire/moderation.ts:924

ModerationLiftedEvent interface

moderation.lifted payload (10 §13.2).

interface ModerationLiftedEvent

action

action: ModerationAppliedAction

ctx

ctx: string | null

scope

scope: "community" | "server" | string & {} | null

Source: wire/moderation.ts:874

ModerationLoggedEvent interface

moderation.logged payload (10 §13.2).

interface ModerationLoggedEvent

entry

entry: AuditLogEntry

Source: wire/moderation.ts:890

ModerationStatus interface

Response of GET /v1/moderation/members/{address} (10 §8.9), filtered by the caller's permissions: members the caller lacks permission for are omitted.

interface ModerationStatus

address

address: string

timeout?

timeout?: Timeout | null

Needs timeout_members.

serverMute?

serverMute?: ServerMute | null

Needs mute_members.

ban?

ban?: Ban | null

Needs ban_members.

openReports?

openReports?: number

Needs manage_reports; counts only reports the caller can see.

joinedAt?

joinedAt?: string | null

Source: wire/moderation.ts:310

Mute interface

A Mute for everyone (15 §3.6). Never names the moderator.

interface Mute

ctx

ctx: CtxRef

The voice channel.

addr

addr: string

Canonical address of the muted account.

reason?

reason?: string | null

Present only for holders of mute_members, and for the muted account when showReason is true.

showReason

showReason: boolean

reportId?

reportId?: string | null

Present only for holders of mute_members.

createdAt

createdAt: string

When the mute was applied or last replaced.

Source: wire/calls.ts:456

NetworkErrorOptions interface

Options for SloppyVoiceNetworkError.

interface NetworkErrorOptions

cause?

cause?: unknown

The underlying error.

timedOut?

timedOut?: boolean

The request timed out (03 §2.3 item 5).

ambiguous?

ambiguous?: boolean

The request may have been processed (03 §2.7): true for every failure after the request was handed to fetch, because a client can't tell how far it got.

url?

url?: string

The URL that was requested, without query (never logged with credentials).

Source: core/errors.ts:117

NewMemberPolicyLike interface

The new-member part of an AntiSpamPolicy; missing members take their defaults (10 §12.2).

interface NewMemberPolicyLike

enabled?

enabled?: boolean

durationMs?

durationMs?: number

restricted?

restricted?: readonly string[]

Source: permissions.ts:195

NewMemberRestrictedData interface

data of moderation.new_member_restricted (10 §12.2).

interface NewMemberRestrictedData

permission

permission: Permission

until

until: string

Source: wire/moderation.ts:1022

NonCanonicalData interface

data of address.non_canonical (01 §12.1, §7.6).

interface NonCanonicalData

reason

reason: NonCanonicalReason

field?

field?: string

JSON Pointer (RFC 6901) or claim name of the offending member.

canonical?

canonical?: string

The canonical form, if the server knows it.

Source: wire/addressing.ts:210

NotAllowedData interface

data of address.not_allowed (01 §5.4).

interface NotAllowedData

reason

reason: NotAllowedReason

minChars?

minChars?: number

The registration minimum in code points, with too_short.

Source: wire/addressing.ts:224

NotAuthorizedData interface

data of federation.not_authorized (06 §16): the member naming a subject or origin outside the sender's authority.

interface NotAuthorizedData

field

field: string

Source: wire/federation.ts:708

NotEditableData interface

data of message.not_editable (11 §17.1).

interface NotEditableData

reason

reason: string & {} | "security_changed"

Source: wire/messaging.ts:520

NotForwardableData interface

data of report.not_forwardable (10 §10.9).

interface NotForwardableData

reason

reason: NotForwardableReason

Source: wire/moderation.ts:1064

NotFoundData interface

data of core.not_found. reason unknown_endpoint means the feature is absent (03 §2.1, §10.5). Unknown values are ignored.

interface NotFoundData

reason?

reason?: string & {} | "unknown_endpoint"

Source: wire/transport.ts:120

NotificationEvents interface

The client events of 19 (19 §16.1): notify.triggered from a hosting server's me stream, and the notification.* and push.* events of the home server's me stream.

interface NotificationEvents

notify.triggered

notify.triggered: NotifyTriggered

notification.created

notification.created: NotificationCreated

notification.updated

notification.updated: NotificationUpdated

notification.state_changed

notification.state_changed: NotificationStateChanged

notification.settings_changed

notification.settings_changed: NotificationSettingsChanged

push.registration_removed

push.registration_removed: PushRegistrationRemoved

Source: wire/notifications.ts:691

NotificationFetchResponse interface

Response of GET /v1/me/notifications/{id} (19 §8.3).

interface NotificationFetchResponse

record

record: NotificationRecord

badge

badge: number

The account's badge for the calling device.

display

display: { previews: PreviewsSetting }

The user's current global previews; unknown values are treated as sender_only.

Source: wire/notifications.ts:413

NotificationKeyEntry interface

One history key in the notification key subset (08 §13.5).

interface NotificationKeyEntry

gen

gen: number

epoch

epoch: number

ekid

ekid: string

khist

khist: string

learnedAt

learnedAt: string

Source: wire/device-setup.ts:613

NotificationKeySubset interface

The notification key subset a notification extension may read (08 §13.5).

interface NotificationKeySubset

v

v: 1

addr

addr: string

did

did: string

contexts

contexts: ({ host: string; ctx: string; keys: NotificationKeyEntry[] })[]

senders

senders: ({ host: string; ctx: string; entries: ({ addr: string; did: string; dsks: string[] })[] })[]

updatedAt

updatedAt: string

Source: wire/device-setup.ts:623

NotificationKindInfo interface

One row of the kinds table (19 §5.3).

interface NotificationKindInfo

origin

readonly origin: "home" | "hosting" | "hosting_or_home"

Who produces it.

inNotifyEvent

readonly inNotifyEvent: boolean

Whether it may appear in a notify.event.

createsRecord

readonly createsRecord: boolean

Whether it creates a NotificationRecord of its own.

pushType

readonly pushType: PushType | null

The push type of its record, or null where 19 §6.3, §14.3 decide per case.

coalesced

readonly coalesced: boolean

Whether it goes through the 30 s notification window (19 §4.5).

Source: wire/notifications.ts:37

NotificationLevelUnsupportedData interface

data of notification.level_unsupported (19 §17.3).

interface NotificationLevelUnsupportedData

level

level: string

allowed

allowed: string[]

Source: wire/notifications.ts:776

NotificationListPage interface

One page of GET /v1/me/notifications (19 §8.3).

interface NotificationListPage

items

items: NotificationRecord[]

nextCursor

nextCursor: string | null

badge

badge: number

The calling device's badge (19 §15.1).

Source: wire/notifications.ts:405

NotificationRecord interface

A NotificationRecord (19 §8.1), stored only at the home server.

interface NotificationRecord

id

id: string

UUIDv7; the h of the push payload.

kind

kind: NotificationKind

state

state: NotificationState

silent

silent: boolean

Created without push or alerting (19 §6.2).

host

host: string | null

Null for pairing_request, account_alert and test.

hostApi

hostApi: string | null

The hosting server's base URL as the home server resolved it; null when host is null.

ctx

ctx: CtxRef | null

ctxKind

ctxKind: NotifyContextKind | null

ctxName

ctxName: string | null

ctxAddr

ctxAddr: string | null

community

community: NotifyCommunity | null

security

security: NotifySecurity | null

sender

sender: NotifySender | null

items

items: NotifyItem[]

Empty for kinds without items.

count

count: number

0 for kinds without items.

otherSenders

otherSenders: number

preview

preview: NotifyPreview | null

Always null in secure contexts.

ticket

ticket: EventTicketRef | null

Null for non-enrolled devices in secure contexts (PD-19-16) and after expiry (19 §8.4).

call

call: RecordCall | null

dmRequest

dmRequest: { requestId: string } | null

pairing

pairing: { pairingId: string } | null

alert

alert: { code: string } | null

account_alert: the warning ID, W4a in v1.

targets

targets: string[] | null

Device IDs the record is for; null means every device.

eventAt

eventAt: string

pushedAt

pushedAt: string | null

createdAt

createdAt: string

updatedAt

updatedAt: string

Source: wire/notifications.ts:349

NotificationS2SEvents interface

S2S events of 19 (19 §16.2). Not part of the client EventMap (DESIGN.md).

interface NotificationS2SEvents

notify.event

notify.event: NotifyEventPayload

Source: wire/notifications.ts:222

NotificationSettings interface

Global NotificationSettings (19 §7.1).

interface NotificationSettings

enabled

enabled: boolean

Master switch (rule H1). Default true.

previews

previews: PreviewsSetting

Default full.

channels

channels: string & {} | "mentions" | "nothing"

Default level for channels: mentions or nothing. Default mentions.

dms

dms: string & {} | "all" | "mentions" | "nothing"

Default level for 1:1 DMs: all, mentions or nothing. Default all.

groupDms

groupDms: string & {} | "all" | "mentions" | "nothing"

Default level for group DMs. Default all.

everyone

everyone: boolean

Whether "everyone" mentions notify. Default true.

calls

calls: boolean

Whether DM calls ring. Default true.

version

version: number

Read-only; increases by 1 on every change.

updatedAt

updatedAt: string | null

Read-only.

Source: wire/notifications.ts:237

NotificationStateChanged interface

notification.state_changed (19 §16.1): at most 100 IDs; may be empty for this device.

interface NotificationStateChanged

ids

ids: string[]

state

state: NotificationState

badge

badge: number

Source: wire/notifications.ts:661

NotificationWindowState interface

State of one (recipient, context) notification window (19 §4.5).

interface NotificationWindowState

state

state: "idle" | "open"

pending

pending: NotifyTrigger[]

Triggers held for the next aggregate, oldest first.

deadline

deadline: number | null

Epoch ms; null while idle.

Source: api/notifications.ts:518

NotifiedEventsResponse interface

Response of GET {host}/v1/me/notifications/events (19 §8.6): the notified events in their current form, as event envelopes (00 §7.4), seq order.

interface NotifiedEventsResponse

ctx

ctx: CtxRef

items

items: Envelope<string, unknown>[]

Event envelopes with ctx and seq; d is typed by 11 (Message objects, tombstones).

readSeq

readSeq: number

The recipient's current readSeq in the context (11 §9.1).

Source: wire/notifications.ts:443

NotifyAccountSender interface

The sender of a trigger when it is an account (19 §4.4, §5.2): an AddressRef (01 §6.7) with kind. name is optional in an AddressRef (01 §6.7), and null when the home server's display-name check failed (01 §6.4 server rule, 19 §5.6); either way a receiver shows the prepared local part (01 §6.5). Unknown kind values are treated as user.

interface NotifyAccountSender

addr

addr: string

name?

name?: string | null

kind

kind: "bot" | string & {} | "user"

Source: wire/notifications.ts:79

NotifyAggregate interface

The aggregate members of a message-kind notify.event (19 §4.5 "Aggregation", §5.2).

interface NotifyAggregate

sender

sender: NotifySender

The latest trigger's sender.

at

at: string

The latest trigger's at.

items

items: NotifyItem[]

The last 20 triggers, oldest first.

count

count: number

All triggers aggregated, not only the 20 listed.

otherSenders

otherSenders: number

Distinct senders other than the latest one.

Source: api/notifications.ts:410

NotifyCommunity interface

The community of a channel context (19 §5.2): at most 100 scalar values.

interface NotifyCommunity

name

name: string

Source: wire/notifications.ts:131

NotifyEventPayload interface

The d of the S2S event notify.event (19 §5.2). Hosting server → recipient's home server. Kind-dependent members are present only for their kinds (§5.2 "Kind-dependent members").

interface NotifyEventPayload

recipient

recipient: string

Canonical address of the account to notify, homed at the receiver.

kind

kind: string & {} | NotifyEventKind

host

host: string

The hosting server's canonical domain; equals the S2S token's iss.

ctx

ctx: CtxRef

ctxKind

ctxKind: NotifyContextKind

ctxName

ctxName: string | null

Channel or group DM name; null for a 1:1 DM or unnamed group. At most 100 scalar values.

ctxAddr

ctxAddr: string | null

The channel's canonical address for channel; null otherwise.

community

community: NotifyCommunity | null

security

security: NotifySecurity

sender?

sender?: NotifySender

Required except for withdrawn.

at

at: string

items?

items?: NotifyItem[]

Message kinds: 1–20 items, oldest first.

count?

count?: number

Message kinds: number of triggers represented, ≥ items.length.

otherSenders?

otherSenders?: number

Message kinds: distinct senders other than sender.

preview?

preview?: NotifyPreview | null

Message kinds, insecure only. Absent ≡ null.

ticket?

ticket?: EventTicketRef

Message kinds.

call?

call?: NotifyRingCall | NotifyRingEndedCall

Call kinds.

withdrawn?

withdrawn?: string[]

withdrawn: 1–50 mids.

previewOnly?

previewOnly?: boolean

withdrawn only: true when only previews are withdrawn (edit). Default false.

Source: wire/notifications.ts:180

NotifyItem interface

One trigger aggregated in a notify.event or record (19 §5.2 NotifyItem).

interface NotifyItem

seq

seq: number

The triggering event's seq in the context.

mid

mid: string

The root message's mid, or for an edit that newly mentions the recipient, the edit entry's mid (11 §8.2).

kind

kind: string & {} | MessageNotificationKind

The item's own kind; unknown values are treated as dm_message.

sender

sender: NotifySender

at

at: string

Source: wire/notifications.ts:119

NotifyPreview interface

A preview of the latest triggering message, insecure contexts only (19 §4.8).

interface NotifyPreview

text

text: string

At most 140 Unicode scalar values, line breaks replaced by spaces; ends in U+2026 when truncated.

attachments

attachments: number

Number of attachments on the message (0 if none).

Source: wire/notifications.ts:103

NotifyRingCall interface

call of a call_ring notify.event (19 §5.2).

interface NotifyRingCall

callId

callId: string

video

video: boolean

expiresAt

expiresAt: string

This ring's expiry for this recipient (the RingTarget expiresAt of 15 §2.5.3).

Source: wire/notifications.ts:139

NotifyRingEndedCall interface

call of a call_ring_ended notify.event (19 §5.2).

interface NotifyRingEndedCall

callId

callId: string

expiresAt

expiresAt: string

The expiry of the ring that ended; identifies the ring (15 §13.3).

reason

reason: RingEndReason

Source: wire/notifications.ts:147

NotifyTrigger interface

One trigger as the hosting server holds it in a notification window (19 §4.5).

interface NotifyTrigger extends NotifyItem

seq

seq: number

The triggering event's seq in the context.

mid

mid: string

The root message's mid, or for an edit that newly mentions the recipient, the edit entry's mid (11 §8.2).

kind

kind: string & {} | MessageNotificationKind

The item's own kind; unknown values are treated as dm_message.

sender

sender: NotifySender

at

at: string

Source: api/notifications.ts:407

NotifyTriggered interface

notify.triggered (19 §4.4): ephemeral, on the hosting server's me stream, to every connected session of the recipient. A client MUST NOT show an operating-system notification for it.

interface NotifyTriggered

ctx

ctx: CtxRef

kind

kind: string & {} | MessageNotificationKind

Unknown values are treated as dm_message for display.

seq

seq: number

mid

mid: string

sender

sender: NotifySender

at

at: string

Source: wire/notifications.ts:162

NotifyWebhookSender interface

The sender of a message posted through a webhook (11 §15.4, 19 §4.4): no addr.

interface NotifyWebhookSender

kind

kind: "webhook"

webhook

webhook: string

The webhook's ID.

name

name: string | null

Source: wire/notifications.ts:86

NotMemberData interface

data of member.not_member (09 §9.3 H5, §15.2).

interface NotMemberData

joinPolicy

joinPolicy: JoinPolicy

requireRulesAcceptance

requireRulesAcceptance: boolean

Source: wire/communities.ts:1006

OAuthProblem interface

A problem at /v1/auth/par and /v1/auth/token: RFC 9457 plus the RFC 6749 error and error_description members (05 §7.1, §7.8).

interface OAuthProblem extends Problem

error?

error?: OAuthTokenError

error_description?

error_description?: string

type

type: string

urn:sloppyv:error: + code. Clients key on code, not type (03 §10.1).

code

code: string

The registered error code, <area>.<reason> (03 §10.4).

title

title: string

Short English summary, at most 200 characters. Never parsed; render as plain text only.

status

status: number

The HTTP status; over HTTP it equals the response status (03 §10.1).

detail?

detail?: string

Human-readable detail, at most 1,000 characters. Plain text only.

instance?

instance?: string

urn:uuid:<UUIDv7> identifying this occurrence, for diagnostics and "contact the admin" (03 §10.1 rule 4).

retryable

retryable: boolean

Whether the same request may succeed later without any change.

retryAfterMs?

retryAfterMs?: number | null

The minimum delay before retrying; absent or null means no hint. Required for core.rate_limited.

userAction

userAction: UserAction

The one-tap fix (03 §10.2).

data?

data?: Record<string, unknown>

Code-specific structured data, defined by the code's owner.

Source: wire/accounts.ts:496

OutboxContext interface

Context for outboxDecision.

interface OutboxContext

kind

kind: "message" | "edit" | "reaction" | "delete"

The item's kind.

secureReady?

secureReady?: boolean

The account is secure and this device enrolled, so it can re-encode for a secure context itself (11 §4.7).

Source: api/messages.ts:519

OutboxDecision interface

What the outbox does after a failed post (11 §13.3).

interface OutboxDecision

state

state: OutboxState

The item's next state.

retryAfterMs

retryAfterMs: number | null

Wait at least this long before the next attempt (from retryAfterMs or Retry-After), or null.

action?

action?: "join_channel" | "reseal" | "reencode_secure" | "reupload_attachments" | "find_successor"

A step the client takes itself before resending with the same mid: join the channel (channel.join_required, 11 §13.3), re-seal under the current epoch or re-encode for a secure context (11 §13.4 rule 3), re-upload expired attachments, or look for the closed DM's successor (11 §13.3).

existingMid?

existingMid?: string

For a reaction answered 409 reaction.already_exists: the existing entry's mid, which the client records as its entry (11 §6.5).

Source: api/messages.ts:502

OutboxItem interface

One outbox record (11 §13.2). Stored by the client; never sent as such.

interface OutboxItem

mid

mid: string

ctx

ctx: CtxRef

server

server: string

The hosting server's base URL or domain.

kind

kind: "message" | "edit" | "reaction" | "delete"

target?

target?: string

content

content: ContentObject

The content object (plaintext).

composedMode

composedMode: ComposedMode

lastBody?

lastBody?: PostEntry

The exact PostEntry last sent, if any.

attempted

attempted: boolean

Whether any request was sent whose outcome is unknown or failed in transit.

queuedAt

queuedAt: string

When the user created it (RFC 3339).

state

state: OutboxState

lastError?

lastError?: Record<string, unknown>

The last problem object received, if any.

Source: wire/messaging.ts:853

OverwriteChange interface

An overwrite change to check with checkOverwriteChange (10 §5.2, §7.5).

interface OverwriteChange

overwrites

overwrites: readonly OverwriteLike[]

The channel's current overwrites.

target

target: { type: "role"; roleId: string } | { type: "member"; member: MemberLike }

The role or member the overwrite is for.

allow

allow: readonly string[]

The new lists; both empty (or null) for a removal.

deny

deny: readonly string[]

Source: permissions.ts:676

OverwriteLike interface

What the algorithm needs of an overwrite (a subset of PermissionOverwrite, 10 §5.1).

interface OverwriteLike

targetType

targetType: string

roleId?

roleId?: string

address?

address?: string

allow

allow: readonly string[]

deny

deny: readonly string[]

Source: permissions.ts:170

OverwriteList interface

Response of GET /v1/roles/overwrites/{ctx} (not paged, 10 §7.5).

interface OverwriteList

items

items: PermissionOverwrite[]

Source: wire/moderation.ts:197

OverwriteRemovedEvent interface

permission.overwrite_removed payload (10 §13.2).

interface OverwriteRemovedEvent

targetType

targetType: OverwriteTargetType

roleId?

roleId?: string

address?

address?: string

Source: wire/moderation.ts:853

OverwriteSetEvent interface

permission.overwrite_set payload (10 §13.2).

interface OverwriteSetEvent

overwrite

overwrite: PermissionOverwrite

Source: wire/moderation.ts:849

OwnDevice interface

The parts of this device's own record that the W4d rule needs (05 §12.12).

interface OwnDevice

did

did: string

createdAt

createdAt: string

Source: auth/session.ts:745

OwnPresence interface

GET/PUT /v1/me/presence response (11 §11.2).

interface OwnPresence

status

status: string & {} | ChosenStatus

statusText

statusText: string | null

statusEmoji

statusEmoji: string | null

clearAt

clearAt: string | null

idle

idle: boolean

The calling session's idle flag.

effective

effective: EffectiveStatus

The effective status others currently see on this server.

updatedAt

updatedAt: string

Source: wire/messaging.ts:662

OwnPresenceUpdate interface

The body of PUT /v1/me/presence (11 §11.2). If any of status, statusText, statusEmoji or clearAt is present, all four MUST be.

interface OwnPresenceUpdate

status?

status?: ChosenStatus

statusText?

statusText?: string | null

statusEmoji?

statusEmoji?: string | null

clearAt?

clearAt?: string | null

idle?

idle?: boolean

Source: wire/messaging.ts:678

Pager interface

A lazily fetched list: iterate it with for await to walk every page, or call page() for the first page only.

interface Pager<T, P> extends AsyncIterable<T>

page

page(): Promise<P>

Fetch the first page (the one the given parameters describe).

pages

pages(): AsyncIterable<P>

Iterate page by page instead of item by item.

Source: core/pagination.ts:23

PairingEndedData interface

data of pairing.ended (08 §15).

interface PairingEndedData

state

state: PairingState

endReason

endReason: PairingEndReason | null

Source: wire/device-setup.ts:760

PairingMessageAccepted interface

Response 202 of POST …/messages (08 §6.4.4).

interface PairingMessageAccepted

n

n: number

Source: wire/device-setup.ts:266

PairingMessageBodies interface

The pairing protocol message types and their bodies (08 §6.6.2).

interface PairingMessageBodies

cpace_a

cpace_a: CpaceABody

cpace_b

cpace_b: CpaceBBody

confirm_a

confirm_a: ConfirmABody

payload

payload: PairingPayloadBody

ack

ack: AckBody

abort

abort: AbortBody

Source: wire/device-setup.ts:248

PairingMessageEvent interface

d of pairing.message (08 §14.1).

interface PairingMessageEvent extends PairingMessageItem

n

n: number

type

type: string & {} | keyof PairingMessageBodies

from

from: string

The sender's did.

body

body: Record<string, unknown>

sentAt

sentAt: string

RFC 3339 time the server accepted the message.

pairingId

pairingId: string

Source: wire/device-setup.ts:650

PairingMessageItem interface

One message from GET …/messages?after={n} (08 §6.4.4). Unknown types are possible from newer peers.

interface PairingMessageItem

n

n: number

type

type: string & {} | keyof PairingMessageBodies

from

from: string

The sender's did.

body

body: Record<string, unknown>

sentAt

sentAt: string

RFC 3339 time the server accepted the message.

Source: wire/device-setup.ts:271

PairingMessageList interface

Response of GET …/messages (08 §6.4.4).

interface PairingMessageList

items

items: PairingMessageItem[]

Source: wire/device-setup.ts:282

PairingPayloadBody interface

Body of payload (08 §6.6.2, §6.7).

interface PairingPayloadBody

nonce

nonce: string

base64url of 12 bytes.

ct

ct: string

base64url of the AES-256-GCM ciphertext and tag.

Source: wire/device-setup.ts:223

PairingPayloadPlaintext interface

The decrypted pairing payload (08 §6.7.2): the backup payload members plus both dids.

interface PairingPayloadPlaintext extends KeyBackupPayload

v

v: number

addr

addr: string

igen

igen: number

ik

ik: string

base64url of the 32-byte Ed25519 seed of the identity key.

idc

idc: string

The IdentityCertificate JWS, exactly as registered.

vaultIdKey

vaultIdKey: string

base64url of K_vid (32 bytes).

vaultKeys

vaultKeys: PayloadVaultKey[]

phrase

phrase: string

base64url of the phrase entropy E (10 bytes).

phraseId

phraseId: string

base64url of the 16-byte phrase ID.

createdAt

createdAt: string

RFC 3339.

approverDid

approverDid: string

newDid

newDid: string

Source: wire/device-setup.ts:287

PairingQrPayload interface

The contents of a pairing QR code (08 §6.3.1).

interface PairingQrPayload

displayer

displayer: PairingRole

new_device (direction A, 0x01) or enrolled_device (direction B, 0x02).

pairingId

pairingId: string

The pairing session's UUIDv7.

secret

secret: Uint8Array

The 16-byte QR secret.

addr

addr: string

The account's canonical address.

Source: api/pairing.ts:93

PairingSession interface

The PairingSession object (08 §6.2).

interface PairingSession

id

id: string

UUIDv7 pairingId.

state

state: PairingState

displayer

displayer: PairingRole

createdBy

createdBy: PairingRole

newDevice

newDevice: DeviceSummary | null

approver

approver: DeviceSummary | null

createdAt

createdAt: string

expiresAt

expiresAt: string

createdAt + 10 min, or the finishing deadline once confirmed.

endedAt

endedAt: string | null

endReason

endReason: PairingEndReason | null

Source: wire/device-setup.ts:163

PairingSessionList interface

Response of GET /v1/me/pairing (08 §6.4.2): at most 3 items, no pagination.

interface PairingSessionList

items

items: PairingSession[]

Source: wire/device-setup.ts:185

ParsedGroupId interface

The parts of a group_id (13 §4.1).

interface ParsedGroupId

host

host: string

The hosting server's canonical domain (lowercase A-label).

ctx

ctx: string

The context reference (ch:…, dm:… or gdm:…).

generation

generation: number

1 to 2,147,483,647.

Source: mls/provider.ts:164

ParsedHomeAssertion interface

A HomeAssertion whose structure and claims passed 06 §6.3 V1–V3 and V7.

interface ParsedHomeAssertion

header

header: HomeAssertionHeader

claims

claims: HomeAssertionClaims

compact

compact: string

The exact compact string, to present unchanged.

Source: auth/remote.ts:334

ParsedKeyPackage interface

A parsed KeyPackage (RFC 9420 §10).

interface ParsedKeyPackage

version

version: number

cipherSuite

cipherSuite: number

initKey

initKey: Uint8Array

leafNode

leafNode: ParsedLeafNode

extensions

extensions: MlsExtension[]

signature

signature: Uint8Array

tbs

tbs: Uint8Array

KeyPackageTBS (every field before the signature).

bytes

bytes: Uint8Array

The whole KeyPackage struct, as hashed by KeyPackageRef.

Source: mls/provider.ts:987

ParsedKeyRotation interface

A KeyRotation decoded without verification (02 §12.1).

interface ParsedKeyRotation

compact

compact: string

The exact compact JWS.

header

header: KeyRotationHeader

claims

claims: KeyRotationClaims

Source: discovery/keychain.ts:50

ParsedLeafNode interface

A parsed LeafNode (RFC 9420 §7.2).

interface ParsedLeafNode

encryptionKey

encryptionKey: Uint8Array

signatureKey

signatureKey: Uint8Array

credential

credential: Uint8Array

The raw Credential bytes.

credentialType

credentialType: number

svDevice?

svDevice?: SvDeviceCredential

For sv_device, the decoded certificates.

capabilities

capabilities: MlsCapabilities

source

source: number

1 key_package, 2 update, 3 commit.

lifetime?

lifetime?: { notBefore: bigint; notAfter: bigint }

Only for source key_package: seconds since the epoch.

extensions

extensions: MlsExtension[]

signature

signature: Uint8Array

tbs

tbs: Uint8Array

The LeafNodeTBS for source key_package (the fields before the signature).

Source: mls/provider.ts:967

ParsedProposalMessage interface

A parsed proposal PublicMessage (RFC 9420 §6.2).

interface ParsedProposalMessage

wireFormat

wireFormat: number

groupId

groupId: Uint8Array

epoch

epoch: bigint

senderType

senderType: number

senderIndex

senderIndex: number | null

leaf_index for member, sender_index for external, otherwise null.

authenticatedData

authenticatedData: Uint8Array

proposalType

proposalType: number

removed?

removed?: number

For Remove: the removed leaf index.

extensions?

extensions?: MlsExtension[]

For GroupContextExtensions: the new extension list.

proposal

proposal: Uint8Array

The raw Proposal bytes (type and body).

framedContent

framedContent: Uint8Array

The raw FramedContent bytes.

signature

signature: Uint8Array

membershipTag

membershipTag: Uint8Array<ArrayBufferLike> | null

membership_tag (member senders only), else null.

Source: mls/provider.ts:772

Participant interface

One seat of a call (15 §2.5.2).

interface Participant

pid

pid: number

Participant index, 0–65535, unique within the call.

addr

addr: string

Canonical address of the account.

name

name: string

Display name. Clients MUST check it against addr (01, D-031) before showing it anywhere.

did

did: string

Device ID of the participating device.

kind

kind: ParticipantKind

user or bot; unknown values are user.

state

state: SeatState

connecting, connected or reconnecting; unknown values are connecting.

joinedAt

joinedAt: string

When this participation was admitted; a restored seat keeps it.

selfMuted

selfMuted: boolean

selfDeafened

selfDeafened: boolean

mutedForEveryone

mutedForEveryone: boolean

A moderator applied Mute for everyone, or a ServerMute applies (15 §3.6 rule 5).

sources

sources: Sources

leafIndex

leafIndex: number | null

Secure calls: the device's MLS leaf index (a hint, 15 §17 item 3). Null in insecure calls.

Source: wire/calls.ts:342

ParticipantPatch interface

PATCH /v1/contexts/{ctx}/call/participants/{pid} request: any subset (15 §3.5).

interface ParticipantPatch

selfMuted?

selfMuted?: boolean

selfDeafened?

selfDeafened?: boolean

A client that deafens also mutes; the server doesn't enforce this.

sources?

sources?: Partial<Sources>

What the device is starting or stopping to send. screen/webcam need video in the lease, screenAudio needs audio.

Source: wire/calls.ts:537

PayloadVaultKey interface

One vault key in a backup or pairing payload (08 §5.2).

interface PayloadVaultKey

vgen

vgen: number

key

key: string

base64url of 32 bytes.

Source: wire/device-setup.ts:86

PeerPin interface

PeerPin: the wire form of a server's pin record (02 §10.1, §10.5).

interface PeerPin

domain

domain: string

state

state: string & {} | PeerPinState

Unknown values: treat as suspended.

canonicalDomain

canonicalDomain: string

baseUrl

baseUrl: string

secure

secure: boolean

evidence

evidence: string & {} | DelegationEvidence

Unknown values: treat as dns-only.

keys

keys: PeerPinKey[]

revoked

revoked: string[]

Revoked thumbprints.

firstSeenAt

firstSeenAt: string

changedAt

changedAt: string

lastVerifiedAt

lastVerifiedAt: string

suspendedAt?

suspendedAt?: string

When suspended.

reason?

reason?: string & {} | PinConflictReason

When suspended.

observed?

observed?: PeerPinObserved

When suspended.

Source: wire/discovery.ts:331

PeerPinKey interface

One key in a PeerPin (02 §10.5). Unknown purpose or status: show as unknown.

interface PeerPinKey

kid

kid: string

thumbprint

thumbprint: string

purpose

purpose: string & {} | ServerKeyPurpose

status

status: string & {} | ServerKeyStatus

Source: wire/discovery.ts:312

PeerPinObserved interface

The rejected candidate of a suspended pin (02 §10.5).

interface PeerPinObserved

baseUrl

baseUrl: string

canonicalDomain

canonicalDomain: string

secure

secure: boolean

evidence

evidence: string & {} | DelegationEvidence

keys

keys: PeerPinKey[]

observedAt

observedAt: string

RFC 3339.

Source: wire/discovery.ts:320

PeerResumedPayload interface

discovery.peer_resumed payload (02 §16.3).

interface PeerResumedPayload

domain

domain: string

how

how: string & {} | PeerResumedHow

baseUrl

baseUrl: string

Source: wire/discovery.ts:403

PendingAuthorization interface

One authorization in progress (05 §6). Plain JSON: a web client stores it in sessionStorage before navigating and removes it on return (05 §6.8). It holds the PKCE verifier, so it must not be logged or put in a URL.

interface PendingAuthorization

intent

intent: AuthIntent

issuer

issuer: string

The home server's base URL, which iss must equal (05 §6.6).

clientId

clientId: string

redirectUri

redirectUri: string

state

state: string

codeVerifier

codeVerifier: string

authorizeUrl

authorizeUrl: string

Open this in the system browser (native) or by top-level navigation (web).

requestUriExpiresAt?

requestUriExpiresAt?: number

When the pushed request_uri expires (Unix ms), if one was used.

Source: auth/oauth.ts:501

PendingProposals interface

GET /v1/contexts/{ctx}/mls/proposals response (13 §7.7).

interface PendingProposals

epoch

epoch: number

The current epoch.

items

items: ServerProposal[]

Source: wire/mls.ts:502

PendingWelcome interface

GET /v1/contexts/{ctx}/mls/welcome response (13 §7.9; unnamed in the spec).

interface PendingWelcome

groupId

groupId: string

generation

generation: number

epoch

epoch: number

The epoch the device joins at.

welcome

welcome: string

The Welcome (mls_welcome, base64url), always with the ratchet tree.

addedBy

addedBy: MlsDeviceRef

Source: wire/mls.ts:533

PermissionChangedEvent interface

permission.changed payload: a hint; clients still recompute (10 §13.2).

interface PermissionChangedEvent

ctx

ctx: string | null

permissions

permissions: Permission[]

Source: wire/moderation.ts:859

PermissionDefinition interface

One registry row (10 §3.1).

interface PermissionDefinition

name

readonly name: KnownPermission

The permission name (10 §3.3 grammar).

scope

readonly scope: PermissionScope

channel (rows 1–12, overwritable) or community (rows 13–20) (10 §3.2).

inEveryoneByDefault

readonly inEveryoneByDefault: boolean

Whether the everyone role holds it when a community is created (10 §3.1, §4.2).

Source: permissions.ts:29

PermissionForbiddenData interface

data of 403 core.forbidden for a missing registry permission or the admin role (10 §6.3).

interface PermissionForbiddenData

permission?

permission?: Permission

missingRole?

missingRole?: "admin"

ctx?

ctx?: string

Source: wire/moderation.ts:1068

PermissionInput interface

Input of computePermissions.

interface PermissionInput

member

member: MemberLike

The member m.

roles

roles: readonly RoleLike[]

Every role of the community, system roles included (GET /v1/roles).

channel?

channel?: { overwrites: readonly OverwriteLike[] } | null

The channel c with its overwrites (GET /v1/roles/overwrites/{ctx}), or null/absent for community level.

policy?

policy?: { newMember?: NewMemberPolicyLike } | null

The community's AntiSpamPolicy (or just its newMember), for modifier c (10 §6.2). Without it the new-member restriction isn't applied; a policy without newMember uses the defaults of 10 §12.2.

now?

now?: number | Date

The time to evaluate timeouts and restrictions at (10 §6.2); default Date.now(). Use the server-corrected clock where you have one.

Source: permissions.ts:202

PermissionListData interface

data of permission.unknown and permission.not_held (10 §14).

interface PermissionListData

permissions

permissions: Permission[]

Source: wire/moderation.ts:1036

PermissionOverwrite interface

A per-channel permission overwrite for one role or one member (10 §5.1).

interface PermissionOverwrite

ctx

ctx: string

The channel (ch:…).

targetType

targetType: OverwriteTargetType

roleId?

roleId?: string

When targetType is role.

address?

address?: string

When targetType is member: canonical address.

allow

allow: Permission[]

Channel-scoped permissions granted.

deny

deny: Permission[]

Channel-scoped permissions removed.

updatedAt

updatedAt: string

updatedBy

updatedBy: string

Canonical address of the last actor.

Source: wire/moderation.ts:173

PersistedRemoteSession interface

A remote session as persisted: the session with its token, and the base URL that issued it (02 §10.6 token binding).

interface PersistedRemoteSession

baseUrl

baseUrl: string

The normalized base URL the token is bound to.

session

session: RemoteSessionWithToken

The session (06 §6.2).

Source: client.ts:192

PinCandidate interface

The successful resolution a pin is created from or compared with (02 §10.2's R).

interface PinCandidate

domain

domain: string

The queried domain D.

baseUrl

baseUrl: string

canonicalDomain

canonicalDomain: string

evidence

evidence: DelegationEvidence

metadata

metadata: { canonicalDomain: string; secure: boolean; keys: readonly ServerKey[]; keyChain: readonly string[] }

The validated metadata (only these members are read).

Source: discovery/pins.ts:54

PinChangeInfo interface

Passed to onPinChanged after an accepted pin change (logged with old and new values, 02 §10.2).

interface PinChangeInfo

domain

domain: string

previous

previous: ServerPinRecord

pin

pin: ServerPinRecord

baseUrlChanged

baseUrlChanged: boolean

Source: discovery/resolver.ts:97

PinConflictInfo interface

Passed to onPinConflict when a resolution would change a pin in a way 02 §10.2 rejects (02 §10.6).

interface PinConflictInfo

domain

domain: string

reason

reason: PinConflictReason

The first rejected difference (02 §10.2 order).

rejected

rejected: PinConflictReason[]

pin

pin: ServerPinRecord

The pin that was kept.

observed

observed: { baseUrl: string; canonicalDomain: string; secure: boolean; evidence: DelegationEvidence }

What the resolution produced.

diagnostic

diagnostic: { domain: string; reason: PinConflictReason }

The data of the pin_conflict diagnostic report the client sends to its home server through /v1/diagnostics (02 §10.6, 15 §14.4).

Source: discovery/resolver.ts:80

PingPayload interface

relay.ping/relay.pong (15 §6.7).

interface PingPayload

n

n: number

Source: wire/calls.ts:779

PinnedKey interface

A key stored in a pin (02 §10.1), including its public key so that verifiers can check signatures with the stored keys (02 §11.6).

interface PinnedKey

x

x: string

base64url public key.

thumbprint

thumbprint: string

RFC 7638 thumbprint, base64url.

kid

kid: string

purpose

purpose: ServerKeyPurpose

status

status: "active" | "next" | "retired"

nbf

nbf: number

exp

exp: number

retiredAt?

retiredAt?: number

For a retired key.

Source: discovery/keychain.ts:35

PinRecord interface

A pin record: one contact's pinned identity key and verification state (07 §16.1). Stored in the AccountVault as a pin record (08 §8.6.2); writers keep members they don't understand.

interface PinRecord

addr

addr: string

The contact's canonical address.

inc

inc: string

The contact's account incarnation this record belongs to.

state

state: PinState

ik?

ik?: string

The pinned identity key, 32 bytes base64url. Absent in state new_account.

igen

igen: number

ver

ver: number

The highest IdentityState ver this record reflects.

kind

kind: IdentityKind

pendingIk?

pendingIk?: string

In verified_blocked: the new key waiting for the user's decision.

pendingIgen?

pendingIgen?: number

prevIk?

prevIk?: string

In changed and accepted: the key the most recent key change replaced.

prevIgen?

prevIgen?: number

wasVerified

wasVerified: boolean

verifiedAt?

verifiedAt?: string

In verified: RFC 3339 time of verification.

verifyMethod?

verifyMethod?: VerifyMethod

changeId?

changeId?: string

While a W2 is outstanding: thumb(new key) + ":" + igen, "insecure:" + igen or "account:" + inc.

w2Dismissed

w2Dismissed: boolean

firstSeenAt

firstSeenAt: string

updatedAt

updatedAt: string

Source: wire/identity.ts:353

Pkce interface

A PKCE verifier and its S256 challenge (05 §6.2, RFC 7636 §4).

interface Pkce

codeVerifier

codeVerifier: string

43–128 characters of [A-Za-z0-9-._~]; never reused.

codeChallenge

codeChallenge: string

BASE64URL(SHA-256(ASCII(code_verifier))), 43 characters.

codeChallengeMethod

codeChallengeMethod: "S256"

Source: auth/oauth.ts:135

PlainPostEntry interface

An insecure carrier (11 §4.3).

interface PlainPostEntry extends PostEntry

mid

mid: string

Client-generated UUIDv7; the idempotency key (11 §4.6).

kind?

kind?: EntryKind

Default message.

target?

target?: string

Required for edit, reaction and delete; absent for message.

mentions?

mentions?: string[]

Secure message and edit only: mention hint (11 §4.4).

mentionAll?

mentionAll?: boolean

Secure message and edit only: mention hint (11 §4.4).

attachmentIds?

attachmentIds?: string[]

Secure carrier: IDs of every attachment and thumbnail the encrypted content references (11 §4.3).

content

content: ContentObject

Insecure carrier: the content object for kind.

sealed?

sealed?: undefined

Secure carrier: a SealedMessage (14) whose plaintext is the padded content object.

Source: wire/messaging.ts:326

PlaintextCheckInput interface

Inputs to plaintextDecision.

interface PlaintextCheckInput

kind

kind: DmKind

computedSecurity

computedSecurity: "insecure" | "secure"

The security the client computed itself from IdentityStates it verified (12 §11.1).

reportedSecurity

reportedSecurity: DmSecurity

The Dm's security as the hosting server reports it.

state

state: DmState

The Dm's state.

securePinned?

securePinned?: boolean

Group DMs: the client holds a secure-state pin (sec_pin, kind group_dm) for (host, ctx).

lastKnownSecure?

lastKnownSecure?: boolean

1:1 DMs: the client last knew this DM as secure.

peerDowngradeVerified?

peerDowngradeVerified?: boolean

1:1 DMs: the client has itself verified an IdentityState of the peer with sec: insecure and a ver higher than the one it held (12 §11.1).

Source: api/dms.ts:545

PlaintextRejectedData interface

data of channel.plaintext_rejected (09 §15.3).

interface PlaintextRejectedData

security

security: "secure"

upgradeSeq

upgradeSeq: number | null

null for a channel created secure, or while a server upgrade is being applied.

Source: wire/communities.ts:1047

PlanDirectDmInput interface

Inputs to planDirectDm.

interface PlanDirectDmInput

self

self: DmPartySecurity

The creator, with the sec of its own IdentityState.

peer

peer: DmPartySecurity

The peer, with the sec of the IdentityState the client fetched and verified (12 §7.1 step 2).

isSecureServer

isSecureServer: IsSecureServer

communityHints?

communityHints?: string[]

Up to 10 community domains (12 §7.1).

replaces?

replaces?: DmLink

The closed predecessor, for a successor (12 §13.3).

Source: api/dms.ts:340

PlanGroupDmInput interface

Inputs to planGroupDm.

interface PlanGroupDmInput

self

self: DmPartySecurity

The creator, with the sec of its own IdentityState.

participants

participants: readonly DmPartySecurity[]

The other initial participants (≥ 2), with verified sec.

isSecureServer

isSecureServer: IsSecureServer

name?

name?: string

communityHints?

communityHints?: string[]

replaces?

replaces?: DmLink

The closed predecessor, for a successor group (12 §13.3).

Source: api/dms.ts:391

PlanReconnectOptions interface

Options for planReconnect.

interface PlanReconnectOptions

inCall?

inCall?: boolean

The client participates in a call on this server: cap the delay after server_shutdown at 2 s (03 §5.10).

Source: core/backoff.ts:60

PolicyUpdatedEvent interface

moderation.policy_updated payload, filtered per recipient (10 §13.2).

interface PolicyUpdatedEvent

policy

policy: AntiSpamPolicy

Source: wire/moderation.ts:886

PolicyVersionConflictData interface

data of moderation.version_conflict (10 §12.2).

interface PolicyVersionConflictData

current

current: AntiSpamPolicy

Source: wire/moderation.ts:1048

PostEntry interface

The body of POST /v1/contexts/{ctx}/messages (11 §4.2). Exactly one of content (insecure carrier) and sealed (secure carrier) is present.

interface PostEntry

mid

mid: string

Client-generated UUIDv7; the idempotency key (11 §4.6).

kind?

kind?: EntryKind

Default message.

target?

target?: string

Required for edit, reaction and delete; absent for message.

content?

content?: ContentObject

Insecure carrier: the content object for kind.

sealed?

sealed?: SealedMessage

Secure carrier: a SealedMessage (14) whose plaintext is the padded content object.

mentions?

mentions?: string[]

Secure message and edit only: mention hint (11 §4.4).

mentionAll?

mentionAll?: boolean

Secure message and edit only: mention hint (11 §4.4).

attachmentIds?

attachmentIds?: string[]

Secure carrier: IDs of every attachment and thumbnail the encrypted content references (11 §4.3).

Source: wire/messaging.ts:306

Presence interface

What other people see (11 §11.3).

interface Presence

addr

addr: string

name

name: string

status

status: EffectiveStatus

statusText

statusText: string | null

null whenever status is offline.

statusEmoji

statusEmoji: string | null

null whenever status is offline.

updatedAt

updatedAt: string

Source: wire/messaging.ts:695

PresenceSession interface

One session of an account on a server, for effectiveStatus.

interface PresenceSession

connected

connected: boolean

Whether its event WebSocket is open now.

idle

idle: boolean

Its idle flag.

closedAtMs?

closedAtMs?: number

When its last WebSocket closed (ms), for a session that isn't connected.

Source: api/presence.ts:111

PresenceSnapshot interface

d of presence.snapshot (11 §11.5).

interface PresenceSnapshot

items

items: Presence[]

Accounts with access whose effective status isn't offline, at most 1,000.

truncated

truncated: boolean

true if more existed.

Source: wire/messaging.ts:707

PresenceStatusUpdate interface

The account-level members of a presence update, all four together (11 §11.2).

interface PresenceStatusUpdate

status

status: ChosenStatus

statusText

statusText: string | null

statusEmoji

statusEmoji: string | null

clearAt

clearAt: string | null

Source: wire/messaging.ts:687

Problem interface

An RFC 9457 problem object (03 §10.1, 00 §7.9). Carried in HTTP error bodies (application/problem+json), in WebSocket error envelopes (03 §6.3), in SubscriptionResult problem and in session.subscription_ended.

interface Problem

type

type: string

urn:sloppyv:error: + code. Clients key on code, not type (03 §10.1).

code

code: string

The registered error code, <area>.<reason> (03 §10.4).

title

title: string

Short English summary, at most 200 characters. Never parsed; render as plain text only.

status

status: number

The HTTP status; over HTTP it equals the response status (03 §10.1).

detail?

detail?: string

Human-readable detail, at most 1,000 characters. Plain text only.

instance?

instance?: string

urn:uuid:<UUIDv7> identifying this occurrence, for diagnostics and "contact the admin" (03 §10.1 rule 4).

retryable

retryable: boolean

Whether the same request may succeed later without any change.

retryAfterMs?

retryAfterMs?: number | null

The minimum delay before retrying; absent or null means no hint. Required for core.rate_limited.

userAction

userAction: UserAction

The one-tap fix (03 §10.2).

data?

data?: Record<string, unknown>

Code-specific structured data, defined by the code's owner.

Source: wire/transport.ts:51

ProviderLink interface

The ProviderLink object (05 §10.1).

interface ProviderLink

linkId

linkId: string

UUIDv7, server-generated.

provider

provider: string

Provider ID.

providerName

providerName: string

The provider's name at the time of the response.

label?

label?: string

A hint naming the provider account, at most 64 characters; shown only to the account holder.

enabled

enabled: boolean

Whether the provider is currently enabled.

linkedAt

linkedAt: string

Timestamp.

lastUsedAt?

lastUsedAt?: string | null

Last login, reauth or sign-up through this link. The §10.2 example shows null.

Source: wire/accounts.ts:223

ProviderLinkedPayload interface

auth.provider_linked payload (05 §18).

interface ProviderLinkedPayload

Source: wire/accounts.ts:704

ProviderUnlinkedPayload interface

auth.provider_unlinked payload (05 §18).

interface ProviderUnlinkedPayload

linkId

linkId: string

Source: wire/accounts.ts:709

PublicProfile interface

The public profile, GET /v1/users/{local}/profile (05 §17.1).

interface PublicProfile

address

address: string

Canonical address.

name

name: string

Display name; receivers apply 01's display-name check.

kind

kind: AccountKind

user or bot; unknown treated as bot.

inc

inc: string

The account's incarnation (05 §11.1).

about

about: string

As in 05 §11.1.

avatar

avatar: Avatar | null

The avatar, or null.

profileVersion

profileVersion: number

As in 05 §11.1.

Source: wire/accounts.ts:247

PublicReadOptions interface

Options of a read whose authentication is optional or absent (01 §9.2, 02 §6.1, 09 §3.5, §8.4). Each method documents its own default. The narrow union keeps an explicit credential out of it.

interface PublicReadOptions extends RequestOptions

signal?

signal?: AbortSignal

Cancels the request and any automatic retry (03 §2.7 item 3).

idempotencyKey?

idempotencyKey?: string

Sent as Idempotency-Key (03 §14.2). Create calls with a client-generated ID (mid) don't need it.

auth?

auth?: "none" | "session"

'session' sends the client's session credential; 'none' sends no Authorization.

Source: core/http.ts:46

PublicSuffixList interface

A Public Suffix List, applied to lowercase A-labels with both the ICANN and the PRIVATE sections (02 §9.1). Build one with parsePublicSuffixList from the official public_suffix_list.dat (clients bundle a copy with each release and SHOULD refresh it with app updates; servers MUST NOT use a copy older than 180 days, 02 §9.3).

interface PublicSuffixList

publicSuffix

publicSuffix(host: string): string

The public suffix of host (a lowercase A-label, no trailing dot).

host: string

Source: discovery/evidence.ts:20

PurgeEvent interface

d of message.purged (11 §8.2).

interface PurgeEvent

throughSeq

throughSeq: number

Every root message with seq ≤ throughSeq, and everything attached to it, is gone.

reason

reason: PurgeReason

Source: wire/messaging.ts:588

PushAppUnknownData interface

data of push.app_unknown (19 §11.2, §17.2).

interface PushAppUnknownData

appId

appId: string

Source: wire/notifications.ts:766

PushedAuthorizationRequest interface

Body of POST /v1/auth/par (05 §6.1).

interface PushedAuthorizationRequest extends AuthorizationParams

client_id

client_id: string

05 §5.1.

response_type

response_type: "code"

code.

redirect_uri

redirect_uri: string

05 §5.2.

code_challenge

code_challenge: string

BASE64URL(SHA-256(code_verifier)), 43 characters.

code_challenge_method

code_challenge_method: "S256"

S256; plain is refused.

state

state: string

Opaque, 1–512 characters, at least 128 random bits.

provider?

provider?: string

A provider ID from auth.providers; absent shows the server's chooser.

prompt?

prompt?: "select_account"

select_account only.

ui_locales?

ui_locales?: string

BCP 47 language tags for the server's pages.

intent?

intent?: "reauth" | "login"

login (default) or reauth; reauth needs Authorization: Bearer <access token>.

Source: wire/accounts.ts:308

PushedAuthorizationResponse interface

Response 201 of POST /v1/auth/par (05 §6.1).

interface PushedAuthorizationResponse

request_uri

request_uri: string

Single-use, valid 60 s.

expires_in

expires_in: number

Seconds; 60.

Source: wire/accounts.ts:314

PushedAuthorizeQuery interface

Query of GET /v1/auth/authorize when a pushed request is used (05 §6.2, RFC 9126 §4).

interface PushedAuthorizeQuery

client_id

client_id: string

request_uri

request_uri: string

Source: wire/accounts.ts:322

PushGatewayNotAllowedData interface

data of push.gateway_not_allowed (19 §17.2).

interface PushGatewayNotAllowedData

gateways

gateways: string[]

Source: wire/notifications.ts:746

PushPayload interface

The opaque push payload {"v":1,"h":…,"r":…}, always 93 octets serialized (19 §10.1).

interface PushPayload

v

v: 1

h

h: string

NotificationRecord id.

r

r: string

PushRegistration id.

Source: wire/notifications.ts:544

PushPlatformUnsupportedData interface

data of push.platform_unsupported (19 §11.2, §17.2).

interface PushPlatformUnsupportedData

platform

platform: string

Source: wire/notifications.ts:771

PushRegistration interface

A PushRegistration (19 §9.1), at the home server only.

interface PushRegistration

id

id: string

UUIDv7; the r of the push payload.

did

did: string

The owning device.

transport

transport: string & {} | PushTransport

types

types: (string & {} | PushType)[]

gatewayUrl?

gatewayUrl?: string

gateway only.

pushKey?

pushKey?: string

gateway only.

webPush?

webPush?: WebPushSubscriptionKeys

webpush only.

vapidKey?

vapidKey?: string

webpush only.

state

state: string & {} | "active" | "failing"

Unknown values are treated as failing.

lastDeliveredAt

lastDeliveredAt: string | null

lastError

lastError: string | null

createdAt

createdAt: string

updatedAt

updatedAt: string

fetchToken?

fetchToken?: string

Only in the POST and PUT responses that issue one; never returned by GET.

fetchTokenExpiresAt

fetchTokenExpiresAt: string

Source: wire/notifications.ts:472

PushRegistrationInvalidData interface

data of push.registration_invalid (19 §9.2).

interface PushRegistrationInvalidData

reason

reason: "transport" | string & {} | "keys" | "types" | "gateway_url" | "push_key" | "endpoint"

Source: wire/notifications.ts:741

PushRegistrationRemoved interface

push.registration_removed (19 §16.1).

interface PushRegistrationRemoved

id

id: string

did

did: string

Source: wire/notifications.ts:681

PushRequest interface

One push of POST {gatewayUrl}/v1/push (19 §11.3). Server side.

interface PushRequest

pushKey

pushKey: string

type

type: string & {} | PushType

payload

payload: PushPayload

At most 256 octets serialized; passed on unchanged.

ttlMs

ttlMs: number

0 to 86,400,000.

urgency

urgency: PushUrgency

collapseKey?

collapseKey?: string

1–64 base64url characters.

Source: wire/notifications.ts:585

PushResult interface

One result of POST {gatewayUrl}/v1/push (19 §11.3).

interface PushResult

status

status: PushResultStatus

error?

error?: Problem

A problem object (03 §10.1): with gone, rejected; MAY with deferred.

retryAfterMs?

retryAfterMs?: number

With deferred.

Source: wire/notifications.ts:606

PushTestResponse interface

Response of POST /v1/me/push-registrations/{id}/test (19 §9.2), status 202.

interface PushTestResponse

recordId

recordId: string

Source: wire/notifications.ts:535

PushTokenClaims interface

Claims of an sv-push+jwt (19 §11.4). Header: {"alg":"EdDSA","typ":"sv-push+jwt","kid":"<domain>#<keyId>"}.

interface PushTokenClaims

iss

iss: string

The home server's canonical domain.

aud

aud: string

normalize(gatewayUrl) (06 §8.3).

htm

htm: "POST"

htu

htu: string

normalize(gatewayUrl + "/v1/push") (06 §8.3).

bh

bh: string

Base64url SHA-256 of the request content (06 §8.4).

iat

iat: number

exp

exp: number

iat < exp ≤ iat + 60.

jti

jti: string

At least 16 random octets, base64url; single use.

Source: wire/notifications.ts:623

PushTooManyRegistrationsData interface

data of push.too_many_registrations (19 §9.2, §17.2): the device's maxPushRegistrationsPerDevice.

interface PushTooManyRegistrationsData

max

max: number

Source: wire/notifications.ts:751

PushTypeUnsupportedData interface

data of push.type_unsupported (19 §11.5 step 3, §17.2): the refused push type.

interface PushTypeUnsupportedData

type

type: string

Source: wire/notifications.ts:761

PushUnauthenticatedData interface

data of push.unauthenticated (19 §11.5, §17.2): the failed step's reason, as in 06 §8.5.

interface PushUnauthenticatedData

reason

reason: string

Source: wire/notifications.ts:756

PutCommunityListEntryRequest interface

PUT /v1/me/communities/{domain} body (09 §5.1).

interface PutCommunityListEntryRequest

name

name: string

iconUrl

iconUrl: string | null

secure

secure: boolean

state

state: CommunityListState

position?

position?: number

Default: last.

Source: wire/communities.ts:367

PutCommunityNotificationSettingsRequest interface

Body of PUT /v1/me/notifications/settings/communities/{host} (19 §7.2).

interface PutCommunityNotificationSettingsRequest

level

level: string & {} | "mentions" | "nothing" | "default"

muteUntil

muteUntil: string | null

everyone

everyone: boolean | null

Source: wire/notifications.ts:297

PutContextNotificationSettingsRequest interface

Body of PUT /v1/contexts/{ctx}/notification-settings?host= (19 §7.3).

interface PutContextNotificationSettingsRequest

level

level: NotificationLevel

muteUntil

muteUntil: string | null

everyone

everyone: boolean | null

calls

calls: boolean | null

Source: wire/notifications.ts:321

PutFederationBlockRequest interface

PUT /v1/federation/blocks/{domain} body (06 §12.4).

interface PutFederationBlockRequest

includeSubdomains?

includeSubdomains?: boolean

Default false.

note?

note?: string

At most 500 characters.

Source: wire/federation.ts:562

PutMuteRequest interface

PUT /v1/contexts/{ctx}/call/mutes/{addr} request (15 §3.6; 10 §8.2 rules 2 and 3).

interface PutMuteRequest

reason?

reason?: string

0–512 Unicode scalar values.

showReason?

showReason?: boolean

Whether the muted account is shown reason. Default false.

reportId?

reportId?: string

Source: wire/calls.ts:546

PutNotificationSettingsRequest interface

Body of PUT /v1/me/notifications/settings (19 §7.1): every writable member, plus optional ifVersion.

interface PutNotificationSettingsRequest

enabled

enabled: boolean

previews

previews: PreviewsSetting

channels

channels: string & {} | "mentions" | "nothing"

dms

dms: string & {} | "all" | "mentions" | "nothing"

groupDms

groupDms: string & {} | "all" | "mentions" | "nothing"

everyone

everyone: boolean

calls

calls: boolean

ifVersion?

ifVersion?: number

409 core.conflict if it differs from the stored version.

Source: wire/notifications.ts:259

QueriedDomainOptions interface

Options of checkQueriedDomain.

interface QueriedDomainOptions

allowSpecialUse?

allowSpecialUse?: boolean

Development setting that allows special-use names (02 §5.1). It MUST be off by default and MUST NOT be available in release builds of clients.

Source: discovery/domain.ts:38

RateLimitedData interface

data of core.rate_limited (03 §10.5, §15.2).

interface RateLimitedData

policy?

policy?: RateLimitPolicyName

The policy that was exceeded (03 §15.1).

Source: wire/transport.ts:151

RateLimitInfo interface

One policy of a RateLimit header (03 §15.2): remaining r, reset in t seconds.

interface RateLimitInfo

policy

policy: string

The policy name (03 §15.1).

remaining?

remaining?: number

Remaining quota (r).

resetSeconds?

resetSeconds?: number

Seconds until the quota resets (t).

params

params: Record<string, StructuredValue>

All parameters as received.

Source: core/http.ts:368

RateLimitPolicyInfo interface

One policy of a RateLimit-Policy header (03 §15.2): quota q per window w seconds.

interface RateLimitPolicyInfo

policy

policy: string

The policy name (03 §15.1).

quota?

quota?: number

Quota units per window (q).

windowSeconds?

windowSeconds?: number

Window in seconds (w).

params

params: Record<string, StructuredValue>

All parameters as received.

Source: core/http.ts:356

ReactionContent interface

Adds one reaction to a root message (11 §3.7.2).

interface ReactionContent

target

target: string

mid of the root message reacted to.

key

key: string

Exactly one emoji, at most 64 bytes of UTF-8.

Source: wire/messaging.ts:274

ReactionEntry interface

One reaction entry, in both modes (11 §5.3).

interface ReactionEntry

mid

mid: string

The reaction entry's mid; removing the reaction means deleting this mid.

target

target: string

The root message's mid.

seq?

seq?: number

Present in HTTP; omitted in events.

carrier

carrier: CarrierType

sender

sender: Sender

createdAt

createdAt: string

key?

key?: string

plain only.

sealed?

sealed?: SealedMessage

sealed only: kind reaction, ref the root's mid.

Source: wire/messaging.ts:397

ReactionExistsData interface

data of reaction.already_exists (11 §17.1): the existing entry.

interface ReactionExistsData

mid

mid: string

Source: wire/messaging.ts:525

ReactionRemovedEvent interface

d of reaction.removed (11 §8.2).

interface ReactionRemovedEvent

target

target: string

The removed reaction entry's mid.

message

message: string

The root message it was on.

by

by: DeletedBy

mid?

mid?: string

The delete entry's mid, when by is author.

Source: wire/messaging.ts:577

ReactionSummary interface

Aggregate of plain reaction entries with one key (11 §5.3).

interface ReactionSummary

key

key: string

The reaction key, as first sent.

count

count: number

Number of accounts with a live reaction entry with this key.

me?

me?: boolean

Whether the requesting account is among them. HTTP responses only.

Source: wire/messaging.ts:387

ReadState interface

One account's read position in one context (11 §9.1).

interface ReadState

ctx

ctx: CtxRef

readSeq

readSeq: number

Everything with seq ≤ readSeq counts as read; 0 means nothing read.

updatedAt

updatedAt: string | null

headSeq

headSeq: number

lastMessageSeq

lastMessageSeq: number

seq of the newest visible, non-deleted root message, or 0.

unreadCount

unreadCount: number

0 to 1,000.

unreadCapped

unreadCapped: boolean

true if the true count exceeds 1,000.

mentionCount

mentionCount: number

0 to 1,000.

Source: wire/messaging.ts:607

ReadStateUpdate interface

The body of PUT /v1/contexts/{ctx}/read (11 §9.2).

interface ReadStateUpdate

readSeq

readSeq: number

The new read position; values above headSeq are lowered to it.

markUnread?

markUnread?: boolean

If true, the position may move backwards ("Mark as unread"). Default false.

Source: wire/messaging.ts:624

ReauthRequiredData interface

data of auth.reauth_required (05 §9.1).

interface ReauthRequiredData

maxAgeMs

maxAgeMs: number

The operation's freshness limit.

providers

providers: string[]

The account's linked, enabled provider IDs.

Source: wire/accounts.ts:859

ReauthTokenResponse interface

The code exchange's answer for intent=reauth (05 §7.3): no refresh token; the session's refresh token stays valid.

interface ReauthTokenResponse

access_token

access_token: string

token_type

token_type: "Bearer"

expires_in

expires_in: number

authAt

authAt: string

The new authAt.

Source: wire/accounts.ts:453

RecomputableNotification interface

The message members of a record (or notify.event) that per-item processing recomputes (19 §6.2).

interface RecomputableNotification

kind

kind: NotificationKind

sender

sender: NotifySender | null

eventAt

eventAt: string

The record's eventAt (the event's at).

items

items: NotifyItem[]

count

count: number

otherSenders

otherSenders: number

preview

preview: NotifyPreview | null

Source: api/notifications.ts:454

ReconnectBackoffOptions interface

Options for ReconnectBackoff.

interface ReconnectBackoffOptions

clock?

clock?: Clock

Clock for the 60 s stability and 5 s wake rules. Default: the device clock.

random?

random?: () => number

Uniform [0, 1) source. Default: CSPRNG.

Source: core/backoff.ts:137

ReconnectPlan interface

The client's plan for a closed socket (03 §5.10).

interface ReconnectPlan

code

code: number

The close code the plan is for.

action

action: ReconnectAction

mode

mode: ReconnectDelayMode

minDelayMs

minDelayMs: number

Minimum delay set by the close code or retryAfterMs.

maxDelayMs?

maxDelayMs?: number

Maximum delay, for mode range.

diagnostic

diagnostic: boolean

Whether to record a diagnostic (protocol violations, 03 §5.10).

preferHeads?

preferHeads?: boolean

For 4011: move streams the user isn't viewing to heads (never a call's context, 03 §7.6).

problem?

problem?: Problem

The session.closing problem, if any (4001, 4004, 4026, 4029).

Source: core/backoff.ts:42

RecordCall interface

call of a call_ring or call_missed record (19 §8.1).

interface RecordCall

callId

callId: string

video

video: boolean

expiresAt

expiresAt: string

The ring's expiry.

state

state: string & {} | "ended" | "ringing"

Unknown values are treated as ended.

endReason

endReason: RingEndReason | null

Null while ringing; unknown values are treated as cancelled.

endedAt

endedAt: string | null

Source: wire/notifications.ts:336

RecoveryRecordPlaintext interface

Plaintext of the recovery record (08 §8.6.5).

interface RecoveryRecordPlaintext

t

t: "recovery"

phrase

phrase: string

base64url of E.

phraseId

phraseId: string

reason

reason: RecoveryReason

createdAt

createdAt: string

savedAt

savedAt: string | null

saveMethod

saveMethod: RecoverySaveMethod | null

lastNudgedAt

lastNudgedAt: string | null

Source: wire/device-setup.ts:495

RecoveryToken interface

One token of forgiving input (08 §4.3 step 4).

interface RecoveryToken

token

token: string

The token as typed (after normalization).

word

word: string | null

The resolved word, or null when unresolved.

Source: api/backup.ts:252

ReducedNotificationPayload interface

The reduced payload sent to sessions of devices not in a record's targets (19 §16.1): apply only the badge.

interface ReducedNotificationPayload

record

record: null

id

id: string

badge

badge: number

Source: wire/notifications.ts:648

ReferenceText interface

The text of notificationReferenceText: a line and an optional subtitle (19 §13.7).

interface ReferenceText

text

text: string

subtitle

subtitle: string | null

The community name, as the subtitle of channel notifications (19 §13.7).

Source: api/notifications.ts:979

ReferenceTextLabels interface

Display labels for notificationReferenceText, each overriding what the function derives from the record. A label given here is used as is, so it MUST already have passed the 01 §6.4 display-name check as 19 §13.1 D10 and §13.7 require.

interface ReferenceTextLabels

sender?

sender?: string | null

{Sender}. Default: for an account, the checked display name (01 §6.4), or the prepared local part when it is absent, null or fails (01 §6.5), as the display form with the domain when the domain must be shown (01 §4.4, D-031); for a webhook, its name (" (Webhook)" is always appended).

channel?

channel?: string | null

{channel} (without #). Default: ctxName checked against ctxAddr, or the local part of ctxAddr (19 §13.1 D10).

group?

group?: string | null

The group DM's name, or the participants' names when it has none. Default: ctxName.

address?

address?: string | null

dm_request: the sender's display form, domain always included (01 §6.6). Default: computed from sender.

Source: api/notifications.ts:946

ReferenceTextOptions interface

Options of notificationReferenceText (19 §13.1 D6, D9, D10; §13.7).

interface ReferenceTextOptions

previews?

previews?: PreviewsSetting

display.previews of the record fetch (19 §8.3). none gives the minimal text.

mentionUnconfirmed?

mentionUnconfirmed?: boolean

Step D9: the decrypted content doesn't support a mention item, so the "mentioned you" wording must not be used (19 §13.1 D9).

contextDomain?

contextDomain?: string

The context domain of 01 §4.4 the sender's domain is compared with (D-031): for notifications 01 §4.4 names the viewer's home server's canonical domain. When omitted, the derived {Sender} always carries the domain, which is never wrong (01 §4.4 rule 2 only permits leaving it out).

Source: api/notifications.ts:962

RefreshReusedData interface

data of auth.refresh_reused (05 §7.8, §19).

interface RefreshReusedData

did

did: string

Source: wire/accounts.ts:879

RefreshTokenGrantRequest interface

POST /v1/auth/token with grant_type=refresh_token (05 §7.6).

interface RefreshTokenGrantRequest

grant_type

grant_type: "refresh_token"

refresh_token

refresh_token: string

The current refresh token.

client_id

client_id: string

Must equal the client ID the family was issued to.

Source: wire/accounts.ts:394

RefreshTokenResponse interface

The answer to a refresh (05 §7.6): a new access token, a new refresh token and authAt.

interface RefreshTokenResponse

access_token

access_token: string

token_type

token_type: "Bearer"

expires_in

expires_in: number

refresh_token

refresh_token: string

authAt

authAt: string

Source: wire/accounts.ts:476

Refusal interface

A predicted refusal: the error code, HTTP status and data the server would answer with.

interface Refusal

code

code: string

status

status: number

data?

data?: Record<string, unknown>

Source: permissions.ts:402

RegisterDeviceRequest interface

Body of POST /v1/me/identity/devices, registering this device (07 §11.5).

interface RegisterDeviceRequest

deviceCertificate

deviceCertificate: string

expectedIgen

expectedIgen: number

Source: wire/identity.ts:217

RegisterDmRequest interface

Body of POST /v1/me/dms: register an outgoing DM (12 §9.3).

interface RegisterDmRequest

host

host: string

ctx

ctx: DmCtx

kind

kind: "direct" | "group"

Source: wire/dms.ts:372

RegistrationClosedData interface

data of auth.registration_closed (05 §7.3, §19).

interface RegistrationClosedData

reason

reason: RegistrationClosedReason

provider

provider: string

providerLabel?

providerLabel?: string

Source: wire/accounts.ts:867

RelayBadMessageData interface

relay.bad_message error data (15 §16.1).

interface RelayBadMessageData

t

t: string

Source: wire/calls.ts:1118

RelayClosing interface

relay.closing (15 §6.6).

interface RelayClosing

reason

reason: RelayClosingReason

retryAfterMs?

retryAfterMs?: number

Source: wire/calls.ts:795

RelayConnectIceServersResponse interface

POST {relayUrl}/connect response, 200, requesting a TURN-gathered offer (15 §6.2, §6.10.1).

interface RelayConnectIceServersResponse

iceServers

iceServers: TurnIceServer[]

iceServersId

iceServersId: string

iceServersExpiresAt

iceServersExpiresAt: string

Source: wire/calls.ts:676

RelayConnectRequest interface

POST {relayUrl}/connect request (15 §6.2, §6.10.1). Sent with Authorization: Bearer <RelayTicket>.

interface RelayConnectRequest

offer

offer: string

SDP offer with the three negotiated data channels of §6.4.

iceServersId?

iceServersId?: string

Opaque ID from a 200 ICE-servers response when submitting a TURN-gathered offer (15 §6.10.1).

Source: wire/calls.ts:660

RelayConnectResponse interface

POST {relayUrl}/connect response, 201 (15 §6.2).

interface RelayConnectResponse

answer

answer: string

The SDP answer, containing all of the relay's ICE candidates.

relaySessionId

relaySessionId: string

Opaque, at most 64 characters, for diagnostics.

Source: wire/calls.ts:668

RelayIceAnswer interface

relay.ice_answer: relay SDP answer to a relay.ice_restart offer (15 §6.10.3).

interface RelayIceAnswer

answer

answer: string

Source: wire/calls.ts:819

RelayIceRestart interface

relay.ice_restart: client ICE-restart SDP offer after receiving relay.ice_servers (15 §6.10.3).

interface RelayIceRestart

offer

offer: string

Source: wire/calls.ts:814

RelayIceServers interface

relay.ice_servers: refreshed TURN credentials for an active TURN relay session (15 §6.10.3).

interface RelayIceServers

iceServers

iceServers: TurnIceServer[]

iceServersExpiresAt

iceServersExpiresAt: string

Source: wire/calls.ts:808

RelayInfo interface

The relay to connect to and the ticket for it (15 §3.3.3, §5, §6).

interface RelayInfo

url

url: string

The relay URL (15 §6.1 item 3). Use this, never ServerMetadata endpoints.relayUrl.

ticket

ticket: string

A RelayTicket (sv-relay+jwt), single use, at most 60 s.

ticketExpiresAt

ticketExpiresAt: string

Source: wire/calls.ts:502

RelaySubscribe interface

relay.subscribe: which sources 1, 2, 3 this receiver wants (15 §6.6). Replaces the previous list.

interface RelaySubscribe

sources

sources: SourceRef[]

Source: wire/calls.ts:790

RelayTicketClaims interface

RelayTicket claims (15 §5.1).

interface RelayTicketClaims

iss

iss: string

The hosting server's canonical domain.

aud

aud: string

The relay URL, exactly as in the join response's relay.url.

sub

sub: string

Canonical address of the participant.

did

did: string

Device ID.

ctx

ctx: string

Context reference.

cid

cid: string

The callId.

pid

pid: number

Participant index.

sec

sec: CallSecurity

The call's security (never trusted by clients, 15 §2.1 item 4).

prof

prof: MediaProfile[]

Media profiles this session may use on the relay: a subset of voice-dc/1 and video-dc/1.

iat

iat: number

Issue time (NumericDate).

exp

exp: number

Expiry; at most iat + 60.

jti

jti: string

At least 128 random bits, base64url. Single use.

Source: wire/calls.ts:694

RelayTicketHeader interface

The protected header of a RelayTicket (15 §5.3, 04 §6.2).

interface RelayTicketHeader

alg

alg: "EdDSA"

typ

typ: "sv-relay+jwt"

kid

kid: string

domain#keyId of a hosting-server sign key.

Source: wire/calls.ts:686

RelayWelcome interface

relay.welcome: the relay's first message on a new session (15 §6.6).

interface RelayWelcome

callId

callId: string

pid

pid: number

relaySessionId

relaySessionId: string

maxInboundKbps

maxInboundKbps: number

Cap on everything this session may send, kbit/s; default 10,000.

Source: wire/calls.ts:770

RemoteSession interface

The RemoteSession object (06 §6.2). token and tokenType appear only in create and renew responses, never from GET …/sessions/current.

interface RemoteSession

sessionId

sessionId: string

UUIDv7, stable across renewals and extensions.

token?

token?: string

The opaque access token (06 §6.4). Only in create and renew responses. Clients never parse it.

tokenType?

tokenType?: "Bearer"

Always Bearer; only with token.

state

state: RemoteSessionState

account

account: RemoteSessionAccount

device

device: RemoteSessionDevice

secureAccess

secureAccess: SecureAccess

createdAt

createdAt: string

When the session was created.

verifiedAt

verifiedAt: string

When an assertion was last verified for it (creation or renewal).

expiresAt

expiresAt: string

When the session ends unless renewed or extended.

renewAfter

renewAfter: string

expiresAt − 600 s; the client SHOULD renew after this time (06 §6.10).

extendableUntil

extendableUntil: string

verifiedAt + 24 h, the latest expiresAt an extension can reach.

Source: wire/federation.ts:201

RemoteSessionAccount interface

account member of a RemoteSession (06 §6.2).

interface RemoteSessionAccount

addr

addr: string

Canonical address.

name

name: string

Display name: the assertion's name if it passes 01's checks, else the prepared local part.

inc

inc: string

The account's incarnation, from the assertion (D-086).

security

security: SecurityState

The server's current view of the account's security state.

Source: wire/federation.ts:178

RemoteSessionDevice interface

device member of a RemoteSession (06 §6.2).

interface RemoteSessionDevice

did

did: string

enrolled

enrolled: boolean

The server's current view of whether the device is enrolled.

Source: wire/federation.ts:191

RemoteSessionDiagnostic interface

A diagnostic record of a failed step (06 §6.10 rule 7: "record a diagnostic"). Never shown to users.

interface RemoteSessionDiagnostic

at

at: number

ms timestamp.

phase

phase: "home" | "remote" | "extend"

Which request failed: the assertion at the home server, the session request, or the extension.

code

code: string

The error code (sdk.network_error for network failures).

error

error: unknown

Source: auth/remote.ts:1103

RemoteSessionProviderOptions interface

Options of RemoteSessionProvider (06 §6.10).

interface RemoteSessionProviderOptions

home

home: HttpClient

The home server's HTTP client, authenticated with the home session (or a bot token). Its own TokenProvider refreshes the home session; only when that fails does the user see sign_in (03 §3.3).

remote

remote: HttpClient | () => HttpClient

The remote server's HTTP client (or a function returning it, so the client that uses this provider can be passed). The provider sends only explicit credentials through it, never auth: 'session', so it may be the same client this provider authenticates.

audience

audience: string

The remote server's canonical domain, from the client's own resolution (06 §6.10 rule 2).

resolveAudience?

resolveAudience?: (signal?: AbortSignal) => Promise<ResolvedAudience>

Re-resolve the remote server (02): its canonical domain and base URL. Called once when the home server's aud differs from audience (06 §6.10 rule 2). Without it a mismatch makes the server unreachable at once.

onServerMoved?

onServerMoved?: (moved: ResolvedAudience) => void

The re-resolution agreed with the home server's new aud: the server moved to another canonical domain. The provider never presents an assertion for an audience other than the one it and its HTTP client were built for, so the owner should drop this provider and its client and resolve the domain again (06 §6.10 rule 2, 03 §3.2 rule 3).

device?

device?: DeviceCredentials | () => DeviceCredentials | null | undefined | null

The enrolled device's DSK signer and DeviceCertificate, or a function returning them (null while the device isn't enrolled). Needed when the home server issues an assertion with enr: true (06 §5.3).

client?

client?: string

Client software identifier sent as client (06 §6.1), 1–128 printable ASCII characters.

session?

session?: RemoteSessionWithToken | null

A session restored from secure storage (06 §6.10 rule 8).

onSession?

onSession?: (session: RemoteSessionWithToken | null) => void

Called with each new or updated session (with token) and with null when it is dropped: persist it in secure storage.

onStatus?

onStatus?: (status: RemoteSessionStatus, error: unknown) => void

Called when RemoteSessionProvider.status changes.

onDiagnostic?

onDiagnostic?: (diagnostic: RemoteSessionDiagnostic) => void

Called for every failed step, for diagnostics (06 §6.10 rule 7, §15).

autoRenew?

autoRenew?: boolean

Renew, retry and extend on timers in the background (06 §6.10 rules 4 and 5). Default true.

clock?

clock?: Clock

Clock in ms. Pass the remote server's ServerClock (the one its FetchHttpClient feeds from Date headers): 04 §6.6 requires a DeviceProof's iat to come from the clock corrected against its audience, and expiresAt is the remote server's time. A ServerClock also takes data.serverTime from the remote server's time-related refusals as a further sample (04 §6.6). Default: the device clock.

sleep?

sleep?: Sleep

random?

random?: () => number

Uniform [0, 1) source for the renewal moment and jitter. Default: CSPRNG.

timers?

timers?: Timers

Source: auth/remote.ts:1127

ReorderCommunityListRequest interface

PATCH /v1/me/communities body (09 §5.1): every domain exactly once.

interface ReorderCommunityListRequest

order

order: string[]

Source: wire/communities.ts:377

ReorderRolesRequest interface

Body of POST /v1/roles/reorder: every ordinary role, lowest to highest (10 §7.3).

interface ReorderRolesRequest

order

order: string[]

Source: wire/moderation.ts:121

ReorderRolesResponse interface

Response of POST /v1/roles/reorder (10 §7.3).

interface ReorderRolesResponse

items

items: Role[]

Source: wire/moderation.ts:126

RepeatedQueryValue interface

A list sent as a repeated query parameter, name=a&name=b, for parameters the owner defines as repeatable (03 §2.6 item 4; for example type of the vault change feed, 08 §8.8). Build it with repeatedQuery.

interface RepeatedQueryValue

repeat

readonly repeat: readonly (string | number)[]

Source: core/http.ts:66

ReplyRef interface

The root message a message replies to (11 §3.5).

interface ReplyRef

mid

mid: string

mid of the root message replied to, in the same context.

author

author: string

Canonical address of that message's sender.

ping?

ping?: boolean

Whether the reply notifies author. Default true.

Source: wire/messaging.ts:191

Report interface

The moderator view of a report (10 §10.2).

interface Report

id

id: string

origin

origin: ReportOrigin

originServer

originServer: string | null

originReportId

originReportId: string | null

host

host: string

Canonical domain of the context's hosting server.

ctx

ctx: string | null

requestId

requestId: string | null

kind

kind: ReportKind

category

category: ReportCategory

target

target: string

Canonical address of the reported person.

did?

did?: string

Only for kind: member with category: impersonation.

reporter?

reporter?: string

Moderator view, local and reporter_home only.

note?

note?: string

0–1,000 Unicode scalar values. Never forwarded.

routing

routing: ReportRouting

includeContext

includeContext: boolean

allowForward

allowForward: boolean

items

items: ReportItem[]

verification

verification: ReportVerification

status

status: ReportStatus

resolution

resolution: ReportResolution | null

resolutionNote?

resolutionNote?: string | null

Moderators' internal note, 0–2,000 characters.

assignee?

assignee?: string | null

actions

actions: string[]

IDs of linked audit entries.

preserveEvidence

preserveEvidence: boolean

forwardedTo

forwardedTo: string[]

version

version: number

createdAt

createdAt: string

updatedAt

updatedAt: string

resolvedAt

resolvedAt: string | null

resolvedBy

resolvedBy: string | null

Source: wire/moderation.ts:504

ReportCreatedEvent interface

report.created payload, without content (10 §13.2).

interface ReportCreatedEvent

id

id: string

ctx

ctx: string | null

kind

kind: ReportKind

category

category: ReportCategory

target

target: string

routing

routing: ReportRouting

origin

origin: ReportOrigin

createdAt

createdAt: string

Source: wire/moderation.ts:894

ReportCredential interface

The sender's credential record (14 §5.6) carried with sealed items away from the hosting server (10 §10.2).

interface ReportCredential

idc

idc: string

IdentityCertificate JWS (07).

devcert

devcert: string

DeviceCertificate JWS (07).

Source: wire/moderation.ts:455

ReportDuplicateData interface

data of report.duplicate (10 §10.4).

interface ReportDuplicateData

reportId

reportId: string

Source: wire/moderation.ts:1056

ReporterView interface

The reporter view of a report (10 §10.8).

interface ReporterView

id

id: string

ctx

ctx: string | null

kind

kind: ReportKind

category

category: ReportCategory

status

status: ReportStatus

outcome

outcome: ReportOutcome | null

null until resolved.

createdAt

createdAt: string

updatedAt

updatedAt: string

Source: wire/moderation.ts:545

ReportForwardedPayload interface

Payload d of the S2S event report.forwarded (10 §10.9). Not a client event.

interface ReportForwardedPayload

reportId

reportId: string

origin

origin: string

Canonical domain of the forwarding server; equals the S2S token's iss.

host

host: string

Canonical domain of the hosting server.

ctx

ctx: string

security

security: string & {} | "insecure" | "secure"

kind

kind: "messages"

category

category: ReportCategory

target

target: string

targetInc

targetInc: string | null

items

items: ReportItem[]

The reported items only, in seq order.

hostVerification

hostVerification: ReportVerification

forwardedAt

forwardedAt: string

Source: wire/moderation.ts:634

ReportInvalidItemsData interface

data of report.invalid_items (10 §14).

interface ReportInvalidItemsData

mids

mids: string[]

Source: wire/moderation.ts:1060

ReportItem interface

One item of a report (10 §10.2).

interface ReportItem

mid

mid: string

role

role: ReportItemRole

kind

kind: ReportItemKind

ref

ref: string | null

For edit and reaction: the mid acted on.

seq

seq: number | null

author

author: string

Canonical address of the sender.

did?

did?: string

Sending device ID (sealed items).

sentAt

sentAt: string | null

content?

content?: Record<string, unknown>

The content object (11), only for results verified and plaintext, subject to 10 §10.5.

sealed?

sealed?: Record<string, unknown>

The SealedMessage (14), sealed items, subject to 10 §10.5.

kMsg?

kMsg?: string

The revealed message key, base64url, 32 bytes.

credential?

credential?: ReportCredential

Sealed items of reporter_home and forwarded reports.

attachments?

attachments?: ReportItemAttachment[]

itemVerification

itemVerification: { result: ItemVerificationResult }

evidenceSource

evidenceSource: EvidenceSource

truncated?

truncated?: boolean

A forwarded item that arrived without its evidence (10 §10.9). Default false.

withheld?

withheld?: WithheldReason | null

Set when evidence members are withheld from the caller (10 §10.5).

Source: wire/moderation.ts:474

ReportItemAttachment interface

An attachment of a report item (10 §10.2).

interface ReportItemAttachment

attachmentId

attachmentId: string

fileKey?

fileKey?: string

Sealed items only, subject to 10 §10.5. Base64url.

size?

size?: number

available?

available?: boolean

result?

result?: ItemVerificationResult

14 §13.4 result.

Source: wire/moderation.ts:463

ReportListParams interface

Query of the report queue GET /v1/reports (10 §10.8).

interface ReportListParams

status?

status?: string

ctx?

ctx?: string

target?

target?: string

category?

category?: string

origin?

origin?: string

assignee?

assignee?: string

cursor?

cursor?: string

limit?

limit?: number

Source: wire/moderation.ts:608

ReportResolvedEvent interface

report.resolved payload, to the reporter (10 §13.2).

interface ReportResolvedEvent

id

id: string

outcome

outcome: ReportOutcome

Source: wire/moderation.ts:914

ReportUpdatedEvent interface

report.updated payload (10 §13.2).

interface ReportUpdatedEvent

id

id: string

status

status: ReportStatus

resolution

resolution: ReportResolution | null

assignee

assignee: string | null

forwardedTo

forwardedTo: string[]

updatedAt

updatedAt: string

Source: wire/moderation.ts:905

ReportVersionConflictData interface

data of report.version_conflict (10 §10.8).

interface ReportVersionConflictData

current

current: Report

Source: wire/moderation.ts:1052

RequestOptions interface

Per-call options every resource method accepts as its last argument.

interface RequestOptions

signal?

signal?: AbortSignal

Cancels the request and any automatic retry (03 §2.7 item 3).

idempotencyKey?

idempotencyKey?: string

Sent as Idempotency-Key (03 §14.2). Create calls with a client-generated ID (mid) don't need it.

Source: core/http.ts:35

ReservedAddress interface

An earlier address still reserved for a channel (09 §6.3).

interface ReservedAddress

address

address: string

until

until: string

Source: wire/communities.ts:409

ResetKeyPackageUpload interface

A KeyPackageUpload (13 §9.2), carried by a new_key reset (07 §11.6), with at most 10 keyPackages.

interface ResetKeyPackageUpload

keyPackages

keyPackages: string[]

KeyPackages (mls_key_package), base64url as 13 defines.

lastResort?

lastResort?: string

The calling device's last-resort KeyPackage.

Source: wire/identity.ts:223

ResolvedAudience interface

A re-resolution of the remote server (02 §5.1): what RemoteSessionProviderOptions.resolveAudience returns.

interface ResolvedAudience

canonicalDomain

canonicalDomain: string

The canonical domain (02 §5.3).

baseUrl

baseUrl: string

The normalized base URL.

Source: auth/remote.ts:1119

ResolveOptions interface

Options of DiscoveryResolver.resolve.

interface ResolveOptions

signal?

signal?: AbortSignal

recheck?

recheck?: boolean | "metadata"

A re-check (02 §5.2 step 2): true bypasses every cache for this domain (and sends Cache-Control: no-cache); 'metadata' refetches only /meta (02 §13.4, §16.1).

userRetry?

userRetry?: boolean

A user's explicit "Try again": may bypass a negative entry, at most once per 10 s per domain (02 §13.3).

wellKnownCheck?

wellKnownCheck?: boolean

Override the resolver's wellKnownCheck for this call (02 §4.3 W-c).

Source: discovery/resolver.ts:168

ResolveResult interface

GET {base}/v1/resolve?domain=… response (02 §6.3): the wire projection of a DiscoveryResult. Unknown source values are treated as wellknown and unknown evidence values as dns-only.

interface ResolveResult

domain

domain: string

The queried domain as a lowercase A-label.

baseUrl

baseUrl: string

Normalized base URL (02 §3.3).

canonicalDomain

canonicalDomain: string

The canonical domain, verified per 02 §5.3.

source

source: string & {} | DelegationSource

txt or wellknown.

evidence

evidence: string & {} | DelegationEvidence

dnssec, same-site, wellknown or dns-only.

resolvedAt

resolvedAt: string

RFC 3339 timestamp of the delegation.

expiresAt

expiresAt: string

When the client's cached copy expires (at most 86,400 s after the response).

stale

stale: boolean

True if the server is using a stale copy because the target is unreachable (02 §13.2).

Source: wire/discovery.ts:56

ResponseInfo interface

Metadata of one HTTP response, reported through FetchHttpClientOptions.onResponse.

interface ResponseInfo

method

method: HttpMethod

url

url: string

The URL without query string. The path is kept only under {base}/; any other URL (a capability URL, or an absolute url request) is reduced to its origin (03 §3.2 rule 1).

status

status: number

attempt

attempt: number

0 for the first attempt, then 1, 2, … for retries of the same request.

rateLimit

rateLimit: RateLimitInfo[]

Parsed RateLimit (03 §15.2 item 2); empty if absent.

rateLimitPolicy

rateLimitPolicy: RateLimitPolicyInfo[]

Parsed RateLimit-Policy; empty if absent.

retryAfterMs

retryAfterMs: number | null

Parsed Retry-After in ms, or null.

deprecation

deprecation: string | null

The Deprecation header (03 §12.5), if any. Never block the user on it.

sunset

sunset: string | null

The Sunset header (03 §12.5), if any.

Source: core/http.ts:436

ResyncCompletion interface

The outcome of finishing a resync (03 §7.5 steps 3 and 4).

interface ResyncCompletion

apply

apply: ServerEnvelope<string, unknown>[]

The queued events to apply now, in seq order.

skipped

skipped: number

How many queued events were skipped because the snapshot already holds them.

position

position: number

The new position P (03 §7.5 step 4).

gap

gap: { action: "gap"; resumeFrom: number; received: number } | { action: "self_resync"; position: number; received: number } | null

Set if the queue itself had a gap: repair it like any other (03 §7.3 rule 2).

Source: events/tracker.ts:98

ResyncRequest interface

A resync the application must carry out (03 §7.5). The SDK has already marked the stream as resyncing and queues its live events. The application:

  1. if discardCache is set, discards the state it derived from this stream's events (but never MLS state, history keys, identity pins or vault data, 03 §7.5);
  2. refetches the state it caches for the stream through the owners' HTTP endpoints (for a context its latest timeline page, membership and settings; for community the community, channel list and roles; for me the account, devices and DM index);
  3. calls complete with the lowest headSeq among those responses (or nothing if none reported one). The SDK then delivers the queued events that the snapshot doesn't already hold and sets the stream position.

If no listener handles the resync lifecycle event, the SDK completes the resync at once (a client that caches nothing has nothing to refetch).

interface ResyncRequest

stream

readonly stream: StreamName

The stream to resync.

reason

readonly reason: "gap_too_large" | "expired" | "ahead" | "access_changed" | "buffer_overflow" | "server_reset"

The reason; an unknown value is treated like gap_too_large (03 §7.5).

rawReason

readonly rawReason: string

The reason exactly as received.

headSeq

readonly headSeq: number

The stream head when the server sent the message; live events continue from headSeq + 1.

selfInitiated

readonly selfInitiated: boolean

The client started this resync itself after repeated gaps (03 §7.3 rule 2).

discardCache

readonly discardCache: boolean

ahead or server_reset: discard the event-derived cached state for the stream before refetching, and record a diagnostic. In a secure context, also report it through /v1/diagnostics with kind transport and data {"event": "resync", "reason": …, "stream": …} (03 §7.5, 15 §14.4).

signal

readonly signal: AbortSignal

Aborted when this resync is superseded or the socket closes; a later complete is ignored.

complete

complete(snapshotHeadSeq?: number | null): void

Finish the resync (03 §7.5 steps 3 and 4). snapshotHeadSeq is the lowest headSeq among the owner responses fetched in step 2; queued events at or below it are skipped. Calling it more than once has no further effect.

snapshotHeadSeq?: number | null

Source: events/socket.ts:119

ResyncStart interface

A resync that has started for a stream (03 §7.5).

interface ResyncStart

stream

stream: StreamName

reason

reason: string

The reason as received; 'gap_too_large' for the client's own resync.

headSeq

headSeq: number

The stream head the resync starts from: live events continue from headSeq + 1.

generation

generation: number

Identifies this resync; a later one for the same stream supersedes it.

selfInitiated

selfInitiated: boolean

The client started it after repeated gaps (03 §7.3 rule 2), rather than the server.

Source: events/tracker.ts:74

RetiredVault interface

A retired vault in the summary (08 §8.7.1, §8.12).

interface RetiredVault

igen

igen: number

expiresAt

expiresAt: string

RFC 3339, 30 days after the reset.

Source: wire/device-setup.ts:370

RevokedEntry interface

One recently revoked device in an IdentityState (07 §7.1 RevokedEntry).

interface RevokedEntry

did

did: string

at

at: number

NumericDate of the revocation.

rev?

rev?: string

A DeviceRevocation JWS for this did, if one was uploaded (07 §8).

Source: wire/identity.ts:150

RevokeDeviceRequest interface

Body of POST /v1/me/devices/{did}/revoke (05 §12.9); every member optional.

interface RevokeDeviceRequest

reason?

reason?: RevokeDeviceReason

removed (default) or lost_or_stolen; ignored when revoking the current device.

revocation?

revocation?: string

A DeviceRevocation JWS (sv-devrevoke+jwt, 07) for this did.

Source: wire/accounts.ts:566

RevokeDeviceResponse interface

Response 200 of POST /v1/me/devices/{did}/revoke (05 §12.9).

interface RevokeDeviceResponse

device

device: DeviceRecord

identityStateVer

identityStateVer: number | null

The ver of the IdentityState published by 05 §13 step 3, or null.

Source: wire/accounts.ts:574

Ring interface

The pending ring of a DM call (15 §2.5.3). Note that by here is an address string, unlike call.ringing's by object (15 §15).

interface Ring

by

by: string

Canonical address of the account that started the call's first ring.

targets

targets: RingTarget[]

The accounts still being rung.

video

video: boolean

The caller started with webcam on.

expiresAt

expiresAt: string

The latest expiresAt among targets.

Source: wire/calls.ts:380

RingRequest interface

POST /v1/contexts/{ctx}/call/ring request (15 §13.3).

interface RingRequest

callId

callId: string

targets?

targets?: string[]

Default: every account §13.1 item 1 allows to be rung that isn't in the call.

Source: wire/calls.ts:562

RingTarget interface

One account being rung (15 §2.5.3).

interface RingTarget

addr

addr: string

Canonical address being rung.

by

by: string

Canonical address of the participant who started this target's current ring.

expiresAt

expiresAt: string

When this target's ring times out (45 s after it started).

Source: wire/calls.ts:367

Role interface

A role (10 §4.1).

interface Role

id

id: string

UUIDv7, server-generated.

name

name: string

1–40 Unicode scalar values after NFC. For system roles, clients display a localized name from system and ignore this.

system

system: SystemRole | null

everyone, admin, or null for an ordinary role.

position

position: number

0 to maxRoles − 1, unique. everyone is 0; admin is the highest (10 §4.3 rule 5).

permissions

permissions: Permission[]

Permission names. For admin, the server returns the full registry.

color?

color?: string | null

#rrggbb lowercase, or null for the default colour. Never the only way to tell roles apart.

showSeparately?

showSeparately?: boolean

Whether member lists group this role's holders under its own heading. Default false.

memberCount

memberCount: number

Number of current holders; for everyone, the number of active members.

version

version: number

Starts at 1 and increases on every change, including renumbering (10 §7.3).

createdAt

createdAt: string

updatedAt

updatedAt: string

Source: wire/moderation.ts:67

RoleDeletedEvent interface

role.deleted payload (10 §13.2).

interface RoleDeletedEvent

roleId

roleId: string

Source: wire/moderation.ts:836

RoleEvent interface

role.created and role.updated payload (10 §13.2).

interface RoleEvent

role

role: Role

Source: wire/moderation.ts:832

RoleGrantResponse interface

Response of PUT /v1/roles/{roleId}/members/{address} (10 §7.4).

interface RoleGrantResponse

address

address: string

roleIds

roleIds: string[]

Every role the member now holds.

Source: wire/moderation.ts:134

RoleHolder interface

One holder in GET /v1/roles/{roleId}/members (10 §7.1). SPEC-ISSUE: 10 doesn't define the item shape; the SDK assumes at least address (10 §7.1).

interface RoleHolder

address

address: string

Source: wire/moderation.ts:144

RoleLike interface

What the algorithm needs of a role (a subset of the Role object, 10 §4.1).

interface RoleLike

id

id: string

system

system: string | null

position

position: number

permissions

permissions: readonly string[]

memberCount?

memberCount?: number

For the admin role, the number of admins (used by the last-admin rule, 10 §4.2 item 3).

Source: permissions.ts:160

RoleMemberEvent interface

role.member_added and role.member_removed payload (10 §13.2).

interface RoleMemberEvent

roleId

roleId: string

address

address: string

Source: wire/moderation.ts:844

RoleReorderedEvent interface

role.reordered payload: every role's position (10 §13.2).

interface RoleReorderedEvent

positions

positions: ({ roleId: string; position: number })[]

Source: wire/moderation.ts:840

RoleVersionConflictData interface

data of role.version_conflict (10 §7.3).

interface RoleVersionConflictData

current

current: Role

Source: wire/moderation.ts:1044

RotateBotTokenRequest interface

Body of POST /v1/bots/{local}/tokens/{did}/rotate (05 §15.4).

interface RotateBotTokenRequest

graceMs?

graceMs?: number

0–86,400,000; default 0.

expiresAt?

expiresAt?: string | null

New expiry (at most 2 years ahead); null removes it; absent keeps it.

Source: wire/accounts.ts:662

RotateBotTokenResponse interface

Response 200 of POST /v1/bots/{local}/tokens/{did}/rotate (05 §15.4).

interface RotateBotTokenResponse

token

token: string

svb_….

device

device: DeviceRecord

oldTokenValidUntil

oldTokenValidUntil: string

When the old token stops working.

Source: wire/accounts.ts:670

RulesAcceptanceRequiredData interface

data of community.rules_acceptance_required (09 §4.3, §9.2 C9).

interface RulesAcceptanceRequiredData

rulesVersion

rulesVersion: number

rulesText

rulesText: string

Source: wire/communities.ts:1000

S2SCatalogueEntry interface

One row of the S2S catalogue index (06 §10.1).

interface S2SCatalogueEntry

route

readonly route: string

Origin → destination, as the index states it.

payloadOwner

readonly payloadOwner: string

Owner of the payload d.

lane

readonly lane: S2SLane | "conditional"

The lane; conditional means the row's own condition decides (notify.event, discovery.metadata_changed).

orderKey

readonly orderKey: string | null

The payload member used as orderKey (dotted path into the envelope), or null.

originMembers

readonly originMembers: readonly string[]

Payload members naming the origin: a domain that must equal iss, or an address whose domain part must (empty when the binding is by recipient only).

recipientMembers

readonly recipientMembers: readonly string[]

The payload members naming a subject at the receiver's canonical domain.

expiresAt

readonly expiresAt: "none" | "set by 19"

The expiresAt column: whether the type uses envelope expiresAt, and who sets it.

giveUpHook

readonly giveUpHook: string | null

The give-up hook the origin runs when it drops the event after 24 h (06 §9.7), or null for none.

Source: wire/federation.ts:457

S2SEvent interface

The S2S event envelope (06 §9.2). The origin is always the S2S token's iss; events aren't signed individually.

interface S2SEvent<T extends string = string, D = Record<string, unknown>>

id

id: string

UUIDv7 (lowercase, hyphenated) generated by the origin; retries reuse it.

t

t: T

Event type, <area>.<name> (00 §7.5).

ts

ts: string

When the origin created the event, RFC 3339 with milliseconds, UTC.

orderKey?

orderKey?: string

1–256 characters. Events with equal orderKey are delivered in creation order (06 §9.6).

expiresAt?

expiresAt?: string

After this time the origin stops trying and a receiver ignores the event.

d

d: D

The payload, defined by the owner of t.

Source: wire/federation.ts:376

S2SEventBindings interface

The payload members 06 §10.1 binds each S2S event on. These are not the full payloads: each owner (02, 05, 07, 10, 12, 19) defines d completely, and its wire file has the full type. Other members pass through as unknown.

interface S2SEventBindings

identity.changed

identity.changed: { [member: string]: unknown; sub: string }

07 owns the payload; binding: the domain of d.sub equals iss.

device.revoked

device.revoked: { [member: string]: unknown; sub: string; did: string }

07 owns the payload; binding: the domain of d.sub equals iss.

account.deleted

account.deleted: { [member: string]: unknown; addr: string; inc: string }

05 §16.3 owns the payload; binding: the domain of d.addr equals iss.

account.suspended

account.suspended: { [member: string]: unknown; addr: string; inc: string; suspendedAt: string }

05 §11.8 owns the payload; binding: the domain of d.addr equals iss.

account.profile_changed

account.profile_changed: { [member: string]: unknown; addr: string }

05 §17.4 owns the payload; binding: the domain of d.addr equals iss.

dm.request

dm.request: { [member: string]: unknown; ctx: string; host: string; recipient: string }

12 owns the payload; binding: d.host equals iss, d.recipient is at the receiver.

dm.response

dm.response: { [member: string]: unknown; ctx: string; recipient: string }

12 owns the payload; binding: the domain of d.recipient equals iss.

dm.entry_updated

dm.entry_updated: { [member: string]: unknown; ctx: string; recipient: string }

12 owns the payload; binding: d.recipient is at the receiver; applied only to an existing entry for (iss, d.ctx).

notify.event

notify.event: { [member: string]: unknown; host: string; recipient: string }

19 owns the payload; binding: d.host equals iss, d.recipient is at the receiver.

report.forwarded

report.forwarded: { [member: string]: unknown; reportId: string; origin: string; target: string }

10 §10.9 owns the payload; binding: d.origin equals iss, d.target is at the receiver.

discovery.metadata_changed

discovery.metadata_changed: { [member: string]: unknown; urgent?: boolean }

02 §16.1 owns the payload; no binding beyond authentication, and the receiver takes no value from d except urgent for the lane.

Source: wire/federation.ts:499

S2STokenClaims interface

S2S request token claims (06 §8.2).

interface S2STokenClaims

iss

iss: string

The sender's canonical domain.

aud

aud: string

The destination's canonical domain.

htm

htm: string

The HTTP method in upper case.

htu

htu: string

The full target URI, normalized as in 06 §8.3.

bh?

bh?: string

Base64url SHA-256 of the request content; present exactly when the request has content (06 §8.4).

iat

iat: number

exp

exp: number

iat < exp ≤ iat + 60.

jti

jti: string

≥ 16 random bytes, base64url. Single use at the destination.

Source: wire/federation.ts:338

S2STokenHeader interface

Protected header of an S2S request token: kid is <sender canonical domain>#<keyId> (06 §8.2).

interface S2STokenHeader

alg

alg: "EdDSA"

typ

typ: "sv-s2s+jwt"

kid

kid: string

Source: wire/federation.ts:331

S2SUnauthenticatedData interface

data of federation.s2s_unauthenticated (06 §16).

interface S2SUnauthenticatedData

reason

reason: S2SUnauthenticatedReason

serverTime?

serverTime?: string

Source: wire/federation.ts:677

SealedEntryInput interface

A secure entry for MessagesApi.sendSealed (11 §4.2, §4.3).

interface SealedEntryInput

mid

mid: string

kind?

kind?: "message" | "edit" | "reaction" | "delete"

target?

target?: string

sealed

sealed: SealedMessage

The SealedMessage built by the 14 module from the padded content.

mentions?

mentions?: string[]

The mention hint (message, edit), see mentionHint() (11 §4.4).

mentionAll?

mentionAll?: boolean

attachmentIds?

attachmentIds?: string[]

IDs of every attachment and thumbnail the encrypted content references (11 §4.3).

Source: api/messages.ts:134

SealedEpochData interface

data of sealed.not_in_group and sealed.wrong_epoch: the current generation and epoch (14 §15).

interface SealedEpochData

gen

gen: number

epoch

epoch: number

Source: wire/history.ts:368

SealedFieldData interface

data of sealed.invalid, sealed.header_mismatch and history.share_invalid (14 §15).

interface SealedFieldData

field

field: string

Source: wire/history.ts:358

SealedKindData interface

data of sealed.kind_unsupported (14 §15).

interface SealedKindData

kind

kind: string

Source: wire/history.ts:374

SealedMessage interface

A SealedMessage (14 §4.1): the one wire form of every piece of secure application content. Producers MUST NOT add other members; receivers ignore unknown members, which the signature doesn't cover. The sender's canonical address isn't a member: every carrier supplies it.

interface SealedMessage

v

v: number

Format version, 1.

ctx

ctx: string

Context reference (colon unencoded). MUST equal the carrier's context.

gen

gen: number

MLS group generation, 1 to 2,147,483,647.

mid

mid: string

Lowercase hyphenated UUIDv7 message ID; MUST equal the carrier's mid.

epoch

epoch: number

Epoch whose K_hist seals this message, 0 to 2^53 − 1.

ekid

ekid: string

B64U(ekid(epoch)), 11 characters.

kind

kind: SealedKind

ref?

ref?: string

The mid of the entry this one acts on: required for edit, delete, reaction; absent for message.

did

did: string

Device ID of the sending device, 22 characters.

nonce

nonce: string

AES-GCM nonce, 16 characters (12 bytes).

kc

kc: string

Key commitment, 22 characters (16 bytes).

ct

ct: string

AES-256-GCM ciphertext followed by its 16-byte tag.

sig

sig: string

Labelled signature sealed by the sender's DSK, 86 characters (64 bytes).

Source: wire/history.ts:70

SealedPostEntry interface

A secure carrier (11 §4.3).

interface SealedPostEntry extends PostEntry

mid

mid: string

Client-generated UUIDv7; the idempotency key (11 §4.6).

kind?

kind?: EntryKind

Default message.

target?

target?: string

Required for edit, reaction and delete; absent for message.

mentions?

mentions?: string[]

Secure message and edit only: mention hint (11 §4.4).

mentionAll?

mentionAll?: boolean

Secure message and edit only: mention hint (11 §4.4).

attachmentIds?

attachmentIds?: string[]

Secure carrier: IDs of every attachment and thumbnail the encrypted content references (11 §4.3).

sealed

sealed: SealedMessage

Secure carrier: a SealedMessage (14) whose plaintext is the padded content object.

content?

content?: undefined

Insecure carrier: the content object for kind.

Source: wire/messaging.ts:332

SealedRefData interface

data of sealed.ref_invalid (14 §15).

interface SealedRefData

ref

ref: string

reason

reason: "not_found" | string & {} | "deleted" | "missing" | "forbidden" | "not_author"

Source: wire/history.ts:379

SealedSecurityData interface

data of sealed.not_secure and sealed.required (14 §15).

interface SealedSecurityData

security

security: "insecure" | "secure"

Source: wire/history.ts:363

SealedVerifyDiagnosticData interface

data of the sealed_verify diagnostic (14 §9.4). Never contains keys, plaintext or content.

interface SealedVerifyDiagnosticData

gen

gen: number

epoch

epoch: number

mid

mid: string

sender

sender: string

did

did: string

step

step: SealedVerifyStep

outcome

outcome: "invalid" | "fork_evidence"

ekid?

ekid?: string

For step ekid: the message's ekid.

ownEkid?

ownEkid?: string

For step ekid: this device's own ekid.

Source: wire/history.ts:300

SecPinVaultRecordPlaintext interface

Plaintext of a sec_pin record (08 §8.6.3): 09's pin; only host and ctx are used here.

interface SecPinVaultRecordPlaintext

t

t: "sec_pin"

host

host: string

ctx

ctx: string | null

Null for a community pin.

Source: wire/device-setup.ts:471

SecureBotEntry interface

One secure bot that will follow an upgrade (09 §10.2, §11.2).

interface SecureBotEntry

addr

addr: string

name

name: string

Source: wire/communities.ts:220

SecureEntryParams interface

Inputs of buildSecureEntry: the sealing inputs of 14 (host, ctx, gen, sender, did, epoch, kHist, signer) plus the entry itself.

interface SecureEntryParams extends Omit<SealParams, "kind" | "ref" | "content" | "maxMessageBytes">

kind?

kind?: "message" | "edit" | "reaction" | "delete"

Default message.

target?

target?: string

The target mid for edit, reaction and delete; it becomes sealed.ref (11 §4.3).

content

content: ContentObject

The content object for kind (11 §3).

maxMessageBytes?

maxMessageBytes?: number

The hosting server's maxMessageBytes (11 §2.3). Default: the 8,192 floor.

maxAttachmentBytes?

maxAttachmentBytes?: number

The hosting server's maxAttachmentBytes (11 §2.3). Default: the 8 MiB floor.

mentionHints?

mentionHints?: boolean

The mention_hints setting (11 §4.4). When false the hint's mentions is []. Default true.

previous?

previous?: MessageContent | EditContent

For an edit: the message's previous content, checked as 11 §3.7.1 requires.

targetHasAttachments?

targetHasAttachments?: boolean

For an edit: whether the target has bound attachments, so attachmentIds is sent ([] then removes them all, 11 §4.2). Default: previous had attachments, or the edit keeps some.

isCanonicalAddress?

isCanonicalAddress?: MentionAddressCheck

host

host: string

Canonical domain of the hosting server.

ctx

ctx: string

gen

gen: number

sender

sender: string

Canonical address of the sending account.

did

did: string

This device's ID.

mid

mid: string

The UUIDv7 mid, recorded in the outbox before the first attempt and reused for retries.

epoch

epoch: number

The device's current epoch.

kHist

kHist: Uint8Array

K_hist(epoch) from the key store.

signer

signer: Ed25519Signer

The device's DSK.

random?

random?: RandomSource

CSPRNG for the nonce (tests only).

Source: api/messages.ts:185

SecurityDowngradeSeenData interface

data of a security_downgrade_seen diagnostics report (09 §13.6 step 5; endpoint in 15 §14.3).

interface SecurityDowngradeSeenData

trigger

trigger: string & {} | W9Trigger

host

host: string

pinned

pinned: { securedAt?: string; upgradeSeq?: number | null; version?: number }

observed

observed: { security?: ChannelSecurity; secure?: boolean; securedAt?: string | null; upgradeSeq?: number | null; version?: number; seq?: number }

Source: wire/communities.ts:739

SecurityGateData interface

data of a security.* gate error from 09's endpoints (09 §9.2 C4, §9.3 H6/H7, §15.5).

interface SecurityGateData

scope?

scope?: "community" | string & {} | "channel"

domain?

domain?: string

ctx?

ctx?: `ch:${string}`

Source: wire/communities.ts:1054

Sender interface

Who sent an entry, filled in by the server from the session (11 §5.1).

interface Sender

addr?

addr?: string

Canonical address of the sending account; absent for webhooks.

name

name: string

Display name, or the webhook's name.

did?

did?: string

Device ID of the sending device; absent for webhooks.

kind?

kind?: SenderKind

Default user.

webhook?

webhook?: string

The Webhook ID, only when kind is webhook.

Source: wire/messaging.ts:352

SendOptions interface

Options of MessagesApi.send.

interface SendOptions extends RequestOptions

mid?

mid?: string

The entry's mid; reuse the outbox's mid when resending (11 §13.4 rule 3). Default: a new UUIDv7.

replyTo?

replyTo?: ReplyRef | null

With text: the message replied to (11 §3.5).

attachments?

attachments?: AttachmentRef[]

With text: attachment references from AttachmentsApi.uploadAttachment.

signal?

signal?: AbortSignal

Cancels the request and any automatic retry (03 §2.7 item 3).

idempotencyKey?

idempotencyKey?: string

Sent as Idempotency-Key (03 §14.2). Create calls with a client-generated ID (mid) don't need it.

Source: api/messages.ts:124

SeqStore interface

Storage for the position P of each stream a client follows at level full (03 §7.3). One store holds the positions of one (server canonical domain, account) pair; the caller scopes it, because positions are kept per (server, account, stream) (03 §7.3).

The event socket calls SeqStore.set after the listeners of an event have returned. A client MUST store P atomically with the state it derived from events up to P, or else store a value no greater than what it has durably applied (03 §7.3 rule 4). If your listeners persist asynchronously, make set a no-op, save P yourself in the same transaction as your state, and return it from SeqStore.load.

A client that has lost its cached state for a stream but still has P MUST NOT resume from it (03 §7.3 rule 4): delete the position (or call EventSocket.forget) so the stream is subscribed fresh.

interface SeqStore

load

load(): Partial<Record<StreamName, number>> | Promise<Partial<Record<StreamName, number>>>

Every stored position. Read once, before the socket's first connection.

set

set(stream: StreamName, position: number): void | Promise<void>

Record P for a stream.

stream: StreamName
position: number

delete

delete(stream: StreamName): void | Promise<void>

Forget a stream's position (resync replaced it, or the cached state is gone).

stream: StreamName

clear

clear(): void | Promise<void>

Forget every position: the user signed out or the account was deleted (03 §7.3 rule 5).

Source: events/seq-store.ts:30

ServerClientInit interface

What a ServerClient is built from. Created by SloppyVoiceClient; build one yourself only for tests or special setups.

interface ServerClientInit

discovery

discovery: DiscoveryResult

The discovery result for this server (02 §5.1).

http

http: HttpClient

The HTTP client bound to the server's base URL and its credential.

tokens

tokens: TokenProvider | null

The credential issued by this server, or null for anonymous use.

isHome

isHome: boolean

Whether this is the account's home server.

client

client: string

The client name for session.hello (03 §5.4).

serverClock?

serverClock?: ServerClock

The server clock fed by this server's Date headers and envelope ts (03 §2.3 item 4).

socketDefaults?

socketDefaults?: Partial<EventSocketOptions>

Defaults for ServerClient.events.

resolver?

resolver?: DiscoveryResolver

The resolver, for discovery.metadata_changed and the /meta check (02 §16.1, 03 §5.1 item 5).

onClose?

onClose?: () => void

Called when the server client is closed.

pins?

pins?: ServerPinStore | null

The pin store, to follow a base-URL move only when the pin accepted it (02 §10.2, §10.6, §15.6).

onBaseUrlChanged?

onBaseUrlChanged?: (baseUrl: string) => void

Called after the client followed an accepted move to baseUrl.

clock?

clock?: Clock

The device clock. Default Date.now.

Source: client.ts:210

ServerEnvelope interface

An envelope as a server sends it (03 §6.1): ts is always present, ctx is present on events, seq on durable events.

interface ServerEnvelope<T extends string = string, D = unknown> extends Envelope<T, D>

ts

ts: string

Server timestamp (03 §9). Required from the server, optional and ignored from clients.

v

v: 1

Envelope version, 1.

t

t: T

Message or event type, <area>.<name> (03 §11.1), or error.

id

id: string

UUIDv7 of this envelope; fixed for a durable event across deliveries and replays.

re?

re?: string

On replies (and on session.pong from a client): the id being answered.

ctx?

ctx?: StreamName

On events: the stream the event belongs to (03 §8.3). Absent on control messages.

seq?

seq?: number

On durable events only: the event's sequence number in its stream, 1 to 2^53 − 1 (03 §7).

d

d: D

The payload; {} when there is nothing to carry.

Source: events/tracker.ts:20

ServerKey interface

A ServerKey: an Ed25519 public key as a JWK with the members of 02 §11.1. Time members are NumericDate integers (PD-02-5). It never contains the private member d.

interface ServerKey

kty

kty: "OKP"

crv

crv: "Ed25519"

x

x: string

base64url of exactly 32 octets, canonical, not of small order (04).

kid

kid: string

server-kid (02 §11.2): <canonicalDomain>#<key-id>.

purpose

purpose: ServerKeyPurpose

status

status: ServerKeyStatus

nbf

nbf: number

NumericDate from which the key may sign.

exp

exp: number

NumericDate after which nothing signed by the key is accepted; nbf < exp ≤ nbf + 63,158,400.

retiredAt?

retiredAt?: number

NumericDate when the key stopped being active; required when status is retired.

rvt?

rvt?: number

NumericDate of the earliest possible compromise; required when status is revoked.

alg?

alg?: "EdDSA"

If present, "EdDSA".

Source: wire/discovery.ts:95

ServerKeyLookup interface

The key returned by DiscoveryResolver.serverKey.

interface ServerKeyLookup

publicKey

publicKey: Uint8Array

Raw 32-byte Ed25519 public key.

kid

kid: string

thumbprint

thumbprint: string

purpose

purpose: ServerKeyPurpose

status

status: "active" | "next" | "retired"

nbf

nbf: number

exp

exp: number

retiredAt?

retiredAt?: number

from

from: "pin" | "metadata"

Whether the key came from the pin (02 §11.6 step 3) or from validated metadata.

Source: discovery/resolver.ts:182

ServerKeyRequest interface

What a server key resolver is asked for: 02's serverKey(iss, kid, "sign", iat) (06 §3.2, 02 §11.6).

interface ServerKeyRequest

iss

iss: string

The token's iss, equal to the kid domain.

kid

kid: string

The full server key ID, <iss>#<keyId>.

keyId

keyId: string

purpose

purpose: "sign"

Always sign for federation objects (06 §3.2).

iat

iat: number

The token's iat, for 02's retired-key rule (06 §3.2).

Source: auth/remote.ts:276

ServerMetadata interface

ServerMetadata, served at GET {base}/meta (02 §7.1, §7.2). Consumers ignore unknown members.

interface ServerMetadata

canonicalDomain

canonicalDomain: string

The server's one canonical domain (D-002), an element of domains. Immutable.

domains

domains: string[]

Every domain this server accepts: 1–100 lowercase A-labels, no duplicates.

name

name: string

Display name, 1–64 code points after trimming, NFC.

description?

description?: string

≤ 500 code points. Cosmetic.

icon?

icon?: string

https URL ≤ 512 octets. Cosmetic.

secure

secure: boolean

The server's secure flag (00 §4.1). Never goes from true to false.

securedAt

securedAt: string | null

When the server became secure; null while secure is false.

versions

versions: string[]

Protocol versions spoken, one major.minor per major version (03 §12.1).

minClient

minClient: string

Lowest protocol version a client must implement (03 §12.1).

features

features: FeatureName[]

Implemented features (03 §12.2), including voice-dc/1 and video-dc/1.

keys

keys: ServerKey[]

1–16 ServerKeys (02 §11.5).

keyChain

keyChain: string[]

0–64 compact KeyRotation JWSs, ordered by n (02 §12.2).

endpoints

endpoints: MetadataEndpoints

auth

auth: MetadataAuth

limits

limits: ServerLimits

Advertised max<Thing><Unit> limits (00 §7.12, 03 §16).

contact?

contact?: MetadataContact

software?

software?: MetadataSoftware

updatedAt

updatedAt: string

When any other member last changed (RFC 3339).

Source: wire/discovery.ts:207

ServerMute interface

A community-wide server mute (10 §8.6). Keyed by member (and incarnation).

interface ServerMute

member

member: string

until

until: string | null

End time, or null until lifted.

reason?

reason?: string

Returned only to holders of mute_members, and to the target if showReason.

showReason?

showReason?: boolean

reportId?

reportId?: string | null

createdBy

createdBy: Actor

createdAt

createdAt: string

Source: wire/moderation.ts:287

ServerMuteChangedEvent interface

moderation.server_mute_changed payload (10 §13.2).

interface ServerMuteChangedEvent

address

address: string

muted

muted: boolean

until

until: string | null

Source: wire/moderation.ts:880

ServerMuteRequest interface

Body of POST /v1/moderation/server-mutes (10 §8.6).

interface ServerMuteRequest extends ModerationCommon

reason?

reason?: string

0–512 Unicode scalar values; stored in the audit log.

showReason?

showReason?: boolean

Show reason to the target. Default false.

reportId?

reportId?: string

Link the audit entry (and the report's actions) to this report.

member

member: string

durationMs?

durationMs?: number

60,000 to 2,419,200,000; absent for "until lifted".

Source: wire/moderation.ts:300

ServerPinRecord interface

A pin (02 §10.1): what was first accepted for a queried domain. Clients keep it without observed (02 §10.6). JSON-serializable, so a ServerPinStore can persist it as is.

interface ServerPinRecord

domain

domain: string

The queried domain.

state

state: PeerPinState

pinned or suspended (clients only ever store pinned, 02 §10.6).

canonicalDomain

canonicalDomain: string

baseUrl

baseUrl: string

Normalized base URL.

secure

secure: boolean

Once true, stays true (D-073).

evidence

evidence: DelegationEvidence

Evidence of the resolution that created or last changed the pin.

keys

keys: PinnedKey[]

Every key with status next, active or retired, including its public key.

revoked

revoked: string[]

Thumbprints of every key ever seen as revoked. Never shrinks.

chainHead

chainHead: ChainHead | null

firstSeenAt

firstSeenAt: string

changedAt

changedAt: string

lastVerifiedAt

lastVerifiedAt: string

Source: discovery/pins.ts:31

ServerPinStore interface

Durable storage for pins (02 §10.1: pins are not a cache and don't expire with TTLs). Web clients keep them in origin storage (02 §10.6); implementations must persist the record as given.

interface ServerPinStore

get

get(domain: string): Promise<ServerPinRecord | null>
domain: string

set

set(pin: ServerPinRecord): Promise<void>

delete

delete(domain: string): Promise<void>
domain: string

list

list(): Promise<ServerPinRecord[]>

Source: discovery/pins.ts:292

ServerProposal interface

A server proposal (13 §7.7); also the payload of mls.proposal (13 §8.4). reason, target and evidence are unsigned server annotations (13 §7.7, §21 item 8).

interface ServerProposal

groupId

groupId: string

epoch

epoch: number

The epoch the proposal is bound to.

ref

ref: string

base64url ProposalRef (RFC 9420 §5.2).

type

type: ServerProposalType

proposal

proposal: string

The proposal as mls_public_message (base64url).

reason

reason: ServerProposalReason

13 §13.1. Unknown values: treat as lost_access.

target?

target?: MlsLeafRef

Present for remove.

evidence?

evidence?: ServerProposalEvidence

reissueOf?

reissueOf?: string

The ref this proposal replaces after an external commit (13 §13.5).

issuedAt

issuedAt: string

Source: wire/mls.ts:306

ServerProposalEvidence interface

Evidence attached to a server proposal (13 §7.7). Server annotations, never proof.

interface ServerProposalEvidence

identityState?

identityState?: string

IdentityState JWS.

deviceRevocation?

deviceRevocation?: string

DeviceRevocation JWS.

Source: wire/mls.ts:295

ServerProposalSummary interface

A pending server proposal as summarized in MlsGroupStatus (13 §7.2).

interface ServerProposalSummary

ref

ref: string

type

type: ServerProposalType

reason

reason: ServerProposalReason

target?

target?: MlsLeafRef

Source: wire/mls.ts:287

ServerUpgradeConfirmRequest interface

PATCH /v1/community body of a server-upgrade confirmation (09 §11.4). Needs Idempotency-Key.

interface ServerUpgradeConfirmRequest

secure

secure: true

dryRun?

dryRun?: false

Default false.

planVersion

planVersion: string

From the dry run the admin confirmed. Required when dryRun is false.

confirmDomain

confirmDomain: string

The canonical domain as typed or confirmed in W5. Required when dryRun is false.

deletePreUpgradeHistory?

deletePreUpgradeHistory?: boolean

Default false.

ifVersion?

ifVersion?: number

Source: wire/communities.ts:196

ServerUpgradeDryRunRequest interface

PATCH /v1/community body of a server-upgrade dry run (09 §11.2).

interface ServerUpgradeDryRunRequest

secure

secure: true

dryRun

dryRun: true

ifVersion?

ifVersion?: number

Source: wire/communities.ts:189

ServerUpgradeOptions interface

Options of the server-upgrade confirmation (09 §11.4).

interface ServerUpgradeOptions

planVersion

planVersion: string

From the dry run the admin confirmed (09 §10.6).

confirmDomain

confirmDomain: string

The canonical domain as typed or confirmed in W5 (09 §11.3).

deletePreUpgradeHistory?

deletePreUpgradeHistory?: boolean

Delete every channel's pre-upgrade messages. Default false (off by default in W5).

ifVersion?

ifVersion?: number

Source: api/community.ts:43

ServerUpgradePlan interface

The ServerUpgradePlan returned by the dry run (09 §11.2).

interface ServerUpgradePlan

scope

scope: "community"

domain

domain: string

Canonical domain.

planVersion

planVersion: string

09 §10.6, with scope = the canonical domain.

insecureChannelCount

insecureChannelCount: number

localInsecureAccountCount

localInsecureAccountCount: number

Local insecure accounts (users and bots) that will enter upgrade_required (05).

localInsecureBotCount

localInsecureBotCount: number

How many of those are bots; they stop working until re-provisioned as secure bots.

remoteInsecureMemberCount

remoteInsecureMemberCount: number

cannotFollow

cannotFollow: CannotFollowEntry[]

Up to 100 of the accounts that can't follow, ordered by addr.

cannotFollowTruncated

cannotFollowTruncated: boolean

secureBots

secureBots: SecureBotEntry[]

Up to 100 secure bots that are community members, ordered by addr (W6).

secureBotsTruncated

secureBotsTruncated: boolean

insecureDmCount

insecureDmCount: number

Insecure DMs and group DMs hosted here that will be closed or paused (12 §13.1).

activeCallCount

activeCallCount: number

webhookCount

webhookCount: number

historyMessageCount

historyMessageCount: number

May be approximate.

Source: wire/communities.ts:226

SessionClientMessages interface

Messages a client may send on the event WebSocket (03 §6.2). No other type may be sent by a client.

interface SessionClientMessages

session.hello

session.hello: SessionHello

session.subscribe

session.subscribe: SessionSubscribe

session.unsubscribe

session.unsubscribe: SessionUnsubscribe

session.state

session.state: SessionState

session.reauth

session.reauth: SessionReauth

session.ping

session.ping: SessionPing

session.pong

session.pong: SessionPong

Source: wire/transport.ts:574

SessionClosing interface

session.closing payload: sent before the server closes a socket on purpose (03 §5.10).

interface SessionClosing

reason

reason: ClosingReason

Why (03 §5.10).

reconnect

reconnect: boolean

Whether the client should reconnect automatically.

retryAfterMs?

retryAfterMs?: number

The minimum delay before reconnecting.

problem?

problem?: Problem

For session_ended, unauthenticated, unsupported_version and rate_limited.

Source: wire/transport.ts:484

SessionEndedData interface

data of the federation.session_ended problem (06 §6.8, §16). retryable equals retry.

interface SessionEndedData

reason

reason: SessionEndedReason

retry

retry: boolean

Source: wire/federation.ts:321

SessionEndedPayload interface

Payload d of the federation.session_ended client event (06 §6.8): ephemeral, no seq, ctx = me.

interface SessionEndedPayload

sessionId

sessionId: string

The ended session.

reason

reason: SessionEndedReason

Why it ended; unknown values are treated as admin.

retry

retry: boolean

Whether the client should silently try to create a new session.

Source: wire/federation.ts:311

SessionEvents interface

The control messages a client receives on the event WebSocket: every server-to-client session.* type and error (03 §11.3), mapped to payload types.

interface SessionEvents

session.ready

session.ready: SessionReady

session.subscribed

session.subscribed: SessionSubscribed

session.unsubscribed

session.unsubscribed: SessionUnsubscribed

session.subscription_ended

session.subscription_ended: SessionSubscriptionEnded

session.heads

session.heads: SessionHeads

session.ping

session.ping: SessionPing

session.pong

session.pong: SessionPong

session.closing

session.closing: SessionClosing

session.reauthed

session.reauthed: SessionReauthed

session.resync_required

session.resync_required: SessionResyncRequired

error

error: Problem

Source: wire/transport.ts:588

SessionHeads interface

session.heads payload: context reference → Head (03 §5.7).

interface SessionHeads

heads

heads: Partial<Record<CtxRef, Head>>

Source: wire/transport.ts:451

SessionHello interface

session.hello payload, client to server: authenticate and subscribe (03 §5.4).

interface SessionHello

token

token: string

The client-session access token or, at the bot's home server only, a bot token (at most 4,096 characters).

client

client: string

Product and version, 1 to 128 printable ASCII characters, e.g. sloppyvoice-desktop/1.0.3.

protocol?

protocol?: string

Protocol version the client implements, major.minor. Default "1.0".

features

features: FeatureName[]

Features the client supports (03 §12.2), at most 64. May be empty.

resume?

resume?: Partial<Record<StreamName, number>>

Stream name → last processed position (integer ≥ 0); each entry asks for a full subscription with replay.

subscribe?

subscribe?: StreamName[]

Streams to subscribe at level full from their current head, without replay.

heads?

heads?: CtxRef[]

Context references to subscribe at level heads (03 §5.7).

foreground?

foreground?: boolean

Initial foreground state (03 §5.8). Default false; a visible client MUST send true.

Source: wire/transport.ts:347

SessionReady interface

session.ready payload, server to client, re = the hello's id (03 §5.5).

interface SessionReady

conn

conn: string

UUIDv7 identifying this connection, for diagnostics.

account

account: string

Canonical address of the session's account (01).

did

did: string

The session's device ID (03 §8.4).

server

server: string

The server's canonical domain.

protocol

protocol: string

Highest protocol version of the client's major version that the server implements.

features

features: FeatureName[]

The effective feature set (03 §12.2).

pingIntervalMs

pingIntervalMs: number

30000 in this version (03 §5.9).

idleTimeoutMs

idleTimeoutMs: number

75000 in this version (03 §5.9).

authExpiresAt

authExpiresAt: string | null

The socket's authentication deadline (03 §5.13); null for a token that doesn't expire.

subscriptions

subscriptions: SubscriptionResult[]

One result per stream named in the hello, plus me.

Source: wire/transport.ts:389

SessionReauth interface

session.reauth payload, client to server: extend the authentication deadline (03 §5.13).

interface SessionReauth

token

token: string

A currently valid token of the same client session.

Source: wire/transport.ts:537

SessionReauthed interface

session.reauthed payload, the reply to session.reauth (03 §5.13).

interface SessionReauthed

authExpiresAt

authExpiresAt: string | null

Source: wire/transport.ts:543

SessionResyncRequired interface

session.resync_required payload: the stream can't be brought up to date by replay (03 §7.5).

interface SessionResyncRequired

stream

stream: StreamName

The stream.

reason

reason: ResyncReason

Why.

headSeq

headSeq: number

The stream's head when the message was sent; live events continue from headSeq + 1.

Source: wire/transport.ts:558

SessionRevokedData interface

data of auth.session_revoked (05 §19).

interface SessionRevokedData

reason

reason: RevokedReason

Source: wire/accounts.ts:874

SessionState interface

session.state payload, client to server: foreground state (03 §5.8). No reply.

interface SessionState

foreground

foreground: boolean

Source: wire/transport.ts:456

SessionSubscribe interface

session.subscribe payload, client to server (03 §5.6). At least one member MUST be non-empty.

interface SessionSubscribe

resume?

resume?: Partial<Record<StreamName, number>>

subscribe?

subscribe?: StreamName[]

heads?

heads?: CtxRef[]

Source: wire/transport.ts:413

SessionSubscribed interface

session.subscribed payload, the reply to session.subscribe (03 §5.6).

interface SessionSubscribed

subscriptions

subscriptions: SubscriptionResult[]

Source: wire/transport.ts:420

SessionSubscriptionEnded interface

session.subscription_ended payload: the server ended a subscription on its own (03 §5.6).

interface SessionSubscriptionEnded

stream

stream: StreamName

problem

problem: Problem

Source: wire/transport.ts:435

SessionTokenResponse interface

The full token response of a login for a linked identity (05 §7.3) and of a sign-up (05 §8.4): a new session with its device record.

interface SessionTokenResponse

access_token

access_token: string

sva_….

token_type

token_type: "Bearer"

expires_in

expires_in: number

Seconds; 900.

refresh_token

refresh_token: string

svr_….

authAt

authAt: string

When the provider leg completed (05 §6.5 step 4).

account

account: Account

device

device: DeviceRecord

Source: wire/accounts.ts:409

SessionUnsubscribe interface

session.unsubscribe payload, client to server: at least one stream (03 §5.6).

interface SessionUnsubscribe

streams

streams: StreamName[]

Source: wire/transport.ts:425

SessionUnsubscribed interface

session.unsubscribed payload: the streams the server removed (03 §5.6).

interface SessionUnsubscribed

streams

streams: StreamName[]

Source: wire/transport.ts:430

SetOverwriteRequest interface

Body of PUT /v1/roles/overwrites/{ctx}/role/{roleId} and …/member/{address} (10 §7.5). Both empty deletes it.

interface SetOverwriteRequest

allow

allow: Permission[]

deny

deny: Permission[]

Source: wire/moderation.ts:191

SettingsEvaluation interface

Result of evaluateNotificationSettings (19 §6.2).

interface SettingsEvaluation

outcome

outcome: SettingsOutcome

rule

rule: SettingsRule

The rule that decided.

previewDiscarded

previewDiscarded: boolean

Whether rule H6 or H7, or the removal of the latest item, discarded the preview.

removedItems

removedItems: number

Items removed by per-item H4.

notification

notification: Partial<RecomputableNotification> & { kind: NotificationKind } | null

The notification as it is to be stored (message kinds recomputed, preview discarded), or null for drop.

Source: api/notifications.ts:787

SettingsEvaluationInput interface

Input of evaluateNotificationSettings (19 §6.2, §6.5).

interface SettingsEvaluationInput

notification

notification: Partial<RecomputableNotification> & { kind: NotificationKind; ctxKind: NotifyContextKind | null; alert?: { code: string } | null }

The event or record. For message kinds, items, count, sender, eventAt, otherSenders and preview are recomputed by per-item evaluation; other kinds pass what they have.

global

global: GlobalSettingsInput

community?

community?: CommunitySettingsInput | null

The community settings for host (channels only); null or absent when there is no entry.

context?

context?: ContextSettingsInput | null

The context settings for (host, ctx); null or absent when there is no entry.

homeSecure?

homeSecure?: boolean

The home server is a secure server (ServerMetadata secure) (rule H6).

presenceStatus?

presenceStatus?: string | null

The account's chosen presence status at the home server (11 §11.1); dnd triggers H8.

now

now: number

Epoch ms, for muteUntil.

Source: api/notifications.ts:762

SettingsRecordPlaintext interface

Plaintext of a settings record (08 §8.6.4).

interface SettingsRecordPlaintext

t

t: "settings"

name

name: string

[a-z][a-z0-9_]{0,63}.

value

value: unknown

updatedAt

updatedAt: string

Source: wire/device-setup.ts:480

SfuAnswerRequest interface

POST …/sfu/session/{sfuSessionId}/answer request: the answer to a server sfu.offer (15 §8.2).

interface SfuAnswerRequest

negotiationId

negotiationId: string

answer

answer: string

Source: wire/calls.ts:629

SfuClosedEvent interface

sfu.closed (15 §8).

interface SfuClosedEvent

callId

callId: string

sfuSessionId

sfuSessionId: string

reason

reason: SfuClosedReason

Unknown values: treat as sfu_failed.

Source: wire/calls.ts:1046

SfuCreateSessionRequest interface

POST …/call/sfu/session request (15 §8.2).

interface SfuCreateSessionRequest

callId

callId: string

offer

offer: string

SDP offer, at most 16 KiB.

publish

publish: SfuPublish[]

Source: wire/calls.ts:601

SfuCreateSessionResponse interface

POST …/call/sfu/session response, 201 (15 §8.2).

interface SfuCreateSessionResponse

sfuSessionId

sfuSessionId: string

UUIDv7 assigned by call control.

answer

answer: string

tracks

tracks: Track[]

Source: wire/calls.ts:609

SfuNegotiationConflictData interface

sfu.negotiation_conflict error data (15 §16.1).

interface SfuNegotiationConflictData

negotiationId

negotiationId: string

Source: wire/calls.ts:1123

SfuOfferEvent interface

sfu.offer: a server offer to answer within 10 s (15 §8.3).

interface SfuOfferEvent

callId

callId: string

sfuSessionId

sfuSessionId: string

negotiationId

negotiationId: string

offer

offer: string

tracks

tracks: Track[]

Source: wire/calls.ts:1030

SfuOfferRequest interface

POST …/sfu/session/{sfuSessionId}/offer request: a client-initiated renegotiation (15 §8.2).

interface SfuOfferRequest

offer

offer: string

publish

publish: SfuPublish[]

Source: wire/calls.ts:617

SfuOfferResponse interface

POST …/sfu/session/{sfuSessionId}/offer response (15 §8.2).

interface SfuOfferResponse

answer

answer: string

tracks

tracks: Track[]

Source: wire/calls.ts:623

SfuPublish interface

One published source of an SFU offer (15 §8.2).

interface SfuPublish

mid

mid: string

The transceiver mid in the offer.

sourceId

sourceId: number

1, 2 or 3.

rids?

rids?: string[]

For simulcast, its RID list (17).

Source: wire/calls.ts:578

SfuSubscriptionsRequest interface

PUT …/sfu/session/{sfuSessionId}/subscriptions request; replaces the previous set (15 §8.2).

interface SfuSubscriptionsRequest

want

want: SfuWant[]

Source: wire/calls.ts:643

SfuTracksChangedEvent interface

sfu.tracks_changed (15 §8.4).

interface SfuTracksChangedEvent

callId

callId: string

sfuSessionId

sfuSessionId: string

tracks

tracks: Track[]

Source: wire/calls.ts:1039

SfuWant interface

One wanted track of an SFU subscription (15 §8.2).

interface SfuWant

pid

pid: number

sourceId

sourceId: number

maxSpatialLayer?

maxSpatialLayer?: number

maxTemporalLayer?

maxTemporalLayer?: number

Source: wire/calls.ts:635

SharedKeyEntry interface

One message key of a shared_keys record (08 §9.5).

interface SharedKeyEntry

mid

mid: string

k

k: string

base64url of the 32-byte K_msg.

Source: wire/device-setup.ts:448

SharedKeysRecordPlaintext interface

Plaintext of a shared_keys record (08 §9.5).

interface SharedKeysRecordPlaintext

t

t: "shared_keys"

host

host: string

ctx

ctx: string

shareId

shareId: string

part

part: number

0 to 156.

sharer

sharer: string

keys

keys: SharedKeyEntry[]

1 to 32 entries.

Source: wire/device-setup.ts:455

SharedMessageKeyEntry interface

One shared-message-key entry of the client key store (14 §3.7, §7.8). Opens exactly one SealedMessage.

interface SharedMessageKeyEntry

host

host: string

ctx

ctx: string

mid

mid: string

key

key: Uint8Array

K_msg, 32 bytes.

shareId

shareId: string

sharer

sharer: string

The sharer's canonical address.

Source: wire/history.ts:117

SignInDeviceInfo interface

Device details sent at the code exchange for a login (05 §7.3) and at sign-up (05 §8.4).

interface SignInDeviceInfo

platform

platform: ClientPlatform

desktop, web, ios or android.

clientSoftware

clientSoftware: string

<product>/<version>, 1–64 printable ASCII characters (05 §5.3).

deviceName?

deviceName?: string

Suggested device name, 1–64 characters.

sharedComputer?

sharedComputer?: boolean

"This is a shared or public computer" (05 §12.6); web and desktop only.

Source: auth/oauth.ts:463

SignInSessionAuth interface

A stored sign-in session (05 §7.6, §7.7): the token family of a home session. The client wraps it in a HomeSession bound to the home server's /v1/auth/token, which refreshes it silently.

interface SignInSessionAuth

session

session: HomeSessionState

The stored state, from HomeSession.state or HomeSession.fromTokenResponse (05 §7.3).

options?

options?: HomeSessionOptions

Refresh, persistence and locking options (05 §7.7).

authApi?

authApi?: AuthApiOptions

Options of the AuthApi used for refreshes (05 §7.1).

Source: client.ts:84

SignupInfo interface

The signup member of a sign-up token response (05 §8.2).

interface SignupInfo

provider

provider: string

Provider ID used.

providerLabel?

providerLabel?: string

The 05 §10.1 label ("You signed in with Google as …").

suggestedName?

suggestedName?: string

Display-name suggestion (05 §8.5).

suggestedLocal?

suggestedLocal?: string

The canonical local part of suggestedName.

registration

registration: string & {} | "open" | "invite"

open or invite.

inviteRequired

inviteRequired: boolean

true when registration is invite.

termsUrl?

termsUrl?: string

When present, sign-up requires acceptTerms: true.

Source: wire/accounts.ts:424

SignupRequest interface

Body of POST /v1/auth/signup (05 §8.4), sent with Authorization: Bearer <sign-up token>.

interface SignupRequest

name

name: string

The chosen display name; the local part is derived from it (01).

inviteCode?

inviteCode?: string

When inviteRequired.

acceptTerms?

acceptTerms?: boolean

When termsUrl is set: MUST be true.

platform

platform: ClientPlatform

desktop, web, ios or android.

clientSoftware

clientSoftware: string

05 §5.3.

deviceName?

deviceName?: string

1–64 characters.

sharedComputer?

sharedComputer?: boolean

Default false (05 §12.6).

setupToken?

setupToken?: string

The one-time first-admin setup token (21 §11.1 item 7).

Source: wire/accounts.ts:502

SignupTokenResponse interface

The code exchange's answer for an unknown external identity (05 §8.2). No device is created.

interface SignupTokenResponse

access_token

access_token: string

svs_…; usable only for POST /v1/auth/signup.

token_type

token_type: "Bearer"

expires_in

expires_in: number

Seconds; 900.

signupRequired

signupRequired: true

signup

signup: SignupInfo

Source: wire/accounts.ts:442

SloppyVoiceClientOptions interface

Options of SloppyVoiceClient.

interface SloppyVoiceClientOptions

client

client: string

Product and version, 1 to 128 printable ASCII characters, e.g. my-bot/1.0. Sent as client in session.hello (03 §5.4) and in remote-session requests (06 §6.1), and as the User-Agent product outside browsers (03 §2.3 item 6).

home?

home?: string

The home server's domain (02 §5.1). Default: the domain of address.

address?

address?: string

The account's canonical address (01); its domain is the home domain unless home says otherwise.

auth?

auth?: ClientAuth | null

The account credential, used only at the home server (03 §3). Without one, every server is used anonymously. A stored sign-in session is checked against the base URL it is bound to (session.baseUrl, 02 §10.6) and needs a durable discovery.pins store. A TokenProvider or a factory bypasses that check: such callers compare the factory's baseUrl with the one their credential was issued for themselves.

txt?

txt?: TxtResolver

The TXT resolver. Without homeBaseUrl it selects native discovery (02 §5.2): nodeTxtResolver() from @sloppyvoice/sdk/node on Node, Deno and Bun. With homeBaseUrl it is the optional DoH fallback of web discovery (dohTxtResolver, 02 §5.4).

homeBaseUrl?

homeBaseUrl?: string

The home server's base URL, for web clients that are served by their home server and can't query DNS (02 §5.4). It selects web discovery: the home server's /v1/resolve first, then txt (DoH) as the fallback. The home is still checked through its own /v1/resolve and /meta.

discovery?

discovery?: DiscoveryResolver | Partial<DiscoveryResolverOptions>

A discovery resolver to share between clients, or extra options for the one the client builds (pins, Public Suffix List, callbacks). The client's own fetch, clock, random and txt are used unless given here.

features?

features?: readonly string[]

Features to offer in session.hello (03 §12.2). Default none.

device?

device?: DeviceCredentials | () => DeviceCredentials | null | undefined | null

The enrolled device's DSK and DeviceCertificate, for remote sessions of a secure account (06 §5).

remoteSessions?

remoteSessions?: Record<string, PersistedRemoteSession>

Remote sessions restored from secure storage, by canonical domain, each bound to the base URL that issued it (06 §6.10 rule 8, 02 §10.6 token binding). A restored session is sent only to that base URL, or to one the client's own pin accepted as a move; otherwise it is dropped and a new one is created. Restored credentials need a durable discovery.pins store (02 §10.6 MUST).

onRemoteSession?

onRemoteSession?: (domain: string, record: PersistedRemoteSession | null) => void

Called with each new, renewed or rebound remote session, with the base URL it is bound to (or null when dropped): persist it in secure storage (06 §6.10 rule 8).

onRemoteStatus?

onRemoteStatus?: (domain: string, status: RemoteSessionStatus, error: unknown) => void

Status changes of remote sessions, for status lines (06 §15).

onRemoteDiagnostic?

onRemoteDiagnostic?: (domain: string, diagnostic: RemoteSessionDiagnostic) => void

Diagnostics of failed remote-session steps (06 §6.10 rule 7).

seqStore?

seqStore?: (domain: string) => SeqStore

Where each server's event-stream positions are kept (03 §7.3). Default: in memory.

fetch?

fetch?: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>

fetch for every HTTP request, discovery included. Default: globalThis.fetch.

MDN Reference

WebSocket?

WebSocket?: WebSocketConstructor

The WebSocket constructor for event sockets. Default: the global WebSocket.

clock?

clock?: Clock

The device clock. Default Date.now.

timers?

timers?: Timers

Timers for sockets, renewals and discovery. Default: the global setTimeout.

sleep?

sleep?: Sleep

Sleep between HTTP retries. Default: setTimeout.

random?

random?: () => number

Uniform [0, 1) source for jitter. Default: CSPRNG.

headers?

headers?: Record<string, string>

Extra headers on every HTTP request, such as Accept-Language (never Authorization).

timeoutMs?

timeoutMs?: number

Per-attempt HTTP timeout (03 §2.3 item 5). Default 30 s.

allowSpecialUseDomains?

allowSpecialUseDomains?: boolean

Development setting that allows special-use domains such as *.test (02 §5.1). MUST be off in release builds.

allowInsecureHttp?

allowInsecureHttp?: boolean

Allow http: base URLs. Non-conforming (03 §2.2 item 1); for local test servers only.

Source: client.ts:106

SloppyVoiceErrorOptions interface

Options for SloppyVoiceError.

interface SloppyVoiceErrorOptions

cause?

cause?: unknown

The underlying error, if any.

message?

message?: string

Override the error message (defaults to title, detail and code).

userAction?

userAction?: "none" | "retry" | "wait" | "sign_in" | "enable_encryption" | "set_up_device" | "update_app" | "contact_admin"

The userAction to report instead of the problem's own. Used to scope a non-home server's sign_in to wait (03 §10.2 scope rules); problem.userAction keeps the value as received.

Source: core/errors.ts:51

SourceRef interface

One subscribed source (15 §6.6).

interface SourceRef

pid

pid: number

sourceId

sourceId: number

Source: wire/calls.ts:784

Sources interface

What a participant says it is sending (15 §2.5.2). Informative; leases are authoritative.

interface Sources

screen

screen: boolean

screenAudio

screenAudio: boolean

webcam

webcam: boolean

Source: wire/calls.ts:335

StatementPinUpdate interface

The outcome of applying a statement to the pins (09 §13.3, §13.4).

interface StatementPinUpdate<P>

pin

pin: P | null

The pin to keep: created, updated or unchanged; null when none exists or is needed.

changed

changed: boolean

Whether pin differs from the input and must be saved.

w9

w9: W9Finding | null

The W9 this statement raises, or null.

action

action: "none" | "refetch"

refetch: a cached statement (or, for a community, an invite preview) conflicts with a pin; fetch the object again bypassing caches (Cache-Control: no-cache; for a preview, GET /v1/community) and apply the fresh statement.

Source: api/channels.ts:600

StoredHistoryShare interface

A HistoryShare as the server returns it (14 §7.4, §8.4), with the members it sets.

interface StoredHistoryShare extends HistoryShare

v

v: number

Format version, 1.

ctx

ctx: string

Context reference; MUST equal the path's context.

shareId

shareId: string

UUIDv7 generated by the sharing client.

recipient

recipient: string

Canonical address of the recipient account.

did

did: string

Device ID of the sharing device; MUST equal the session's device.

fromSeq

fromSeq: number

First seq of the range.

toSeq

toSeq: number

Last seq of the range, inclusive.

count

count: number

Items in the bundle, 1 to 5,000.

nonce

nonce: string

Bundle AES-GCM nonce, 16 characters.

ct

ct: string

Encrypted bundle plus tag: decoded length exactly 5 + 48 × count + 16.

keys

keys: HistoryShareKeyWrap[]

1 to 100 key wraps with distinct dids.

sig

sig: string

Labelled signature history-share by the sharing device's DSK, 86 characters.

sharer

sharer: string

Canonical address of the sharing account, from the posting session.

createdAt

createdAt: string

seq

seq: number

The seq of its history.shared event.

Source: wire/history.ts:193

StreamTrackerOptions interface

Options for StreamTracker.

interface StreamTrackerOptions

clock?

clock?: Clock

Clock for the "3 gaps within 5 minutes" rule (03 §7.3 rule 2).

gapLimit?

gapLimit?: number

Gaps that trigger the client's own resync. Default 3 (03 §7.3 rule 2).

gapWindowMs?

gapWindowMs?: number

Window for counting gaps. Default 5 minutes (03 §7.3 rule 2).

Source: events/tracker.ts:125

StructuredItem interface

One member of a structured-field List: its bare item and parameters.

interface StructuredItem

value

value: StructuredValue

params

params: Record<string, StructuredValue>

Source: core/http.ts:270

SubscriptionLimitData interface

data of session.subscription_limit (03 §10.6).

interface SubscriptionLimitData

max?

max?: number

Source: wire/transport.ts:168

SubscriptionResult interface

The result of subscribing one stream (03 §5.6).

interface SubscriptionResult

stream

stream: StreamName

The stream name.

level

level: SubscriptionLevel

full or heads.

status

status: SubscriptionStatus

ok or refused.

headSeq?

headSeq?: number

When ok: the stream's latest seq when the subscription took effect; 0 if it has no events yet.

replayThrough?

replayThrough?: number

Present when replay follows: events from the requested position + 1 up to this value are replays.

problem?

problem?: Problem

When refused: why (03 §10.1).

Source: wire/transport.ts:373

SvParticipant interface

One SvParticipant (13 §5.1): a person, by canonical address and identity-key thumbprint.

interface SvParticipant

address

address: string

Canonical address (01).

ikf

ikf: Uint8Array

Raw 32-byte SHA-256 RFC 7638 thumbprint of the identity key (the decoded ikf).

Source: mls/provider.ts:467

SvParticipantsOptions interface

Options of the sv_participants codec.

interface SvParticipantsOptions

isCanonicalAddress?

isCanonicalAddress?: (address: string) => boolean

Canonical-address check (01). The default is a syntax approximation: one @, no ASCII uppercase, NFC, and a canonical domain; plug in 01's full PRECIS check where available.

Source: mls/provider.ts:475

SystemItem interface

A timeline item owned by another document, in the form of its event (11 §7.1).

interface SystemItem

type

type: "event"

seq

seq: number

t

t: string

The event type, as its owner registered it.

ts

ts: string

The event's ts.

d

d: Record<string, unknown>

The event's payload as its owner defines it.

Source: wire/messaging.ts:461

TargetProtectedData interface

data of moderation.target_protected (10 §14).

interface TargetProtectedData

protected?

protected?: string[]

Source: wire/moderation.ts:1027

TextToken interface

A mention or channel token found in text (11 §3.4).

interface TextToken

type

type: "user" | "channel" | "everyone"

user for <@addr>, channel for <#addr>, everyone for <@everyone>.

addr?

addr?: string

The canonical address, for user and channel.

start

start: number

UTF-16 offset of < in text.

end

end: number

UTF-16 offset just after >.

Source: content.ts:247

ThisDeviceStatus interface

thisDevice of GET /v1/me/identity (07 §11.3).

interface ThisDeviceStatus

did

did: string

enrolled

enrolled: boolean

True when did is listed in devices.

Source: wire/identity.ts:195

ThumbnailRef interface

A preview image of an attachment, itself a separate upload (11 §3.6).

interface ThumbnailRef

id

id: string

Attachment ID of the thumbnail upload.

mime

mime: string & {} | "image/webp" | "image/jpeg" | "image/png"

image/webp, image/jpeg or image/png.

size

size: number

Size before encryption; at most THUMB_MAX_BYTES.

width

width: number

At most THUMB_MAX_PX on the longer side.

height

height: number

sha256?

sha256?: string

base64url SHA-256 of the thumbnail before encryption. Secure: required.

key?

key?: string

The thumbnail's own 32-byte file key, base64url. Secure: required; insecure: MUST be absent.

Source: wire/messaging.ts:201

TimedOutData interface

data of moderation.timed_out (10 §14).

interface TimedOutData

until

until: string

Source: wire/moderation.ts:1018

TimelineParams interface

Parameters of a timeline list (03 §13.1); extra members are passed as query parameters.

interface TimelineParams

before?

before?: number

Return the items with the highest seq below this value. Exclusive with after.

after?

after?: number

Return the items with the lowest seq above this value. Exclusive with before.

limit?

limit?: number

1 to 100; default 50.

Source: core/pagination.ts:31

Timeout interface

A timeout (10 §8.5). Keyed by member (and the member's incarnation, stored by the server).

interface Timeout

member

member: string

Canonical address.

until

until: string

When it ends.

reason?

reason?: string

Visible only to holders of timeout_members, and to the target if showReason.

showReason

showReason: boolean

createdBy

createdBy: Actor

Never shown to the target.

createdAt

createdAt: string

reportId?

reportId?: string | null

Source: wire/moderation.ts:265

TimeoutRequest interface

Body of POST /v1/moderation/timeouts (10 §8.5).

interface TimeoutRequest extends ModerationCommon

reason?

reason?: string

0–512 Unicode scalar values; stored in the audit log.

showReason?

showReason?: boolean

Show reason to the target. Default false.

reportId?

reportId?: string

Link the audit entry (and the report's actions) to this report.

member

member: string

durationMs

durationMs: number

60,000 (1 minute) to 2,419,200,000 (28 days).

Source: wire/moderation.ts:280

Timers interface

Timer functions for the socket's timeouts (03 §5.3, §5.9, §5.11), injectable for tests. Default: the global setTimeout and clearTimeout.

interface Timers

setTimeout

setTimeout(callback: () => void, ms: number): unknown
callback: () => void
ms: number

clearTimeout

clearTimeout(handle: unknown): void
handle: unknown

Source: events/websocket.ts:66

TokenProvider interface

A source of credentials for one client session at one server (03 §3).

The SDK sends a provider's token only to the base URL of the server that issued it (03 §3.2 rule 3), and never in a URL (03 §3.2 rule 1).

interface TokenProvider

scheme

readonly scheme: AuthScheme

'Bearer' for home/remote sessions, 'Bot' for bot tokens at the bot's home server (03 §3.1).

kind

readonly kind: "home" | "remote" | "bot" | "static"

What kind of credential this is, which decides recovery (03 §3.3).

token

token(signal?: AbortSignal): Promise<string>

The current token, refreshing first if it is about to expire.

signal?: AbortSignal

expiresAt

expiresAt(): Date | null

When the current token expires (for session.reauth scheduling, 03 §5.13), or null.

recover

recover(problem: Problem | null, signal?: AbortSignal): Promise<boolean>

Called after a 401 (or a 4001 socket close). Resolve true if a fresh token is now available and the request should be retried once (03 §3.3). Resolve false only for a definitive failure (the credential can't be renewed without the user); reject for a transient one (network, home server unreachable), which an HTTP caller then sees as is and an event socket retries on its reconnect schedule.

problem: Problem | null
signal?: AbortSignal

onChange

onChange(listener: (token: string) => void): () => void

Subscribe to token changes (so the EventSocket can send session.reauth, 03 §5.13). Returns an unsubscribe function.

listener: (token: string) => void

Source: core/auth.ts:25

TooLargeData interface

data of core.too_large (03 §10.5, §16.1 rule 4).

interface TooLargeData

limit?

limit?: string

The limit name, for example maxRequestBytes.

max?

max?: number

The limit's value.

Source: wire/transport.ts:138

TooSimilarData interface

data of address.too_similar (01 §5.3). It never reveals the entry it collided with.

interface TooSimilarData

field

field: string & {} | "name" | "local"

Source: wire/addressing.ts:241

Track interface

One transceiver of an SFU session (15 §8.2).

interface Track

mid

mid: string

direction

direction: TrackDirection

send (published by this device) or recv (subscribed).

pid

pid: number

The publishing participant.

sourceId

sourceId: number

1, 2 or 3.

state

state: TrackState

active or paused; unknown values are paused.

Source: wire/calls.ts:588

TrustedKey interface

A key that key holders vouch for: an element of the set T of 02 §12.3.

interface TrustedKey

thumbprint

thumbprint: string

kid

kid: string

purpose

purpose: string

Source: discovery/keychain.ts:116

TurnIceServer interface

One TURN ICE server entry returned by a TURN-assisted relay (15 §6.10.2).

interface TurnIceServer

urls

urls: string[]

One to four turn: or turns: URIs.

username

username: string

credential

credential: string

Source: wire/calls.ts:652

TxtResolver interface

Looks up TXT records (02 §3.5): one query, recursion desired, 5 s per attempt, at most 2 attempts, 10 s in total. Implementations never throw for DNS outcomes; they return a TxtLookupResult. (A thrown error is treated as error.)

interface TxtResolver

resolveTxt

resolveTxt(name: string, options?: { signal?: AbortSignal }): Promise<TxtLookupResult>
name: string
options?: { signal?: AbortSignal }

resolveAddress?

resolveAddress(name: string, options?: { signal?: AbortSignal }): Promise<AddressLookupResult>

Optional A/AAAA check. Runtimes other than Node report a failed host lookup of fetch without a recognisable code, so the resolver asks this after a .well-known network failure to tell "D has no address" (discovery.not_found) from "unreachable" (02 §4.2, §4.3 W-a). Without it, that distinction is made only from Node's error codes.

name: string
options?: { signal?: AbortSignal }

Source: discovery/txt.ts:45

TypingEvent interface

d of typing.started and typing.stopped (11 §10.2).

interface TypingEvent

sender

sender: Sender

The typing account; did is the typing device.

expiresInMs?

expiresInMs?: number

Only on typing.started: 8,000.

Source: wire/messaging.ts:641

TypingRequest interface

The body of POST /v1/contexts/{ctx}/typing (11 §10.1).

interface TypingRequest

typing

typing: boolean

Source: wire/messaging.ts:636

UnlinkProviderResponse interface

Response 200 of DELETE /v1/me/providers/{linkId} (05 §10.4).

interface UnlinkProviderResponse

unlinked

unlinked: string

The linkId removed.

devicesSignedInWithIt

devicesSignedInWithIt: string[]

Active devices whose sessions were created through this link.

Source: wire/accounts.ts:611

UnsupportedFeatureData interface

data of core.unsupported_feature (03 §10.5).

interface UnsupportedFeatureData

feature?

feature?: string

Source: wire/transport.ts:163

UnsupportedMediaTypeData interface

data of core.unsupported_media_type (03 §10.5).

interface UnsupportedMediaTypeData

accept?

accept?: string[]

Source: wire/transport.ts:146

UnsupportedMessageData interface

data of session.unsupported_message (03 §10.6).

interface UnsupportedMessageData

type?

type?: string

Source: wire/transport.ts:173

UnsupportedVersionData interface

data of core.unsupported_version (03 §10.5).

interface UnsupportedVersionData

supported?

supported?: string[]

minClient?

minClient?: string

Source: wire/transport.ts:157

UpdateAccountRequest interface

Body of PATCH /v1/me (05 §11.6); also the name/about part of PATCH /v1/bots/{local}.

interface UpdateAccountRequest

name?

name?: string

New display name (01 §6.3); empty or white space resets it to the prepared local part.

about?

about?: string

0–190 code points, at most 4 line breaks.

Source: wire/accounts.ts:549

UpdateBanRequest interface

Body of PATCH /v1/bans/{banId} (10 §9.6): reason, showReason or expiresAt. SPEC-ISSUE: the PATCH body form of expiresAt (timestamp vs duration, null for permanent) is inferred from the Ban object (10 §9.6).

interface UpdateBanRequest

reason?

reason?: string

showReason?

showReason?: boolean

expiresAt?

expiresAt?: string | null

Source: wire/moderation.ts:372

UpdateBotRequest interface

Body of PATCH /v1/bots/{local} (05 §15.3).

interface UpdateBotRequest extends UpdateAccountRequest

name?

name?: string

New display name (01 §6.3); empty or white space resets it to the prepared local part.

about?

about?: string

0–190 code points, at most 4 line breaks.

owner?

owner?: string

New owner's canonical address; requires fresh authentication.

Source: wire/accounts.ts:642

UpdateDeviceRequest interface

Body of PATCH /v1/me/devices/{did} (05 §12.9).

interface UpdateDeviceRequest

name

name: string

Source: wire/accounts.ts:561

UpdateDmIndexEntryRequest interface

Body of PATCH /v1/me/dms/{id} (12 §9.3).

interface UpdateDmIndexEntryRequest

hidden

hidden: boolean

Source: wire/dms.ts:379

UpdateDmRequest interface

Body of PATCH /v1/dms/{ctx}: set or clear (null) a group's name (12 §7.5).

interface UpdateDmRequest

name

name: string | null

Source: wire/dms.ts:189

UpdateFederationPolicyRequest interface

PATCH /v1/federation/policy body: either member optional (06 §12.4).

interface UpdateFederationPolicyRequest

mode?

mode?: FederationPolicyMode

allows?

allows?: string[]

Source: wire/federation.ts:556

UpdatePushRegistrationRequest interface

Body of PUT /v1/me/push-registrations/{id} (19 §9.2): replaces types and the transport data. transport and gatewayUrl can't change.

interface UpdatePushRegistrationRequest

types

types: PushType[]

pushKey?

pushKey?: string

webPush?

webPush?: WebPushSubscriptionKeys

vapidKey?

vapidKey?: string

rotateFetchToken?

rotateFetchToken?: boolean

Issue a new fetch token; the old one stops working at once. The 30-day re-registration MUST set it.

Source: wire/notifications.ts:525

UpdateReportRequest interface

Body of PATCH /v1/reports/{id} (10 §10.8).

interface UpdateReportRequest

status?

status?: "open" | "in_review" | "resolved"

in_review to claim, open to unclaim or reopen, resolved with resolution.

resolution?

resolution?: "duplicate" | "action_taken" | "no_action" | "invalid"

resolutionNote?

resolutionNote?: string | null

assignee?

assignee?: string | null

preserveEvidence?

preserveEvidence?: boolean

Admins only.

ifVersion?

ifVersion?: number

409 report.version_conflict if it differs.

Source: wire/moderation.ts:595

UpdateRoleRequest interface

Body of PATCH /v1/roles/{roleId} (10 §7.3): any subset of name, color, showSeparately, and a permission change either as a whole permissions list or as addPermissions/removePermissions (preferred: it preserves permissions the client doesn't know, 10 §3.3). The two forms can't be combined.

interface UpdateRoleRequest

name?

name?: string

color?

color?: string | null

showSeparately?

showSeparately?: boolean

permissions?

permissions?: Permission[]

Replace the whole list.

addPermissions?

addPermissions?: Permission[]

Add only these names.

removePermissions?

removePermissions?: Permission[]

Remove only these names.

ifVersion?

ifVersion?: number

Conditional edit: 409 role.version_conflict if the role's version differs.

Source: wire/moderation.ts:106

UpdateWebhookRequest interface

The body of PATCH /v1/contexts/{ctx}/webhooks/{id} (11 §15.3).

interface UpdateWebhookRequest

name?

name?: string

state?

state?: "active" | "disabled"

allowMentionAll?

allowMentionAll?: boolean

Source: wire/messaging.ts:810

UpgradeGroupBootstrap interface

A GroupBootstrap (13 §7.4), embedded unchanged as bootstrap of the channel-upgrade confirmation (09 §10.4). Named here so this file has no dependency on the MLS wire module.

interface UpgradeGroupBootstrap

generation

generation: number

The context's current generation; 1 for a channel becoming secure for the first time.

groupInfo

groupInfo: string

Epoch-0 GroupInfo with one leaf (the calling device), base64url.

ekid

ekid: string

ekid(0) (14).

Source: wire/communities.ts:483

UploadAttachmentOptions interface

Options of AttachmentsApi.uploadAttachment.

interface UploadAttachmentOptions extends RequestOptions

secure

secure: boolean

Whether the context is secure: the file is then SVF1-encrypted under a fresh key (11 §14.3).

name

name: string

File name for the AttachmentRef (1 to 255 bytes of UTF-8).

mime?

mime?: string

The file's media type, lowercase type/subtype. Default application/octet-stream.

width?

width?: number

height?

height?: number

durationMs?

durationMs?: number

thumb?

thumb?: ThumbnailRef

A thumbnail already uploaded with AttachmentsApi.uploadThumbnail.

spoiler?

spoiler?: boolean

voice?

voice?: boolean

signal?

signal?: AbortSignal

Cancels the request and any automatic retry (03 §2.7 item 3).

idempotencyKey?

idempotencyKey?: string

Sent as Idempotency-Key (03 §14.2). Create calls with a client-generated ID (mid) don't need it.

Source: api/attachments.ts:76

UploadedAttachment interface

The result of an upload: the server's record and the reference to put in the content.

interface UploadedAttachment<R>

attachment

attachment: Attachment

ref

ref: R

The reference for the content object (with key and sha256 in a secure context).

Source: api/attachments.ts:103

UploadInstructions interface

Where to send the blob bytes (11 §14.2).

interface UploadInstructions

url

url: string

{base}/v1/contexts/{ctx}/attachments/{id}/content or a pre-signed capability URL.

method

method: "PUT" | string & {}

Always PUT.

headers

headers: Record<string, string>

Headers the client MUST send unchanged.

expiresAt

expiresAt: string

The latest time at which the PUT may start.

Source: wire/messaging.ts:759

UploadRevocationRequest interface

Body of POST /v1/me/identity/revocations (07 §11.7).

interface UploadRevocationRequest

revocation

revocation: string

A DeviceRevocation JWS (07 §8).

Source: wire/identity.ts:242

UploadThumbnailOptions interface

Options of AttachmentsApi.uploadThumbnail.

interface UploadThumbnailOptions extends RequestOptions

secure

secure: boolean

mime

mime: "image/webp" | "image/jpeg" | "image/png"

image/webp, image/jpeg or image/png.

width

width: number

At most 512 on the longer side.

height

height: number

signal?

signal?: AbortSignal

Cancels the request and any automatic retry (03 §2.7 item 3).

idempotencyKey?

idempotencyKey?: string

Sent as Idempotency-Key (03 §14.2). Create calls with a client-generated ID (mid) don't need it.

Source: api/attachments.ts:93

UuidV7GeneratorOptions interface

Options for UuidV7Generator.

interface UuidV7GeneratorOptions

clock?

clock?: Clock

Time source; 03 §2.3 item 4 recommends a ServerClock-corrected clock. Default: the device clock.

random?

random?: RandomSource

CSPRNG for rand_b and counter seeds (03 §8.2 item 2). Default: crypto.getRandomValues.

Source: core/uuidv7.ts:61

ValidateMetadataOptions interface

Options of validateServerMetadata.

interface ValidateMetadataOptions

baseUrl

baseUrl: string

B: the normalized base URL the metadata was fetched from. endpoints.api must equal it.

domain?

domain?: string

The queried domain, for error data only.

now?

now?: number

The consumer's clock (Unix ms) for the key-set time checks (02 §11.5 rule 5). Default Date.now().

implementedVersions?

implementedVersions?: readonly string[]

Protocol versions the consumer implements (major.minor). Default [PROTOCOL_VERSION].

allowSpecialUse?

allowSpecialUse?: boolean

Development setting: allow special-use names in domains (02 §5.1). Off by default.

Source: discovery/metadata.ts:36

ValidateNotifyEventOptions interface

Options of validateNotifyEvent (19 §5.6).

interface ValidateNotifyEventOptions

iss

iss: string

The verified S2S token's iss.

isCanonicalAddress?

isCanonicalAddress?: (addr: string) => boolean

Address canonicality check of 01 (rule V7). Omit to skip V7.

Source: api/notifications.ts:633

ValidateOptions interface

Options of contentIssues.

interface ValidateOptions

mode?

mode?: "insecure" | "secure"

The carrier the content travels in. secure requires key and sha256 on files (11 §3.6). Default insecure.

maxMessageBytes?

maxMessageBytes?: number

The hosting server's maxMessageBytes (11 §2.3). Default: the 8,192 floor.

maxAttachmentBytes?

maxAttachmentBytes?: number

The hosting server's maxAttachmentBytes (11 §2.3). Default: the 8 MiB floor.

isCanonicalAddress?

isCanonicalAddress?: MentionAddressCheck

Canonical-address check (01 §7.5). Default: the 01 module's isCanonical, checks 1 to 5.

previous?

previous?: MessageContent | EditContent

For an edit: the message's previous content, to check replyTo and attachments (11 §3.7.1).

webhook?

webhook?: boolean

Webhook content: only text, mentions and mentionAll (11 §15.4).

skipSize?

skipSize?: boolean

Skip the size check (for example when the caller measures itself).

Source: content.ts:491

VaultChangedEvent interface

d of vault.changed (08 §14.3).

interface VaultChangedEvent

igen

igen: number

vseq

vseq: number

items

items: ({ rid: string; type: VaultRecordType; bucket: string | null; ver: number; deleted: boolean })[]

At most 100 items.

truncated

truncated: boolean

More changed than listed; read the change feed.

Source: wire/device-setup.ts:665

VaultChangesExpiredData interface

data of vault.changes_expired (08 §15).

interface VaultChangesExpiredData

oldestVseq

oldestVseq: number

Source: wire/device-setup.ts:779

VaultChangesPage interface

Response of GET /v1/me/vault/changes (08 §8.8). Items of types not asked for carry headers only.

interface VaultChangesPage

items

items: VaultRecord[]

vseq

vseq: number

The cursor: the vseq of the last item, or since when there are none.

headVseq

headVseq: number

The vault's newest vseq when the response was built (informative).

hasMore

hasMore: boolean

Source: wire/device-setup.ts:400

VaultChangesParams interface

Query of GET /v1/me/vault/changes (08 §8.8).

interface VaultChangesParams

since

since: number

limit?

limit?: number

1 to 500, default 200.

type?

type?: VaultRecordType[]

The types whose nonce and ct the client wants (repeatable).

Source: wire/device-setup.ts:410

VaultGeneration interface

One vault key generation (08 §10.2).

interface VaultGeneration

vgen

vgen: number

kcv

kcv: string

base64url of kcv(vgen) (8 bytes).

idStateVer

idStateVer: number

The ver of the IdentityState the creator used.

createdBy

createdBy: string

devcert

devcert: string

sig

sig: string

createdAt

createdAt: string

Source: wire/device-setup.ts:540

VaultGenerationContext interface

What the verifying device knows when it checks a generation (08 §10.2.1).

interface VaultGenerationContext

addr

addr: string

identity

identity: IdentityCertificateTuple

The account's IdentityCertificate tuple (the verifier holds the identity key).

state

state: VerifiedIdentityState

A fresh own IdentityState (07 §7.6) with ver at least the generation's idStateVer.

revokedDids?

revokedDids?: ReadonlySet<string>

Devices that any own IdentityState this device accepted listed in revoked.

now?

now?: number | Date

NumericDate seconds or Date, for certificate and freshness checks.

Source: api/vault.ts:466

VaultGenerationCreate interface

Body of POST /v1/me/vault/keys (08 §10.5).

interface VaultGenerationCreate

igen

igen: number

vgen

vgen: number

prevVgen

prevVgen: number

0 for generation 1.

kcv

kcv: string

grants

grants: VaultGrantInput[]

idStateVer

idStateVer: number

createdBy

createdBy: string

devcert

devcert: string

sig

sig: string

Source: wire/device-setup.ts:575

VaultGenerationFields interface

The fields of a VaultGenerationTBS (08 §10.2).

interface VaultGenerationFields

addr

addr: string

igen

igen: number

vgen

vgen: number

linkedVgen

linkedVgen: number

0 for generation 1.

kcv

kcv: string

base64url of the 8-byte kcv.

idStateVer

idStateVer: number

createdBy

createdBy: string

The creator's did.

Source: api/vault.ts:372

VaultGrantInput interface

A grant in a generation create or grants post (08 §10.3).

interface VaultGrantInput

did

did: string

enc

enc: string

base64url of 32 bytes.

ct

ct: string

base64url of 48 bytes.

Source: wire/device-setup.ts:566

VaultGrantNeededEvent interface

d of vault.grant_needed (08 §14.3).

interface VaultGrantNeededEvent

igen

igen: number

vgen

vgen: number

did

did: string

Source: wire/device-setup.ts:695

VaultGrantsPost interface

Body of POST /v1/me/vault/grants (08 §10.3).

interface VaultGrantsPost

igen

igen: number

vgen

vgen: number

grants

grants: VaultGrantInput[]

Source: wire/device-setup.ts:598

VaultGrantsPostResponse interface

Response of POST /v1/me/vault/grants (08 §10.3).

interface VaultGrantsPostResponse

accepted

accepted: string[]

rejected

rejected: ({ did: string; reason: string & {} | "not_active" | "no_box_key" })[]

Source: wire/device-setup.ts:605

VaultIntegrityDiagnosticData interface

data of a vault_integrity diagnostic (08 §16.4).

interface VaultIntegrityDiagnosticData

check

check: "generation" | "rid" | "type" | "bucket" | "decrypt" | "generation_conflict" | "orphaned"

rid?

rid?: string

vgen?

vgen?: number

Source: wire/device-setup.ts:635

VaultKeyGrant interface

A VaultKeyGrant as GET /v1/me/vault/grants returns it (08 §10.3).

interface VaultKeyGrant extends VaultGrantInput

did

did: string

enc

enc: string

base64url of 32 bytes.

ct

ct: string

base64url of 48 bytes.

igen

igen: number

vgen

vgen: number

createdAt

createdAt: string

createdBy

createdBy: string

Source: wire/device-setup.ts:590

VaultKeyLink interface

A VaultKeyLink (08 §10.2).

interface VaultKeyLink

linkedVgen

linkedVgen: number

The generation it wraps (normally vgen − 1).

nonce

nonce: string

ct

ct: string

Source: wire/device-setup.ts:532

VaultKeyRotatedEvent interface

d of vault.key_rotated (08 §14.3).

interface VaultKeyRotatedEvent

igen

igen: number

vgen

vgen: number

createdBy

createdBy: string

Source: wire/device-setup.ts:688

VaultKeysState interface

Response of GET /v1/me/vault/keys (08 §10.2).

interface VaultKeysState

igen

igen: number

vgen

vgen: number

rotationPending

rotationPending: boolean

pendingAt

pendingAt: string | null

phraseChangePending

phraseChangePending: boolean

orphaned

orphaned: boolean

generations

generations: VaultGeneration[]

Source: wire/device-setup.ts:555

VaultListParams interface

Query of GET /v1/me/vault/records (08 §8.7.2).

interface VaultListParams

type?

type?: VaultRecordType

bucket?

bucket?: string

igen?

igen?: number

A retired generation (08 §8.12).

cursor?

cursor?: string

limit?

limit?: number

1 to 500, default 100.

Source: wire/device-setup.ts:389

VaultRecord interface

The VaultRecord wire object (08 §8.3).

interface VaultRecord extends VaultRecordContent

rid

rid: string

base64url of the 16-byte record ID.

type

type: VaultRecordType

bucket

bucket: string | null

base64url of a 16-byte bucket tag, or null; only archive and shared_keys carry one.

igen

igen: number

The vault's igen.

vgen

vgen: number

The generation whose key encrypted this version.

nonce?

nonce?: string

base64url of 12 bytes; absent on tombstones.

ct?

ct?: string

base64url of the ciphertext and tag; absent on tombstones.

ver

ver: number

vseq

vseq: number

deleted

deleted: boolean

updatedAt

updatedAt: string

updatedBy

updatedBy: string

Source: wire/device-setup.ts:325

VaultRecordContent interface

The members of a VaultRecord a client sets (08 §8.3).

interface VaultRecordContent

rid

rid: string

base64url of the 16-byte record ID.

type

type: VaultRecordType

bucket

bucket: string | null

base64url of a 16-byte bucket tag, or null; only archive and shared_keys carry one.

igen

igen: number

The vault's igen.

vgen

vgen: number

The generation whose key encrypted this version.

nonce?

nonce?: string

base64url of 12 bytes; absent on tombstones.

ct?

ct?: string

base64url of the ciphertext and tag; absent on tombstones.

Source: wire/device-setup.ts:308

VaultRecordProblem interface

A per-record problem in a vault write result (08 §8.7.3).

interface VaultRecordProblem

type

type: string

code

code: string

title

title: string

status

status: number

retryable?

retryable?: boolean

userAction?

userAction?: string

detail?

detail?: string

data?

data?: Record<string, unknown>

Source: wire/device-setup.ts:347

VaultRecordWrite interface

One item of PUT /v1/me/vault/records (08 §8.7.3).

interface VaultRecordWrite extends VaultRecordContent

rid

rid: string

base64url of the 16-byte record ID.

type

type: VaultRecordType

bucket

bucket: string | null

base64url of a 16-byte bucket tag, or null; only archive and shared_keys carry one.

igen

igen: number

The vault's igen.

vgen

vgen: number

The generation whose key encrypted this version.

nonce

nonce: string

base64url of 12 bytes; absent on tombstones.

ct

ct: string

base64url of the ciphertext and tag; absent on tombstones.

ifVer

ifVer: number

0 to create; n > 0 to replace version n. The stored version becomes ifVer + 1.

Source: wire/device-setup.ts:334

VaultRotationNeededEvent interface

d of vault.rotation_needed (08 §14.3).

interface VaultRotationNeededEvent

igen

igen: number

vgen

vgen: number

The current (old) generation.

pendingAt

pendingAt: string

did

did: string

The delisted device.

reason

reason: string

Its 05 revokedReason; unknown values are treated as other.

phraseChangePending

phraseChangePending: boolean

Source: wire/device-setup.ts:675

VaultSummary interface

Response of GET /v1/me/vault (08 §8.7.1). vgen 0 means uninitialized.

interface VaultSummary

igen

igen: number

vgen

vgen: number

rotationPending

rotationPending: boolean

vseq

vseq: number

recordCount

recordCount: number

bytesUsed

bytesUsed: number

quotaBytes

quotaBytes: number

retired

retired: RetiredVault[]

Source: wire/device-setup.ts:377

VaultVersionConflictData interface

data of vault.version_conflict (08 §8.7.3).

interface VaultVersionConflictData

currentVer

currentVer: number

deleted?

deleted?: boolean

Source: wire/device-setup.ts:773

VaultWriteRequest interface

Body of PUT /v1/me/vault/records (08 §8.7.3): 1 to 100 records.

interface VaultWriteRequest

records

records: VaultRecordWrite[]

Source: wire/device-setup.ts:342

VaultWriteResponse interface

Response of PUT /v1/me/vault/records (08 §8.7.3).

interface VaultWriteResponse

results

results: VaultWriteResult[]

vseq

vseq: number

Source: wire/device-setup.ts:364

VerifiedDeviceListing interface

One entry of devices with its DeviceCertificate check (07 §11.1 deviceCertificates).

interface VerifiedDeviceListing

entry

entry: DeviceEntry

certificate

certificate: VerifiedDeviceCertificate | null

The verified certificate, or null when it failed (see reason).

reason

reason: IdentityCheckResult | null

The identity check result when the certificate doesn't back the entry.

Source: api/identity.ts:37

VerifiedIdentityResponse interface

An IdentityResponse whose state passed 07 §7.4 and whose certificates were checked against it.

interface VerifiedIdentityResponse

address

address: string

state

state: VerifiedIdentityState

devices

devices: VerifiedDeviceListing[]

Source: api/identity.ts:46

VerifiedPushToken interface

A verified sv-push+jwt: its header and claims (19 §11.4).

interface VerifiedPushToken

header

header: { alg: "EdDSA"; typ: "sv-push+jwt"; kid: string }

claims

claims: PushTokenClaims

Source: auth/remote.ts:962

VerifiedS2SToken interface

A verified S2S token: its header and claims (06 §8.2, §8.5).

interface VerifiedS2SToken

header

header: S2STokenHeader

claims

claims: S2STokenClaims

Source: auth/remote.ts:819

VerifyDeviceProofOptions interface

Options of verifyDeviceProof (06 §6.3.3).

interface VerifyDeviceProofOptions

dsk

dsk: FederationKey

The DSK from the verified DeviceCertificate (06 §6.3.3 step 3).

dkf

dkf: string

The assertion's dkf; the proof's kid must equal it.

audience

audience: string

This server's canonical domain.

ajti

ajti: string

The assertion's jti.

now?

now?: number | Date

NumericDate seconds or a Date. Default: now.

Source: auth/remote.ts:598

VerifyHomeAssertionOptions interface

Options of verifyHomeAssertion and verifySessionRequest (06 §6.3).

interface VerifyHomeAssertionOptions

audience

audience: string

This server's canonical domain (06 §6.3 V4).

aliases?

aliases?: readonly string[]

This server's alias domains: an assertion naming one gets 400 address.non_canonical (V4).

key

key: ServerKeyResolver

02's key lookup for the issuer (V10). Called only after every local check passed.

now?

now?: number | Date

The verifier's time: NumericDate seconds or a Date. Default: now.

checkSubject?

checkSubject?: (sub: string) => boolean

Replace the V6 check of sub against 01 §7.5 checks 1 to 5. The default is the addressing module's checkCanonical (01 §7.5, AD-8: the full profile is never run). Return false to fail with 400 address.non_canonical.

Source: auth/remote.ts:428

VerifyPushTokenOptions interface

Options of verifyPushToken (19 §11.5).

interface VerifyPushTokenOptions

baseUrl

baseUrl: string

The gateway's configured public base URL without a trailing slash (G7, G8).

method

method: string

The request method (G8).

requestTarget

requestTarget: string

The request-target exactly as received (path and query), e.g. /gw/v1/push (G8, 06 §8.3).

body

body: string | Uint8Array<ArrayBufferLike>

The request content as received (G9).

key

key: ServerKeyResolver

02's serverKey(iss, kid, "sign", iat) (G5). Throw address.non_canonical when iss resolves to another canonical domain.

blocked?

blocked?: (iss: string) => boolean | Promise<boolean>

The gateway's block list (G4).

now?

now?: number | Date

NumericDate seconds or a Date. Default: now.

Source: auth/remote.ts:944

VerifyRelayTicketOptions interface

Options of verifyRelayTicket (15 §5.2).

interface VerifyRelayTicketOptions

key

key: (ctx: JwsKeyContext) => Uint8Array<ArrayBufferLike> | Ed25519PublicJwk | Promise<Uint8Array<ArrayBufferLike> | Ed25519PublicJwk | null> | null

The public key for the ticket's kid. Called with the parsed kid, whose domain already equals iss. It MUST return a key only if iss is a hosting server this relay serves and the key is a sign key usable for this ticket under 02 §11.6 step 5 (status active, next with now ≥ nbf, or retired with iat ≤ retiredAt; thumbprint not revoked; iat ≥ nbf; ±60 s skew), and return null otherwise (15 §5.2 item 2).

relayUrls

relayUrls: readonly string[]

The relay's own URLs; aud must equal one of them exactly (15 §5.2 item 4).

jtiStore

jtiStore: JtiStore

Replay protection (15 §5.2 item 6).

now?

now?: number

The relay's time as a NumericDate (seconds). Defaults to the system clock.

Source: calls/relay-ticket.ts:128

VerifyS2STokenOptions interface

Options of verifyS2SToken (06 §8.5).

interface VerifyS2STokenOptions

audience

audience: string

This server's canonical domain (R5).

method

method: string

The request method (R6).

targetUri

targetUri: string

origin(baseUrl) + request-target: the scheme, host and port of this server's configured public base URL followed by the request-target exactly as received (06 §8.3). It is normalized here (R7).

body?

body?: string | Uint8Array<ArrayBufferLike> | null

The request content as received (R8); null or empty for none.

key

key: ServerKeyResolver

02's key lookup for iss (R11).

now?

now?: number | Date

NumericDate seconds or a Date. Default: now.

Source: auth/remote.ts:799

VideoAudienceFeedback interface

video_audience: relay-originated, no from (17 §7.5).

interface VideoAudienceFeedback

kind

kind: "video_audience"

sourceId

sourceId: VideoSourceId

viewers

viewers: number

Sessions currently subscribed to this source through relay.subscribe.

Source: wire/media.ts:230

VideoPreference interface

video_pref, the VideoPreference: whether a viewer watches a source, at what size and frame rate, and what it can decode (17 §7.3).

interface VideoPreference

kind

kind: "video_pref"

sourceId

sourceId: VideoSourceId

1 or 3.

subscribed

subscribed: boolean

Whether the viewer watches the source now. Informative: forwarding follows relay.subscribe (15 §6.6) on the relay and the viewer's SFU subscription (17 §12.3) on the SFU route; the sender uses it to know its viewers (17 §7.3).

maxWidth?

maxWidth?: number

16–3,840: the LARGER edge, in device pixels, of the viewer's display area (not the width). Absent: no cap.

maxHeight?

maxHeight?: number

16–3,840: the SMALLER edge of that area (not the height). Absent: no cap.

maxFps?

maxFps?: number

1–60. Absent: no cap.

decode

decode: VideoCodecNameWire[]

Codec names the viewer decodes in real time; MUST include vp8; at most 8 entries; unknown names ignored.

Source: wire/media.ts:177

VideoRecvStats interface

Per-(pid, sourceId) receive counters of VideoStats; pid −1 is the summed overflow entry (17 §14).

interface VideoRecvStats

pid

pid: number

sourceId

sourceId: VideoSourceId

route

route: MediaRoute

codec

codec: VideoCodecNameWire

width

width: number

height

height: number

fragmentsReceived

fragmentsReceived: number

fragmentsDuplicate

fragmentsDuplicate: number

fragmentsLate

fragmentsLate: number

framesComplete

framesComplete: number

framesIncomplete

framesIncomplete: number

framesDecoded

framesDecoded: number

framesDisplayed

framesDisplayed: number

framesShownLate

framesShownLate: number

framesLate

framesLate: number

framesUndecodable

framesUndecodable: number

keyframeRequestsSent

keyframeRequestsSent: number

decryptFailures

decryptFailures: number

leaseDrops

leaseDrops: number

attestationStops

attestationStops: number

heldMs

heldMs: number

heldEntries

heldEntries: number

avSkewP95Ms

avSkewP95Ms: number | null

Source 1 with source 2: p95 of the absolute presentation skew; otherwise null.

lipSyncP95Ms

lipSyncP95Ms: number | null

Source 3: p95 of webcam lateness relative to the voice; otherwise null.

Source: wire/media.ts:498

VideoReportFeedback interface

video_report: a viewer's report on one source, every 1,000 ms (17 §7.4).

interface VideoReportFeedback

kind

kind: "video_report"

sourceId

sourceId: VideoSourceId

1 or 3.

gen

gen: number

The stream generation reported on (0–4,095). Reports for an old gen are ignored.

intervalMs

intervalMs: number

Length of the interval covered (about 1,000).

framesComplete

framesComplete: number

framesIncomplete

framesIncomplete: number

framesLate

framesLate: number

framesUndecodable

framesUndecodable: number

waitingKeyframe

waitingKeyframe: boolean

The viewer's chain is broken now.

rxKbps

rxKbps: number

congested

congested: boolean

17 §7.4.1.

Source: wire/media.ts:198

VideoSendStats interface

Per-source sending counters of VideoStats (17 §14).

interface VideoSendStats

sourceId

sourceId: VideoSourceId

route

route: MediaRoute

videoRoute

videoRoute: VideoRoute

codec

codec: VideoCodecNameWire

contentHint

contentHint: string & {} | ContentHint | null

detail or motion for source 1; null for source 3.

rung

rung: number

Effective rung (dc only; −1 on sfu).

controllerRung

controllerRung: number

Controller rung r (17 §9.2; −1 on sfu).

width

width: number

height

height: number

fps

fps: number

targetKbps

targetKbps: number

framesEncoded

framesEncoded: number

keyframes

keyframes: number

keyframeRequests

keyframeRequests: number

picturesSkipped

picturesSkipped: number

framesDiscarded

framesDiscarded: number

pressureSignals

pressureSignals: number

stepDowns

stepDowns: number

stepUps

stepUps: number

failedStepUps

failedStepUps: number

viewers

viewers: number

slowViewers

slowViewers: number

Source: wire/media.ts:469

VideoStats interface

The optional video member of 15's diagnostics Sample (17 §14).

interface VideoStats

send

send: VideoSendStats[]

recv

recv: VideoRecvStats[]

At most 32 entries when recorded and 4 when uploaded; the rest summed into pid −1.

invalidDrops

invalidDrops: number

codecUnsupported

codecUnsupported: number

Source: wire/media.ts:528

VideoUploadPressureFeedback interface

video_upload_pressure: relay-originated, no from (17 §7.5).

interface VideoUploadPressureFeedback

kind

kind: "video_upload_pressure"

sourceId

sourceId: VideoSourceId

droppedOctets

droppedOctets: number

intervalMs

intervalMs: number

Source: wire/media.ts:238

VideoViewerStateFeedback interface

video_viewer_state: relay-originated, no from (17 §7.5).

interface VideoViewerStateFeedback

kind

kind: "video_viewer_state"

sourceId

sourceId: VideoSourceId

viewer

viewer: number

The viewer's pid.

state

state: VideoViewerState

Source: wire/media.ts:221

VisibilityGrantSummary interface

A VisibilityGrant as the recipient sees it in HistoryState (14 §8.2, §10.3).

interface VisibilityGrantSummary

shareId

shareId: string

sharer

sharer: string

fromSeq

fromSeq: number

toSeq

toSeq: number

Inclusive.

createdAt

createdAt: string

Source: wire/history.ts:222

VoiceLease interface

A participant's own view of its rights (15 §4.1), returned by join and sent in call.lease_changed. Ticks are authoritative for enforcement; this says why.

interface VoiceLease

callId

callId: string

pid

pid: number

listen

listen: boolean

In listeners; always true while the seat exists.

audio

audio: boolean

In audio.

video

video: boolean

In video.

audioBlockedBy

audioBlockedBy: AudioBlockedBy | null

Why audio is false, or null when it is true.

videoBlockedBy

videoBlockedBy: VideoBlockedBy | null

Why video is false, or null when it is true.

Source: wire/calls.ts:418

W9Finding interface

A W9 the client MUST raise (09 §13.4), with the diagnostics report it sends (09 §13.6 step 5).

interface W9Finding

trigger

trigger: W9Trigger

scope

scope: "community" | "channel" | "channel_and_community" | "address"

What the W9 covers: the channel (T1, T2, T3); the channel and the whole community (T5); the whole community and every channel of it (T4); or the address that was resolved (T6).

host

host: string

Canonical domain of the hosting server.

ctx

ctx: `ch:${string}` | null

The channel, or null for a W9 raised for the whole community (ctx is then absent from the report).

address?

address?: string

For T6: the address that now resolves to another, insecure channel.

report

report: SecurityDowngradeSeenData

data of the security_downgrade_seen report (09 §13.6 step 5). Never holds content.

Source: api/channels.ts:491

Webhook interface

An incoming webhook of one insecure channel (11 §15.2).

interface Webhook

id

id: string

ctx

ctx: CtxRef

name

name: string

1–80 Unicode scalar values; no @, <, >, control characters or line breaks.

state

state: WebhookState

disabledReason

disabledReason: WebhookDisabledReason | null

allowMentionAll

allowMentionAll: boolean

createdBy

createdBy: string

createdAt

createdAt: string

lastUsedAt

lastUsedAt: string | null

token?

token?: string

Only in the responses to creation and token rotation.

Source: wire/messaging.ts:788

WebhookContent interface

The content a webhook may post: text, mentions and mentionAll only (11 §15.4).

interface WebhookContent

text

text: string

mentions?

mentions?: string[]

mentionAll?

mentionAll?: boolean

replyTo?

replyTo?: null

MUST be absent or null.

attachments?

attachments?: []

MUST be absent or empty.

Source: wire/messaging.ts:817

WebPushSubscriptionKeys interface

webPush of a registration: from the browser's PushSubscription (19 §9.1).

interface WebPushSubscriptionKeys

endpoint

endpoint: string

An https URL of at most 2,048 octets.

p256dh

p256dh: string

base64url 65-octet uncompressed P-256 point.

auth

auth: string

base64url 16-octet secret (RFC 8291).

Source: wire/notifications.ts:462

WebSocketCloseEventLike interface

The close event the SDK reads (03 §5.10).

interface WebSocketCloseEventLike

code

readonly code: number

reason?

readonly reason?: string

Source: events/websocket.ts:30

WebSocketLike interface

The subset of the WHATWG WebSocket interface the event socket uses (03 §5.1). The SDK assigns the on… handler properties, so any object with these members works, including a test fake.

interface WebSocketLike

protocol

readonly protocol: string

The subprotocol the server selected; '' if none (03 §5.1 item 3).

extensions

readonly extensions: string

The negotiated extensions, as in Sec-WebSocket-Extensions (03 §5.1 item 6).

readyState

readonly readyState: number

0 connecting, 1 open, 2 closing, 3 closed.

binaryType

binaryType: string

The SDK sets 'arraybuffer' so binary messages are never decoded as text.

onopen

onopen: (event: unknown) => void | null

onmessage

onmessage: (event: WebSocketMessageEventLike) => void | null

onclose

onclose: (event: WebSocketCloseEventLike) => void | null

onerror

onerror: (event: unknown) => void | null

send

send(data: string): void

Send one text message (03 §5.2 item 1).

data: string

close

close(code?: number, reason?: string): void

Close the socket. Browser implementations throw for codes other than 1000 and 3000–4999; the SDK then closes with 4000 instead (03 §5.2 item 6).

code?: number
reason?: string

Source: events/websocket.ts:40

WebSocketMessageEventLike interface

The message event the SDK reads: text messages are strings; anything else is binary (03 §5.2 items 1 and 2).

interface WebSocketMessageEventLike

data

readonly data: unknown

Source: events/websocket.ts:25

WellKnownDocument interface

The .well-known/sloppyv fallback document (02 §4.1). Consumers ignore unknown members; v other than "sv1" means "absent" to a v1 consumer.

interface WellKnownDocument

v

v: "sv1"

Protocol version of this delegation: "sv1".

url

url: string

The base URL for the domain (a base-url, 02 §3.3).

Source: wire/discovery.ts:41

WithheldPayload interface

The withheld form of a durable payload (03 §7.2 D4a). A client that receives it advances its position past the event and does nothing else. Owners may add members that identify the affected object.

interface WithheldPayload

withheld

withheld: true

Source: wire/transport.ts:271

WithheldTargetPayload interface

The tombstone form of a replayed message.edited or reaction.added whose content has since been deleted (11 §8.3).

interface WithheldTargetPayload extends WithheldPayload

target

target: string

withheld

withheld: true

Source: wire/messaging.ts:598

WrongAudienceData interface

data of federation.wrong_audience (06 §16).

interface WrongAudienceData

expected

expected: string

The server's canonical domain.

Source: wire/federation.ts:689

Types

AccountDeletionReason type

reason of account.deleted (05 §16.3). Receivers treat an unknown value as admin.

type AccountDeletionReason = "user" | "owner" | "admin" | "unconfirmed" | string & {}

Source: wire/accounts.ts:124

AccountErrorCode type

An error code registered by 05 (05 §19).

type AccountErrorCode = keyof typeof ACCOUNT_ERRORS

Source: wire/accounts.ts:829

AccountKind type

Account kind (05 §11.1). Receivers treat an unknown value as bot.

type AccountKind = "user" | "bot" | string & {}

Source: wire/accounts.ts:77

AccountSecurity type

The account security flag (05 §11.1), equal to the sec claim of the latest IdentityState (07).

type AccountSecurity = "insecure" | "secure"

Source: wire/accounts.ts:83

AccountState type

Account state (05 §11.2). Receivers treat an unknown value as suspended.

type AccountState = "active" | "upgrade_required" | "suspended" | "deleted" | string & {}

Source: wire/accounts.ts:80

ActorKind type

member, system (automatic) or operator (outside the protocol); unknown kinds display as "System" (10 §11.2).

type ActorKind = "member" | "system" | "operator" | string & {}

Source: wire/moderation.ts:206

Address type

A canonical address local@domain (01, 09 §2 conventions).

type Address = string

Source: wire/communities.ts:29

AddressChannelKind type

A channel's kind as AddressInfo carries it (01 §9.3, 09). Unknown values are treated as text.

type AddressChannelKind = "text" | "voice" | string & {}

Source: wire/addressing.ts:37

AddressChannelSecurity type

A channel's security mode as AddressInfo carries it (01 §9.3, 00 §4.1, 09). Unknown values are treated as secure for what is shown before joining, and never create or change a secure-state pin (09 §13.3).

type AddressChannelSecurity = "insecure" | "secure" | string & {}

Source: wire/addressing.ts:44

AddressErrorCode type

An address.* error code (01 §12.1).

type AddressErrorCode = keyof typeof ADDRESS_ERRORS

Source: wire/addressing.ts:93

AddressInfoKind type

What an address names (01 §9.3): user (a user or bot account) or channel. A receiver treats an unknown value as "not something this client can open" and shows the address only.

type AddressInfoKind = "user" | "channel" | string & {}

Source: wire/addressing.ts:34

AddressLookupOptions type

Per-call options of the address lookup (01 §9.2). auth defaults to 'session' (the client's session, if it has one; the answer for hidden channels depends on it). Pass auth: 'none' for link activation before sign-in (01 §10.5): authentication is optional (01 §9.2).

type AddressLookupOptions = PublicReadOptions

Source: api/addresses.ts:16

AddressLookupResult type

Whether a name has an address (02 §4.2 "D has no address"): present when an A or AAAA lookup (after CNAMEs) has an answer, absent only when both end in NXDOMAIN or NODATA, unknown on SERVFAIL, a timeout or any other error.

type AddressLookupResult = "present" | "absent" | "unknown"

Source: discovery/txt.ts:38

AfterSignInScreen type

The screen a Full or Web client shows after sign-in or refresh (05 §11.5).

type AfterSignInScreen = "turn_on_encryption" | "approve_device" | "app"

Source: auth/session.ts:729

AnyListener type

A listener for every event: the type and its payload.

type AnyListener<M> = (type: K, payload: M[K]) => void

Source: core/emitter.ts:12

ArchiveKeySource type

source of an archive key entry (08 §9.1). recovered and unknown values are never mls.

type ArchiveKeySource = "mls" | "recovered" | string & {}

Source: wire/device-setup.ts:421

AssertionAccountKind type

Account kind carried in assertions and sessions: user or bot (06 §4.3, 05). A verifier rejects other values, so unlike 05's AccountKind this union is closed.

type AssertionAccountKind = "user" | "bot"

Source: wire/federation.ts:24

AssertionInvalidReason type

data.reason of federation.assertion_invalid (06 §17.4). Unknown values are a generic failure.

type AssertionInvalidReason = "malformed" | "alg" | "typ" | "claims" | "kid" | "key_unknown" | "key_status" | "signature" | "expired" | "not_yet_valid" | "lifetime" | "subject" | "security_claims" | string & {}

Source: wire/federation.ts:608

AttachmentPurpose type

Attachment.purpose (11 §14.1). A receiver treats an unknown value as file.

type AttachmentPurpose = "file" | "thumbnail" | string & {}

Source: wire/messaging.ts:719

AttachmentState type

Attachment.state (11 §14.1). A receiver treats an unknown value as deleted.

type AttachmentState = "pending" | "uploaded" | "bound" | "deleted" | string & {}

Source: wire/messaging.ts:722

AudioBlockedBy type

Why audio is false in a VoiceLease (15 §4.1). Unknown values: treat as other.

type AudioBlockedBy = "no_permission" | "muted_for_everyone" | "server_muted" | "timed_out" | "other" | string & {}

Source: wire/calls.ts:108

AudioCallState type

The audio engine's call state, derived from 15's client states (16 §7.2).

type AudioCallState = "joining" | "connected" | "reconnecting" | "migrating" | "ended"

Source: wire/media.ts:354

AudioSourceId type

The audio sources carried by voice-dc/1: 0 microphone, 2 screen or application sound (16 §4.3).

type AudioSourceId = 0 | 2

Source: wire/media.ts:42

AuditAction type

Audit actions (10 §11.3). Unknown values display as "Other change".

type AuditAction = "role_created" | "role_updated" | "role_deleted" | "roles_reordered" | "role_granted" | "role_removed" | "overwrite_set" | "overwrite_removed" | "messages_deleted" | "member_kicked" | "member_banned" | "domain_banned" | "ban_updated" | "ban_lifted" | "ban_expired" | "member_timed_out" | "timeout_lifted" | "timeout_expired" | "member_muted" | "mute_lifted" | "mute_expired" | "report_updated" | "report_forwarded" | "report_evidence_preserved" | "policy_updated" | "community_updated" | "community_secured" | "channel_created" | "channel_updated" | "channel_deleted" | "channel_secured" | "channel_history_deleted" | "invite_revoked" | "bot_admitted" | "history_shared" | "federation_blocked" | "federation_unblocked" | "address_assigned" | "address_released" | "server_key_incident" | string & {}

Source: wire/moderation.ts:657

AuditTargetType type

Audit target types (10 §11.2). Unknown: display generically.

type AuditTargetType = "member" | "domain" | "role" | "overwrite" | "message" | "ban" | "timeout" | "mute" | "report" | "channel" | "invite" | "community" | "policy" | "bot" | "history_share" | "server" | string & {}

Source: wire/moderation.ts:701

AuthIntent type

Intent of an authorization transaction (05 §6.1, §6.3). link is only created by POST /v1/me/providers.

type AuthIntent = "login" | "reauth" | "link"

Source: wire/accounts.ts:115

AuthorizationRedirectError type

RFC 6749 §4.1.2.1 error values used in redirects (05 §7.8).

type AuthorizationRedirectError = "invalid_request" | "access_denied" | "temporarily_unavailable" | "server_error" | string & {}

Source: wire/accounts.ts:349

AuthorizationResult type

What a completed authorization produced (05 §7.3).

type AuthorizationResult = { type: "session"; response: SessionTokenResponse } | { type: "signup"; response: SignupTokenResponse; signupToken: string; signup: SignupInfo } | { type: "reauth"; response: ReauthTokenResponse } | { type: "link"; response: LinkTokenResponse }

Source: auth/oauth.ts:544

AuthProviderType type

auth.providers[].type (02 §7.3.2). Unknown values: treat as oidc.

type AuthProviderType = "google" | "github" | "microsoft" | "apple" | "oidc"

Source: wire/discovery.ts:143

AuthScheme type

An Authorization scheme a client uses (03 §3.1). S2S tokens are servers' business.

type AuthScheme = "Bearer" | "Bot"

Source: core/auth.ts:17

AvatarBody type

Image bytes accepted by the avatar uploads (05 §11.7).

type AvatarBody = Uint8Array | ArrayBuffer | Blob

Source: api/me.ts:18

AvatarContentType type

Avatar media types (05 §11.7).

type AvatarContentType = "image/png" | "image/jpeg" | "image/webp"

Source: wire/accounts.ts:127

BanScope type

community or server; unknown values display as server (10 §9.1, §9.3).

type BanScope = "community" | "server" | string & {}

Source: wire/moderation.ts:331

BanTargetType type

address or domain; unknown values display as "Other ban" (10 §9.1).

type BanTargetType = "address" | "domain" | string & {}

Source: wire/moderation.ts:328

BaseUrlParse type

The outcome of parseBaseUrl.

type BaseUrlParse = { ok: true; url: string; host: string; port: number | null; path: string } | { ok: false; problem: BaseUrlProblem }

Source: discovery/base-url.ts:28

BaseUrlProblem type

Why a value isn't a valid base-url (02 §3.3).

type BaseUrlProblem = "type" | "length" | "scheme" | "userinfo" | "query" | "fragment" | "ip_literal" | "host" | "single_label" | "numeric_host" | "port" | "path" | "dot_segment" | "empty_segment"

Source: discovery/base-url.ts:11

BeforeAcceptAction type

What a client is about to do that might contact a server other than its home (12 §10.4).

type BeforeAcceptAction = "session" | "websocket" | "post" | "read_state" | "typing" | "mls" | "history_share" | "attachment" | "avatar" | "link_preview" | "identity_fetch" | "profile_fetch" | "metadata_fetch" | "call"

Source: api/dm-requests.ts:81

BeginReauthOptions type

Options of AuthApi.beginReauth (05 §9.2).

type BeginReauthOptions = Omit<BeginSignInOptions, "pushed" | "prompt">

Source: auth/oauth.ts:532

BoxKeyUpload type

Body of PUT /v1/me/vault/box-keys/{did} (08 §10.1).

type BoxKeyUpload = Omit<BoxKey, "createdAt">

Source: wire/device-setup.ts:524

CallContextKind type

A call-capable context kind (15 §2.1, D-064).

type CallContextKind = "channel" | "dm" | "group_dm"

Source: calls/continuity.ts:55

CallEndReason type

Why a call ended (15 §2.4). A receiver MUST treat an unknown reason like context_closed: the call is over and the client doesn't rejoin automatically.

type CallEndReason = "empty" | "completed" | "unanswered" | "declined" | "security_upgraded" | "security_downgraded" | "group_restarted" | "channel_deleted" | "context_closed" | "server_restart" | string & {}

Source: wire/calls.ts:46

CallErrorCode type

A call.*, relay.* or sfu.* error code (15 §16.1).

type CallErrorCode = keyof typeof CALL_ERRORS

Source: wire/calls.ts:1161

CallFailurePhase type

Phases of a call_failure report (15 §14.3).

type CallFailurePhase = "join" | "relay_connect" | "in_call" | "rejoin" | string & {}

Source: wire/calls.ts:156

CallNotificationKind type

Call kinds sent by the hosting server for DM call rings (19 §5.2, §14).

type CallNotificationKind = "call_ring" | "call_ring_ended"

Source: wire/notifications.ts:22

CallSecurity type

A call's security mode (15 §2.5.1). A receiver MUST treat an unknown value as secure and refuse to send media until it understands the call; see normalizeCallSecurity. Clients never take the mode from here (15 §2.1 item 4).

type CallSecurity = "insecure" | "secure" | string & {}

Source: wire/calls.ts:25

CallSecurityCheck type

The result of checkCallSecurity.

type CallSecurityCheck = "ok" | "refuse" | "unknown" | "recheck"

Source: calls/call.ts:89

CarrierType type

The carrier type of a stored entry (11 §2.1, §5.2): plain or sealed. A receiver treats an unknown value as sealed and shows the placeholder.

type CarrierType = "plain" | "sealed" | string & {}

Source: wire/messaging.ts:175

ChainStatus type

The chain status of 02 §12.3.

type ChainStatus = "ok" | "fork" | "rollback" | "failed"

Source: discovery/keychain.ts:123

ChannelErrorCode type

A channel.* code (09 §15.3).

type ChannelErrorCode = keyof typeof CHANNEL_ERRORS

Source: wire/communities.ts:983

ChannelKind type

Channel kind (09 §6.1). A client treats an unknown value as text and offers no call.

type ChannelKind = typeof CHANNEL_KINDS[number] | string & {}

Source: wire/communities.ts:93

ChannelMemberReason type

ChannelMember reason values (09 §4.5).

type ChannelMemberReason = "left" | "community_left" | "kicked" | "banned" | "lost_access" | "account_deleted" | "channel_upgraded" | "server_upgraded" | "account_downgraded" | string & {}

Source: wire/communities.ts:78

ChannelMemberState type

ChannelMember state (09 §4.5). A client treats an unknown value as left.

type ChannelMemberState = typeof CHANNEL_MEMBER_STATES[number] | string & {}

Source: wire/communities.ts:75

ChannelRef type

A channel context reference, ch:<UUIDv7> (03 §8.3).

type ChannelRef = `ch:${string}`

Source: wire/transport.ts:284

ChannelSecurity type

Channel security (09 §6.1). A client treats an unknown value as "unavailable": no posting, no call, no lock, suggest updating; never W9.

type ChannelSecurity = typeof CHANNEL_SECURITY_MODES[number] | string & {}

Source: wire/communities.ts:101

ChosenStatus type

The status a user chooses (11 §11.1). Servers refuse unknown values.

type ChosenStatus = "online" | "idle" | "dnd" | "invisible"

Source: wire/messaging.ts:653

ClientAuth type

The account credential of a SloppyVoiceClient: a TokenProvider (a HomeSession, botToken(…), staticToken(…)), a stored sign-in session, or a function that builds a provider once the home server is known (for example (home) => HomeSession.fromTokenResponse(new AuthApi(home.http), …)). It is used only at the home server (03 §3.2 rule 3).

type ClientAuth = TokenProvider | SignInSessionAuth | (home: { http: HttpClient; baseUrl: string; metadata: ServerMetadata }) => TokenProvider | Promise<TokenProvider>

Source: client.ts:100

ClientPlatform type

A platform a client may send at the code exchange or sign-up (05 §7.3, §8.4): bot is refused.

type ClientPlatform = "desktop" | "web" | "ios" | "android"

Source: wire/accounts.ts:89

ClientVideoFeedback type

The video feedback kinds a client sends (17 §7.1).

type ClientVideoFeedback = KeyframeRequestFeedback | VideoPreference | VideoReportFeedback

Source: wire/media.ts:246

CloseCode type

A close code listed in 03 §5.10.

type CloseCode = keyof typeof CLOSE_CODES

Source: wire/transport.ts:528

ClosingReason type

session.closing reasons (03 §5.3, §5.10). A client treats an unknown value by following reconnect and retryAfterMs (03 §5.10).

type ClosingReason = "protocol_error" | "unauthenticated" | "session_ended" | "hello_timeout" | "idle_timeout" | "replaced" | "slow_consumer" | "unsupported_version" | "rate_limited" | "server_shutdown" | "too_large" | string & {}

Source: wire/transport.ts:469

CommitNeededReason type

mls.commit_needed reason (13 §8.5). Unknown values: commit anyway.

type CommitNeededReason = "removal" | "key_rotation" | "reissue" | "group_info_refresh" | string & {}

Source: wire/mls.ts:212

CommunitiesErrorCode type

Every error code 09 registers (09 §15.1–§15.4).

type CommunitiesErrorCode = CommunityErrorCode | MemberErrorCode | ChannelErrorCode | InviteErrorCode

Source: wire/communities.ts:987

CommunityAccountKind type

Account kind (09 §4.1). A client treats an unknown value as user for layout but shows no badge.

type CommunityAccountKind = "user" | "bot" | string & {}

Source: wire/communities.ts:67

CommunityAccountSecurity type

accountSecurity (09 §4.1). A client treats an unknown value as insecure.

type CommunityAccountSecurity = "insecure" | "secure" | string & {}

Source: wire/communities.ts:70

CommunityErrorCode type

A community.* code (09 §15.1).

type CommunityErrorCode = keyof typeof COMMUNITY_ERRORS

Source: wire/communities.ts:979

CommunityIconMediaType type

An icon media type (09 §3.4).

type CommunityIconMediaType = typeof COMMUNITY_ICON_MEDIA_TYPES[number]

Source: wire/communities.ts:117

CommunityLayoutChangedEvent type

community.layout_changed payload (09 §14.2), restricted to channels the recipient can view.

type CommunityLayoutChangedEvent = CommunityLayout

Source: wire/communities.ts:774

CommunityLimitName type

The name of a 09 limit (09 §16).

type CommunityLimitName = keyof typeof COMMUNITY_LIMITS

Source: wire/communities.ts:1080

CommunityListState type

CommunityListEntry state (09 §5.1). Unknown values are shown as active.

type CommunityListState = "active" | "pending" | "needs_encryption" | string & {}

Source: wire/communities.ts:112

CommunityMemberReason type

CommunityMember reason values (09 §4.2). A client treats an unknown value as no reason.

type CommunityMemberReason = "left" | "kicked" | "account_deleted" | "unbanned" | "server_upgraded" | "account_downgraded" | "banned" | string & {}

Source: wire/communities.ts:53

CommunityMemberState type

CommunityMember state (09 §4.1, §4.2). A client treats an unknown value as left.

type CommunityMemberState = typeof COMMUNITY_MEMBER_STATES[number] | string & {}

Source: wire/communities.ts:47

CommunitySettingsInput type

Per-community settings (19 §7.2), as evaluateNotificationSettings reads them.

type CommunitySettingsInput = Pick<CommunityNotificationSettings, "level" | "muteUntil" | "everyone">

Source: api/notifications.ts:705

ComposedMode type

The context's security mode when an entry was composed (11 §13.2).

type ComposedMode = "insecure" | "secure"

Source: wire/messaging.ts:850

ConditionalGroupInfo type

The result of MlsApi.groupInfoIfChanged.

type ConditionalGroupInfo = { notModified: false; etag: string | null; groupInfo: GroupInfoResponse } | { notModified: true; etag: string | null }

Source: api/mls.ts:37

ConditionalIdentityResponse type

The result of a conditional identity fetch (07 §11.2 caching).

type ConditionalIdentityResponse = { notModified: true; etag: string | null } | { notModified: false; etag: string | null; body: IdentityResponse }

Source: api/identity.ts:32

ConditionalProfile type

The result of a conditional profile fetch (05 §17.1, RFC 9110 §13.1.2).

type ConditionalProfile = { notModified: false; profile: PublicProfile; etag: string | null } | { notModified: true; profile: null; etag: string }

Source: api/profiles.ts:14

ContentHint type

Content hint of a screen source (17 §5.6). Unknown values are stored as given in stats.

type ContentHint = "detail" | "motion"

Source: wire/media.ts:392

ContentObject type

Any content object (11 §3.1).

type ContentObject = MessageContent | EditContent | ReactionContent | DeleteContent

Source: wire/messaging.ts:288

ContextSettingsInput type

Per-context settings (19 §7.3), as evaluateNotificationSettings reads them.

type ContextSettingsInput = Pick<ContextNotificationSettings, "level" | "muteUntil" | "everyone" | "calls">

Source: api/notifications.ts:708

ContinuityEffect type

Something the driver must do. Effects are returned in the order to carry them out.

type ContinuityEffect = { type: "send_join"; request: JoinRequest; idempotencyKey: string; attempt: number; automatic: boolean; prepareSecureContext: boolean } | { type: "connect_relay"; url: string; ticket: string; keepExisting: boolean } | { type: "close_relay" } | { type: "close_sfu" } | { type: "self_mute_changed"; selfMuted: boolean; reason: MuteReason | null; report: boolean } | { type: "report_sources"; sources: Partial<Sources> } | { type: "stop_webcam" } | { type: "hold_screen_share" } | { type: "resume_screen_share" } | { type: "stop_screen_share" } | { type: "renew_session" } | { type: "complete_mls_join" } | { type: "send_leave"; ctx: string; callId: string } | { type: "rejoin_complete"; seatRestored: boolean; outageMs: number | null } | { type: "report_failure"; phase: CallFailurePhase; code: string | null; outageMs: number | null; rejoinAttempts: number } | { type: "ended"; reason: ContinuityEndReason; code: string | null }

Source: calls/continuity.ts:202

ContinuityEndReason type

Why a participation ended for good (15 §10.1, §10.5).

type ContinuityEndReason = "left" | "moved" | "in_call_elsewhere" | "call_ended" | "removed" | "security_required" | "dm_waiting_readd" | "dm_unavailable" | "security_check_failed" | "relay_failed" | "join_failed" | "error"

Source: calls/continuity.ts:92

ContinuityState type

Client states (15 §10.4), plus idle (no participation yet) and joining (the user's first join is in flight).

type ContinuityState = "idle" | "joining" | "restoring" | "in_call" | "rejoining" | "waiting" | "ended"

Source: calls/continuity.ts:199

CoreErrorCode type

A core.* error code (03 §10.5).

type CoreErrorCode = keyof typeof CORE_ERRORS

Source: wire/transport.ts:212

CreatePushRegistrationRequest type

Body of POST /v1/me/push-registrations (19 §9.2).

type CreatePushRegistrationRequest = CreateGatewayPushRegistrationRequest | CreateWebPushRegistrationRequest

Source: wire/notifications.ts:519

CredentialRecordStatus type

status of a credential record (14 §5.6). Unknown values: treat as removed.

type CredentialRecordStatus = "active" | "removed" | string & {}

Source: wire/history.ts:247

CtxRef type

A context reference (ctx-ref, 03 §8.3).

type CtxRef = ChannelRef | DmRef | GroupDmRef

Source: wire/transport.ts:290

DefaultEventMap type

The default event map: every event type a client can receive, typed by the composed EventMap of every document (03 §11.3), plus any other type with an untyped payload, since receivers must tolerate types they don't know (03 §12.3). socket.on('message.created', (e) => e.d.content) is fully typed.

type DefaultEventMap = EventMap & { [type: string]: unknown }

Source: events/socket.ts:75

DelegationEvidence type

Delegation evidence levels (02 §9.1).

type DelegationEvidence = "dnssec" | "same-site" | "wellknown" | "dns-only"

Source: wire/discovery.ts:32

DelegationSource type

Where a delegation came from (02 §1.1, §5.1).

type DelegationSource = "txt" | "wellknown"

Source: wire/discovery.ts:29

DeletedBy type

Deletion.by and the by of delete events (11 §5.4, §8.2). Unknown values count as moderator.

type DeletedBy = "author" | "moderator" | string & {}

Source: wire/messaging.ts:181

DeviceAddedVia type

How a device record was created, device.added via (05 §18). Receivers treat an unknown value as login.

type DeviceAddedVia = "login" | "signup" | "bot_token" | string & {}

Source: wire/accounts.ts:121

DevicePlatform type

Device platform (05 §12.2). Receivers treat an unknown value as desktop.

type DevicePlatform = "desktop" | "web" | "ios" | "android" | "bot" | string & {}

Source: wire/accounts.ts:86

DeviceProofInvalidReason type

data.reason of federation.device_proof_invalid (06 §17.4).

type DeviceProofInvalidReason = "device_certificate" | "device_proof" | "device_proof_binding" | "device_proof_expired" | string & {}

Source: wire/federation.ts:625

DeviceSetupErrorCode type

A pairing.*, backup.* or vault.* error code (08 §15).

type DeviceSetupErrorCode = keyof typeof DEVICE_SETUP_ERRORS

Source: wire/device-setup.ts:757

DeviceState type

Device state (05 §12.2). Receivers treat an unknown value as revoked.

type DeviceState = "active" | "revoked" | string & {}

Source: wire/accounts.ts:92

DiagnosticPlatform type

Diagnostic report platforms (15 §14.3).

type DiagnosticPlatform = "desktop" | "web" | "ios" | "android" | "bot" | string & {}

Source: wire/calls.ts:153

DiagnosticReportKind type

Diagnostic report kinds registered by 15 §14.4. Servers accept unknown kinds.

type DiagnosticReportKind = "call_failure" | "call_summary" | "identity_check" | "media_attestation" | "sealed_verify" | "pin_conflict" | "transport" | "vault_integrity" | "key_storage" | "security_downgrade_seen" | string & {}

Source: wire/calls.ts:159

DiagnosticsSetting type

The client's diagnostics setting (15 §14.2). Default failures (D-089).

type DiagnosticsSetting = "off" | "failures" | "full"

Source: wire/calls.ts:147

DiscoveryErrorCode type

A discovery.* error code (02 §17).

type DiscoveryErrorCode = keyof typeof DISCOVERY_ERRORS

Source: wire/discovery.ts:454

DiscoveryErrorPresentation type

How a client presents a discovery error (02 §5.7, §17): no_server ("there's no Sloppy Voice server at this address; check the spelling"), not_hosted ("this server doesn't host that address"), misconfigured ("this server isn't set up correctly right now", with contact.admin when known), update_required (core.unsupported_version: every version the server lists is newer than the client's, 02 §7.4 step 5, 00 §7.8) or unreachable ("that server can't be reached right now; we'll keep trying"). Discovery never produces a security warning.

type DiscoveryErrorPresentation = "no_server" | "not_hosted" | "misconfigured" | "update_required" | "unreachable"

Source: discovery/errors.ts:112

DisplayNameMismatchReason type

data.reason of address.display_name_mismatch (01 §6.3). Receivers treat an unknown value as not_linked.

type DisplayNameMismatchReason = "not_linked" | "too_long" | string & {}

Source: wire/addressing.ts:173

DmAccountSecurity type

An account's sec as seen in a DM (DmParticipant.security, 12 §6.3): the sec claim of its IdentityState (07). An upgrade_required account has insecure (12 §2.2).

type DmAccountSecurity = "insecure" | "secure" | string & {}

Source: wire/dms.ts:38

DmAutoAcceptReason type

Why an entry was accepted automatically (12 §9.1, §10.2).

type DmAutoAcceptReason = "outgoing" | "everyone" | "accepted_dm" | "shared_community" | "successor" | string & {}

Source: wire/dms.ts:328

DmAutoAcceptSetting type

Who may reach the account without a message request (12 §9.4, §10.2). Unknown values are treated as the default, contacts_and_communities.

type DmAutoAcceptSetting = "contacts_and_communities" | "contacts_only" | "everyone" | string & {}

Source: wire/dms.ts:404

DmCallPhase type

phase of dm.call_logged. Unknown values are ignored (12 §16.1).

type DmCallPhase = "started" | "ended" | string & {}

Source: wire/dms.ts:543

DmClosedReason type

Why a DM is closed (12 §6.1): host_secure (12 §13), peer_deleted (12 §6.4) or banned (a server-scope ban at the hosting server, 10 §9.4 step 7).

type DmClosedReason = "host_secure" | "peer_deleted" | "banned" | string & {}

Source: wire/dms.ts:47

DmCommitSubmission type

The CommitSubmission of 13 §7.5 as carried in POST /v1/dms (12 §7.2): the first commit, epoch 0 → 1, adding the claimed devices, with its Welcome. 13 owns the object; this is the type of wire/mls.ts.

type DmCommitSubmission = CommitSubmission

Source: wire/dms.ts:164

DmCtx type

A DM context reference: dm:<b64u-128> for 1:1 DMs or gdm:<uuid7> for group DMs (12 §5.1).

type DmCtx = DmRef | GroupDmRef

Source: wire/dms.ts:23

DmErrorCode type

A dm.* error code (12 §17).

type DmErrorCode = keyof typeof DM_ERRORS

Source: wire/dms.ts:715

DmForwardedEvent type

A durable event of the DM as forwarded in dm.request and stored in a DmRequest or a DmIndexEntry's pendingEvents (12 §8.2): an event envelope (00 §7.4) with its ctx and seq. Insecure DMs: dm.* events and message.created with plaintext content (11). When the recipient home is a secure server, message.created events carry no content and carry contentWithheld: true instead (12 §8.2).

type DmForwardedEvent = Envelope<string, Record<string, unknown>> & { ctx: DmCtx; seq: number }

Source: wire/dms.ts:231

DmGroupBootstrap type

The GroupBootstrap of 13 §7.4 as carried in POST /v1/dms for a secure 1:1 DM (12 §7.2): generation 1 of the DM's group. 13 owns the object; this is the type of wire/mls.ts.

type DmGroupBootstrap = GroupBootstrap

Source: wire/dms.ts:157

DmIndexEntryState type

State of a DmIndexEntry (12 §9.2). Unknown values are treated as left (12 §9.1).

type DmIndexEntryState = "requested" | "active" | "declined" | "blocked" | "left" | "closed" | string & {}

Source: wire/dms.ts:322

DmIndexOrigin type

How an entry came to exist: registered by the user (outgoing, 12 §9.3) or from a dm.request (incoming).

type DmIndexOrigin = "outgoing" | "incoming" | string & {}

Source: wire/dms.ts:325

DmInvalidParticipantsReason type

reason of dm.invalid_participants (12 §17).

type DmInvalidParticipantsReason = "self" | "duplicate" | "too_few" | "ctx_mismatch" | string & {}

Source: wire/dms.ts:726

DmKind type

kind of a DM: direct (1:1) or group. Receivers treat an unknown value as group (12 §6.1).

type DmKind = "direct" | "group" | string & {}

Source: wire/dms.ts:26

DmMarker type

Timeline marker of a dm.* event. Receivers treat an unknown marker as none (12 §16.1).

type DmMarker = "K1" | "K2" | "K5" | string & {}

Source: wire/dms.ts:569

DmParticipantKind type

A participant's account kind. Unknown values are treated as bot (12 §6.3).

type DmParticipantKind = "user" | "bot" | string & {}

Source: wire/dms.ts:59

DmParticipantReason type

reason of a left or removed participant (12 §6.3). Unknown values are treated as removed.

type DmParticipantReason = "left" | "removed" | "declined" | "encryption_turned_off" | "account_deleted" | "invitation_expired" | string & {}

Source: wire/dms.ts:62

DmParticipantRole type

A participant's role: owner (the creator while the group has an owner) or member. Unknown values are treated as member (12 §6.3).

type DmParticipantRole = "owner" | "member" | string & {}

Source: wire/dms.ts:56

DmParticipationState type

A participation state (12 §6.3). Unknown values are treated as removed (12 §6.3). Current participants are reserved, pending and active, plus declined in a 1:1 DM (12 §2.1).

type DmParticipationState = "reserved" | "pending" | "active" | "declined" | "left" | "removed" | string & {}

Source: wire/dms.ts:53

DmRef type

A 1:1 DM context reference, dm:<22 base64url characters> (03 §8.3, 12).

type DmRef = `dm:${string}`

Source: wire/transport.ts:286

DmRequestListItem type

A DmRequest in list form (GET /v1/me/dm-requests, dm.request_received): without events and welcome, with preview, the first event's envelope or null (12 §10.3).

type DmRequestListItem = Omit<DmRequest, "events" | "welcome"> & { preview: DmForwardedEvent | null }

Source: wire/dms.ts:484

DmRequestState type

State of a DmRequest (12 §10.1). Unknown values are treated as withdrawn.

type DmRequestState = "pending" | "accepted" | "declined" | "blocked" | "expired" | "withdrawn" | string & {}

Source: wire/dms.ts:426

DmResponseAction type

action of dm.response. Unknown values are ignored (12 §8.5).

type DmResponseAction = "accept" | "decline" | "block" | "unblock" | string & {}

Source: wire/dms.ts:269

DmSecurity type

A DM's security mode (12 §6.1, §11). Receivers treat an unknown value as secure and refuse to send plaintext (12 §6.1).

type DmSecurity = "insecure" | "secure" | string & {}

Source: wire/dms.ts:32

DmSecurityChangeCause type

cause of dm.security_changed. Unknown values are ignored (12 §16.1).

type DmSecurityChangeCause = "all_secure" | "participant_insecure" | string & {}

Source: wire/dms.ts:572

DmState type

A DM's state (12 §6.2). Receivers treat an unknown value as closed (12 §6.1).

type DmState = "active" | "upgrading" | "encryption_pending" | "closed" | string & {}

Source: wire/dms.ts:41

DmStateChangeReason type

reason of dm.state_changed. Unknown values are ignored (12 §16.1).

type DmStateChangeReason = "encryption_pending" | "security_recomputed" | "reopened" | string & {}

Source: wire/dms.ts:595

DmWarning type

A security warning shown in a DM (12 §11.6; copy in 20).

type DmWarning = { id: "W3"; insecure: string[] } | { id: "W7"; peer: string } | { id: "W9" }

Source: api/dms.ts:592

DnssecStatus type

DNSSEC status of an answer as reported by a validating resolver the verifier trusts (02 §3.5).

type DnssecStatus = "secure" | "insecure" | "unknown"

Source: discovery/txt.ts:12

DomainFailureReason type

data.reason of address.invalid_domain (01 §4.2). Receivers treat an unknown value as idna.

type DomainFailureReason = "empty" | "white_space" | "empty_label" | "ip_literal" | "port" | "idna" | "single_label" | "too_long" | "numeric_tld" | string & {}

Source: wire/addressing.ts:144

DurableDecision type

The decision for one durable event (03 §7.3 rule 2).

type DurableDecision = { action: "apply"; position: number } | { action: "duplicate" } | { action: "drop"; reason: "not_following" | "no_position" | "repairing" } | { action: "queue" } | { action: "gap"; resumeFrom: number; received: number } | { action: "self_resync"; position: number; received: number }

Source: events/tracker.ts:59

EffectiveStatus type

The effective status others see (11 §11.1). A receiver treats an unknown value as online.

type EffectiveStatus = "online" | "idle" | "dnd" | "offline" | string & {}

Source: wire/messaging.ts:659

EmptyPayload type

An empty payload, {} (03 §6.1).

type EmptyPayload = Record<string, never>

Source: wire/transport.ts:277

EntryKind type

The kind of a timeline entry (11 §3.1). A receiver ignores an entry of an unknown kind but still advances past its seq.

type EntryKind = "message" | "edit" | "reaction" | "delete" | string & {}

Source: wire/messaging.ts:163

EnvelopeMap type

For an event map M, the envelope a listener of each type receives (03 §6.1).

type EnvelopeMap<M> = { [K in keyof M & string]: ServerEnvelope<K, M[K]> }

Source: events/socket.ts:78

EpochAckStatus type

epoch-ack answer status (13 §7.8). Unknown values: treat as match.

type EpochAckStatus = "match" | "pending" | "ignored" | string & {}

Source: wire/mls.ts:203

ErrorPayload type

error payload: a problem object (03 §6.3).

type ErrorPayload = Problem

Source: wire/transport.ts:568

EventClass type

The class of an event type (03 §7.2, §11.2): S2S-only types have class s2s.

type EventClass = "durable" | "ephemeral" | "control" | "s2s"

Source: wire/transport.ts:264

EventPayload type

The payload d of event type T (03 §6.1).

type EventPayload<T extends EventType> = EventMap[T]

Source: wire/events.ts:77

EventResultStatus type

Status of one event in a batch response (06 §9.3). A sender treats an unknown value as deferred.

type EventResultStatus = "accepted" | "duplicate" | "ignored" | "rejected" | "deferred" | string & {}

Source: wire/federation.ts:403

EventSocketDiagnosticKind type

Kinds of diagnostic the socket records (03 §5.10 "record a diagnostic", §7.3, §7.5, §5.12).

type EventSocketDiagnosticKind = "protocol_violation" | "close" | "gap" | "resync" | "replaced" | "reauth" | "token" | "store" | "meta"

Source: events/socket.ts:148

EventSocketState type

The client states of 03 §5.3 ("Client state machine"), plus stopped for the terminal outcomes it names ("update required", sign-in needed, replaced).

type EventSocketState = "idle" | "connecting" | "awaiting_ready" | "ready" | "backoff" | "stopped"

Source: events/socket.ts:84

EventSocketStopReason type

Why the socket stopped reconnecting on its own (03 §5.3, §5.10).

type EventSocketStopReason = "update_required" | "server_too_old" | "unauthenticated" | "session_ended" | "replaced" | "server_closed"

Source: events/socket.ts:87

EventType type

An event type t a client can receive (03 §6.1, §11.2).

type EventType = keyof EventMap & string

Source: wire/events.ts:74

EvidenceSource type

Where an item's evidence came from (10 §10.2). Unknown: treat as reporter.

type EvidenceSource = "server" | "reporter" | "origin" | string & {}

Source: wire/moderation.ts:450

ExtendReason type

reason of an extension request; only home_unreachable is defined (06 §6.6).

type ExtendReason = "home_unreachable"

Source: wire/federation.ts:228

ExternalSenderCheck type

Result of checkExternalSender.

type ExternalSenderCheck = "ok" | "not_one_entry" | "domain_mismatch" | "unknown_key" | "key_mismatch" | "bad_status"

Source: mls/provider.ts:435

FeatureName type

A feature name. Unknown names are ignored (03 §12.2 rule 5).

type FeatureName = KnownFeature | string & {}

Source: wire/transport.ts:714

FederationErrorCode type

A federation.* error code (06 §16).

type FederationErrorCode = keyof typeof FEDERATION_ERRORS

Source: wire/federation.ts:605

FederationKey type

A verification key, as 04 §6.4 lets a context supply it.

type FederationKey = Uint8Array | Ed25519PublicJwk

Source: auth/remote.ts:273

FederationKeyPackageClaimResult type

Response of the S2S claim: KeyPackageClaimResult without unreachable (13 §9.5).

type FederationKeyPackageClaimResult = KeyPackageClaimResult

Source: wire/mls.ts:648

FederationPolicyMode type

Federation policy mode (06 §12.1). allowlist is OPTIONAL to implement.

type FederationPolicyMode = "open" | "allowlist"

Source: wire/federation.ts:544

FormerKind type

formerKind of address.deleted and address.quarantined (01 §9.4, §5.7). A bot is reported as user.

type FormerKind = "user" | "channel" | string & {}

Source: wire/addressing.ts:185

GatewayEnvironment type

APNs environment (19 §11.2).

type GatewayEnvironment = "production" | "development"

Source: wire/notifications.ts:563

GatewayPlatform type

Gateway platform (19 §11.2).

type GatewayPlatform = "apns" | "apns_voip" | "fcm"

Source: wire/notifications.ts:560

GlobalSettingsInput type

Writable global settings (19 §7.1), as evaluateNotificationSettings reads them.

type GlobalSettingsInput = Pick<NotificationSettings, "enabled" | "previews" | "channels" | "dms" | "groupDms" | "everyone" | "calls">

Source: api/notifications.ts:702

GroupDmRef type

A group DM context reference, gdm:<UUIDv7> (03 §8.3).

type GroupDmRef = `gdm:${string}`

Source: wire/transport.ts:288

GroupRetiredReason type

mls.group_retired reason (13 §8.2). Unknown values: treat as operator.

type GroupRetiredReason = "context_insecure" | "context_deleted" | "state_lost" | "operator" | string & {}

Source: wire/mls.ts:206

HandshakeKind type

HandshakeRecord kind (13 §7.6). Unknown values: process the commit by its MLS content.

type HandshakeKind = "external" | "member" | string & {}

Source: wire/mls.ts:197

HistoryErrorCode type

A sealed.* or history.* error code (14 §15).

type HistoryErrorCode = keyof typeof HISTORY_ERRORS

Source: wire/history.ts:352

HistoryKeySource type

Where a history key in the client key store came from (14 §3.7).

type HistoryKeySource = "mls" | "archive"

Source: wire/history.ts:99

HistoryShareStep type

The step of 14 §7.8 at which a received HistoryShare failed (14 §9.4).

type HistoryShareStep = "unwrap" | "signature" | "decrypt" | "bundle" | "item"

Source: wire/history.ts:315

HomeLocalNotificationKind type

Kinds only the home server creates; never sent in notify.event (19 §5.3).

type HomeLocalNotificationKind = "call_missed" | "dm_request" | "pairing_request" | "account_alert" | "test"

Source: wire/notifications.ts:28

HttpMethod type

HTTP methods of the API (03 §2.5).

type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE"

Source: core/http.ts:32

IceConnectionState type

ICE connection states (W3C WebRTC RTCIceConnectionState).

type IceConnectionState = "new" | "checking" | "connected" | "completed" | "disconnected" | "failed" | "closed"

Source: calls/relay.ts:250

IdempotencyConflictReason type

reason of core.idempotency_conflict (03 §10.5, §14).

type IdempotencyConflictReason = "mismatch" | "in_progress" | string & {}

Source: wire/transport.ts:130

IdentityChangeKind type

change of identity.changed (07 §12.1). Receivers treat an unknown value as an unspecified change.

type IdentityChangeKind = "upgraded" | "reset" | "downgraded" | "device_added" | string & {}

Source: wire/identity.ts:251

IdentityCheckResult type

The identity check results of 07 §10.6. They travel as data.reason of identity.invalid_certificate and mls.credential_rejected, as MlsReport reasons, as data.identityReason of 06's errors and in identity diagnostics. A receiver treats an unknown value as a generic failure.

type IdentityCheckResult = "malformed" | "typ_mismatch" | "bad_signature" | "non_canonical" | "subject_mismatch" | "issuer_mismatch" | "generation_mismatch" | "key_mismatch" | "kind_mismatch" | "identity_key_as_leaf" | "dsk_mismatch" | "dkf_mismatch" | "device_not_listed" | "device_revoked" | "device_mismatch" | "account_insecure" | "state_stale" | "state_unavailable" | "state_rollback" | "state_equivocation" | "duplicate_device_leaf" | "mixed_identity" | "credential_changed" | "wrong_credential_type" | "not_participant" | "pin_mismatch" | "not_permitted" | string & {}

Source: wire/identity.ts:38

IdentityDevicePlatform type

plat of a DeviceCertificate (07 §6.1): 1 to 16 characters of [a-z0-9_]. Receivers accept an unknown value from a user certificate and show it as a generic device.

type IdentityDevicePlatform = "desktop" | "web" | "ios" | "android" | "bot" | string & {}

Source: wire/identity.ts:24

IdentityErrorCode type

An identity.* error code (07 §19).

type IdentityErrorCode = keyof typeof IDENTITY_ERRORS

Source: wire/identity.ts:446

IdentityKind type

kind of an IdentityCertificate: the account kind (07 §5.1, 05). Unknown values are rejected (malformed).

type IdentityKind = "user" | "bot"

Source: wire/identity.ts:18

IdentityMismatchReason type

data.reason of federation.identity_mismatch (06 §6.3.2, §17.4).

type IdentityMismatchReason = "sec" | "inc" | "igen" | "identity_key" | "kind" | "device" | string & {}

Source: wire/federation.ts:658

IdentityResetMode type

mode of POST /v1/me/identity/reset (07 §11.6).

type IdentityResetMode = "new_key" | "downgrade"

Source: wire/identity.ts:30

IdentitySecurity type

sec of an IdentityState: the account security state (07 §7.1, 00 §4.1). An unknown value is malformed.

type IdentitySecurity = "insecure" | "secure"

Source: wire/identity.ts:27

InvalidAddressReason type

data.reason of address.invalid (01 §12.1, §8.2).

type InvalidAddressReason = "too_long" | "multiple_at" | "missing_domain" | "empty" | "invalid_utf8" | string & {}

Source: wire/addressing.ts:96

InvalidLinkReason type

data.reason of address.invalid_link (01 §12.1, §10.4, §11.4).

type InvalidLinkReason = "scheme" | "userinfo_password" | "port" | "ip_literal" | "invalid_utf8" | "duplicate_param" | "bad_invite" | "not_a_share_link" | "fetch_failed" | string & {}

Source: wire/addressing.ts:157

InvalidRequestReason type

reason of an errors item in core.invalid_request data. Unknown values are treated as other (03 §10.5).

type InvalidRequestReason = "missing" | "type" | "format" | "range" | "length" | "enum" | "duplicate" | "not_allowed" | "other" | string & {}

Source: wire/transport.ts:78

InvalidRequestSource type

source of an errors item in core.invalid_request data. Unknown values are treated as body (03 §10.5).

type InvalidRequestSource = "body" | "query" | "path" | "header" | string & {}

Source: wire/transport.ts:75

InviteErrorCode type

An invite.* code (09 §15.4).

type InviteErrorCode = keyof typeof INVITE_ERRORS

Source: wire/communities.ts:985

InviteState type

Invite state (09 §8.1). A client treats an unknown value as not usable.

type InviteState = typeof INVITE_STATES[number] | string & {}

Source: wire/communities.ts:109

IsSecureServer type

secure(d): whether the server whose canonical domain is d is a secure server, from its ServerMetadata no older than 1 h (12 §4.1 item 2). A client that has ever seen secure: true for d MUST keep answering true (D-073).

type IsSecureServer = (domain: string) => boolean

Source: api/dms.ts:170

ItemVerificationResult type

One item's verification result (14 §13.5, 10 §10.2). Unknown: treat as not verified.

type ItemVerificationResult = "verified" | "plaintext" | "not_found" | "credential_invalid" | "bad_signature" | "bad_key" | "decrypt_failed" | "bad_content" | "not_referenced" | string & {}

Source: wire/moderation.ts:438

JoinPolicy type

joinPolicy (09 §3.2, §3.3). A client treats an unknown value as invite.

type JoinPolicy = typeof JOIN_POLICIES[number] | string & {}

Source: wire/communities.ts:42

JoinVia type

How a member joined (09 §4.1). Unknown values are shown as nothing.

type JoinVia = "auto" | "open" | "invite" | "request" | string & {}

Source: wire/communities.ts:64

KeyBackupAadInput type

The members of a KeyBackup that the AAD covers (08 §5.4).

type KeyBackupAadInput = Pick<KeyBackupContent, "v" | "addr" | "igen" | "ikf" | "vgen" | "phraseId" | "kdf">

Source: api/backup.ts:387

KeyBackupState type

state of a KeyBackup (08 §5.1). Clients treat an unknown value as unusable.

type KeyBackupState = "active" | "staged" | string & {}

Source: wire/device-setup.ts:38

KeyBackupWrite type

Body of PUT /v1/me/backup (08 §5.6).

type KeyBackupWrite = KeyBackupContent & { stage: true; prevVer?: never } | KeyBackupContent & { stage?: false; prevVer: number }

Source: wire/device-setup.ts:81

KeyframeRequestReason type

keyframe_request reasons (17 §7.2). Unknown values are treated as loss.

type KeyframeRequestReason = "subscribe" | "loss" | "decoder_error" | "route_change" | string & {}

Source: wire/media.ts:163

KeyPackageClaimPurpose type

KeyPackage claim purpose (13 §9.4). Unknown values are refused with core.invalid_request.

type KeyPackageClaimPurpose = "dm_create" | "dm_add_person" | "dm_readd" | "dm_secure"

Source: wire/mls.ts:215

KeyPackageClaimStatus type

Per-target claim result status (13 §9.4). Unknown values: treat as unavailable.

type KeyPackageClaimStatus = "ok" | "not_found" | "not_secure" | "no_devices" | "unavailable" | "rate_limited" | "unreachable" | string & {}

Source: wire/mls.ts:218

KeySetCheck type

Result of checkKeySet.

type KeySetCheck = { ok: true; keys: ServerKey[]; thumbprints: string[] } | { ok: false; reason: "invalid_keys" | "private_key_published"; detail: string }

Source: discovery/keys.ts:131

KeyUnusableReason type

data.reason of discovery.key_unusable (02 §17).

type KeyUnusableReason = "wrong_purpose" | "revoked" | "expired" | "not_yet_valid" | "stale"

Source: wire/discovery.ts:473

KnownControlMessage type

A decoded sv-control message whose type is known, narrowed by t.

type KnownControlMessage = { [T in keyof ControlMessages]: ControlMessage<T, ControlMessages[T] & Record<string, unknown>> }[keyof ControlMessages]

Source: calls/relay.ts:82

KnownEntryKind type

A kind v1 defines (11 §3.1).

type KnownEntryKind = typeof ENTRY_KINDS[number]

Source: wire/messaging.ts:169

KnownFeature type

A feature name registered in 03 §12.2.

type KnownFeature = keyof typeof FEATURES

Source: wire/transport.ts:711

KnownPermission type

The 20 permissions of protocol version 1, in registry order (10 §3.1). src/permissions.ts holds the registry with scopes and defaults.

type KnownPermission = "view_channel" | "send_messages" | "add_reactions" | "attach_files" | "mention_everyone" | "speak_and_share" | "mute_members" | "manage_messages" | "create_invites" | "manage_channels" | "manage_roles" | "share_history" | "kick_members" | "ban_members" | "timeout_members" | "manage_invites" | "manage_community" | "manage_bots" | "manage_reports" | "view_audit_log"

Source: wire/moderation.ts:28

KnownReportCategory type

Report categories (10 §10.2). Unknown received values: treat as other; unknown values are refused when filing.

type KnownReportCategory = "spam" | "harassment" | "hate" | "violence" | "sexual_content" | "child_safety" | "self_harm" | "illegal" | "impersonation" | "other"

Source: wire/moderation.ts:397

KnownResyncReason type

A known resync reason (03 §7.5).

type KnownResyncReason = typeof RESYNC_REASONS[number]

Source: events/tracker.ts:28

KnownUserAction type

A known userAction value (03 §10.2).

type KnownUserAction = typeof USER_ACTIONS[number]

Source: wire/transport.ts:38

LeaseList type

The lists of a LeaseSnapshot.

type LeaseList = "audio" | "video" | "listeners"

Source: calls/lease.ts:92

LimitName type

The name of a limit in the limits index (03 §16.3).

type LimitName = keyof typeof LIMITS

Source: wire/transport.ts:810

LimitsSource type

Where a resource API reads the hosting server's limits from (11 §2.3).

type LimitsSource = ServerLimits | null | undefined | () => ServerLimits | null | undefined

Source: api/messages.ts:49

Listener type

A listener for payloads of type P.

type Listener<P> = (payload: P) => void

Source: core/emitter.ts:9

LocalPartFailureReason type

data.reason of address.invalid_local_part (01 §3.9). Receivers treat an unknown value as disallowed_code_point.

type LocalPartFailureReason = "empty" | "too_long" | "too_short" | "disallowed_code_point" | "restricted_code_point" | "unassigned" | "leading_mark" | "no_letter" | "too_many_marks" | "repeated_mark" | "confusable_mark" | "mixed_script" | "mixed_digits" | "bidi_rule" | "unstable" | "contains_at" | "invalid_utf8" | string & {}

Source: wire/addressing.ts:102

LogoutScope type

scope of POST /v1/auth/logout (05 §14).

type LogoutScope = "current" | "others"

Source: wire/accounts.ts:118

MarkNotificationsReadRequest type

Body of POST /v1/me/notifications/read (19 §8.3): exactly one selector (ids, the host/ctx[/throughSeq] group, or all). With a fetch token only ids is allowed.

type MarkNotificationsReadRequest = { ids: string[]; state?: MarkState } | { host: string; ctx: CtxRef; throughSeq?: number; state?: MarkState } | { all: true; state?: MarkState }

Source: wire/notifications.ts:428

MarkState type

Target state of POST /v1/me/notifications/read (19 §8.3). Default read.

type MarkState = "read" | "dismissed"

Source: wire/notifications.ts:422

MediaAttestationReportReason type

The reason of a media_attestation report (18 §10.3). The server ignores unknown values.

type MediaAttestationReportReason = "invalid" | "mismatch" | "equivocation" | "unattested"

Source: wire/media.ts:541

MediaAudioBlockedBy type

Why the user isn't allowed to talk: the newest VoiceLease's audioBlockedBy (16 §7.10, 15 §4.1). other also stands for an unknown value, or no VoiceLease yet, or audio true.

type MediaAudioBlockedBy = "no_permission" | "muted_for_everyone" | "server_muted" | "timed_out" | "other"

Source: wire/media.ts:376

MediaErrorCode type

A media.* error code (18 §10.1).

type MediaErrorCode = keyof typeof MEDIA_ERRORS

Source: wire/media.ts:341

MediaFeedbackKind type

call.media_feedback kinds registered in 15 §16.2 (owned by 16 §4.7 and 17 §7.1). Receivers ignore unknown kinds.

type MediaFeedbackKind = "audio_loss" | "keyframe_request" | "video_pref" | "video_report" | "video_viewer_state" | "video_audience" | "video_upload_pressure" | string & {}

Source: wire/calls.ts:176

MediaFeedbackPayload type

Every call.media_feedback d payload that 16 and 17 define (16 §4.7, 17 §7.1). Unknown kinds are ignored (15).

type MediaFeedbackPayload = AudioLossFeedback | ClientVideoFeedback | RelayVideoFeedback

Source: wire/media.ts:255

MediaProfile type

Media profiles (15 §2.5.1, §3.3.1). voice-dc/1 (16), video-dc/1 (17), sfu-rtp/1 (17).

type MediaProfile = "voice-dc/1" | "video-dc/1" | "sfu-rtp/1" | string & {}

Source: wire/calls.ts:31

MediaRoute type

Route of a source's frames, for VideoStats and the media_attestation report (17 §14, 18 §10.3). Unknown values: store as given.

type MediaRoute = "relay" | "sfu" | string & {}

Source: wire/media.ts:395

MediaSourceId type

A registered sourceId (18 §4.2).

type MediaSourceId = 0 | 1 | 2 | 3

Source: wire/media.ts:39

MediaVideoRoute type

The call's videoRoute (15 §7.2).

type MediaVideoRoute = "dc" | "sfu" | string & {}

Source: wire/media.ts:398

MediaWireProfile type

A media profile name (00 §7.8).

type MediaWireProfile = typeof MEDIA_PROFILES[keyof typeof MEDIA_PROFILES]

Source: wire/media.ts:62

MemberErrorCode type

A member.* code (09 §15.2).

type MemberErrorCode = keyof typeof MEMBER_ERRORS

Source: wire/communities.ts:981

MemberEventScope type

Scope of a member.* event (09 §14.2).

type MemberEventScope = "channel" | "community"

Source: wire/communities.ts:784

MemberJoinedEvent type

member.joined payload (09 §14.2). On a channel stream, a timeline item.

type MemberJoinedEvent = { scope: "channel"; member: ChannelMember } | { scope: "community"; member: CommunityMember }

Source: wire/communities.ts:787

MemberRemovedReason type

member.removed reasons (09 §14.2). Unknown values are read as no reason.

type MemberRemovedReason = "kicked" | "banned" | "lost_access" | "account_deleted" | "community_left" | string & {}

Source: wire/communities.ts:799

MemberState type

A CommunityMember state (09 §4.1); null/undefined means no record (10 §6.1 step 1).

type MemberState = "active" | "needs_encryption" | "pending" | "left" | "banned" | string & {}

Source: permissions.ts:157

MemberUpdatedEvent type

member.updated payload (09 §14.2). accountSecurity only on the member's own account stream.

type MemberUpdatedEvent = { scope: "channel"; member: ChannelMember } | { scope: "community"; member: CommunityMember }

Source: wire/communities.ts:815

MentionAddressCheck type

A canonical-address check for mention tokens, mentions and replyTo.author. The default is the 01 module's isCanonical (01 §7.5 checks 1 to 5); pass one that also runs check 6 when the canonical domain is known.

type MentionAddressCheck = (addr: string) => boolean

Source: content.ts:238

MessageCreatedEvent type

d of message.created: a Message object without ctx and seq (11 §8.1).

type MessageCreatedEvent = Omit<Message, "ctx" | "seq" | "type">

Source: wire/messaging.ts:540

MessageNotificationKind type

Message kinds: the triggers of 11 §16 that go through the notification window (19 §4.5, §5.2).

type MessageNotificationKind = "mention" | "reply" | "mention_all" | "dm_message"

Source: wire/notifications.ts:19

MessagingErrorCode type

An error code owned by 11 (11 §17.1).

type MessagingErrorCode = keyof typeof MESSAGING_ERRORS

Source: wire/messaging.ts:905

MetaCheckResult type

The result of the /meta check (03 §5.1 item 5, §5.3, §12.4).

type MetaCheckResult = "ok" | "update_required" | "server_too_old"

Source: events/socket.ts:194

MetadataChangeKind type

changes values of discovery.metadata_changed (02 §16.1). Unknown values: treat as other.

type MetadataChangeKind = "keys" | "domains" | "endpoints" | "auth" | "limits" | "features" | "versions" | "secure" | "other"

Source: wire/discovery.ts:376

MetadataFetch type

A successful /meta fetch.

type MetadataFetch = { kind: "ok"; body: Uint8Array; etag: string | null; freshnessSec: number } | { kind: "not_modified"; etag: string | null; freshnessSec: number }

Source: discovery/fetch.ts:186

MetadataInvalidReason type

data.reason of discovery.metadata_invalid (02 §17).

type MetadataInvalidReason = "not_json" | "too_large" | "redirect" | "missing_member" | "bad_member" | "bad_domains" | "api_mismatch" | "invalid_keys" | "invalid_key_chain" | "private_key_published"

Source: wire/discovery.ts:460

Mid type

A client-generated UUIDv7 in lowercase hyphenated form (11 §2.4).

type Mid = string

Source: wire/messaging.ts:157

MigrateReason type

Why call control migrates a call to another relay (15 §15). Unknown: treat as drain.

type MigrateReason = "drain" | "rebalance" | string & {}

Source: wire/calls.ts:135

MlsClientGroupState type

Client group state machine states (13 §16). The SDK doesn't drive this machine; it is exported for apps that do.

type MlsClientGroupState = "absent" | "bootstrapping" | "joining" | "welcomed" | "awaiting_readd" | "member" | "committing" | "catching_up" | "deferred" | "blocked" | "removed" | "retired"

Source: wire/mls.ts:156

MlsContextKind type

The kind of context a group belongs to, for the extension rules of 13 §3.5.

type MlsContextKind = "channel" | "dm"

Source: mls/provider.ts:556

MlsCredentialRejectedReason type

data.reason of mls.credential_rejected: an identity check result of 07 §10.6, or not_permitted (A5) and the other results 13 §6.1.1 names. Only state_unavailable is retryable.

type MlsCredentialRejectedReason = "state_unavailable" | "subject_mismatch" | "device_mismatch" | "account_insecure" | "generation_mismatch" | "key_mismatch" | "device_not_listed" | "device_revoked" | "not_permitted" | "duplicate_device_leaf" | "mixed_identity" | string & {}

Source: wire/mls.ts:254

MlsErrorCode type

An mls.* error code (13 §18).

type MlsErrorCode = keyof typeof MLS_ERRORS

Source: wire/mls.ts:789

MlsGroupPinCheck type

The result of checkGroupPin (13 §4.4).

type MlsGroupPinCheck = "ok" | "lower_generation" | "unannounced_generation" | "epoch_rollback"

Source: mls/provider.ts:601

MlsGroupState type

Server group state (13 §4.3). Unknown values: treat as retired and re-fetch after 60 s (13 §7.2).

type MlsGroupState = "none" | "active" | "frozen" | "retired" | string & {}

Source: wire/mls.ts:153

MlsHandshakeEvent type

mls.handshake payload: a HandshakeRecord, or the reduced form (13 §8.1, §8.3). Durable.

type MlsHandshakeEvent = HandshakeRecord | MlsHandshakeReduced

Source: wire/mls.ts:689

MlsNotMemberReason type

data.reason of mls.not_member (13 §18). Unknown values: treat as no_leaf.

type MlsNotMemberReason = "no_leaf" | "removal_pending" | string & {}

Source: wire/mls.ts:269

MlsPolicyRule type

data.rule of mls.policy_violation: a §3 rule name or a §12 rule ID (13 §18).

type MlsPolicyRule = "ciphersuite" | "wire_format" | "authenticated_data" | "credential_type" | "credential_changed" | "capabilities" | "extensions" | "external_sender" | "duplicate_leaf" | "welcome" | "bootstrap" | "sv_participants" | "E1" | "E2" | "E3" | "E4" | "E5" | "E6" | "M1" | "M2" | "M3" | "M4" | "M5" | "D1" | "D2" | "D3" | "D4" | "D5" | "D6" | string & {}

Source: wire/mls.ts:229

MlsProposalEvent type

mls.proposal payload: a ServerProposal, or the reduced form (13 §8.1, §8.4). Durable.

type MlsProposalEvent = ServerProposal | MlsProposalReduced

Source: wire/mls.ts:692

MlsProviderErrorKind type

Failure kinds a provider reports.

type MlsProviderErrorKind = "unprocessable" | "rejected" | "invalid_group_info" | "not_found"

Source: mls/provider.ts:1279

MlsRemovalReason type

Removal reasons of server Remove proposals (13 §13.1). Unknown values: treat as lost_access (13 §7.7).

type MlsRemovalReason = "kicked" | "banned" | "left" | "lost_access" | "device_revoked" | "identity_changed" | "account_downgraded" | "account_deleted" | "participant_left" | "participant_removed" | "evicted" | "stale_leaf" | "federation_blocked" | string & {}

Source: wire/mls.ts:171

MlsReportKind type

MlsReport kind (13 §7.10). Unknown values are stored as other by the server.

type MlsReportKind = "verification_failed" | "commit_unprocessable" | "fork_suspected" | "group_info_invalid" | string & {}

Source: wire/mls.ts:200

MlsResyncReason type

mls.resync_required reason (13 §8.6). Unknown values: resync.

type MlsResyncReason = "fork" | "commit_unprocessable" | "duplicate_leaf" | "state_lost" | string & {}

Source: wire/mls.ts:209

MlsVerificationReason type

data.reason of mls.verification_failed (13 §18); also MlsReport reason-style values.

type MlsVerificationReason = "malformed" | "signature" | "group_info" | "tree" | string & {}

Source: wire/mls.ts:248

ModerationAppliedAction type

moderation.applied actions; receivers show a generic line for unknown ones (10 §13.2).

type ModerationAppliedAction = "kick" | "ban" | "timeout" | "server_mute" | "restriction" | string & {}

Source: wire/moderation.ts:864

ModerationErrorCode type

An error code of 10 §14.

type ModerationErrorCode = keyof typeof MODERATION_ERRORS

Source: wire/moderation.ts:1009

NamespaceEntryKind type

kind of a namespace entry (01 §5.1).

type NamespaceEntryKind = "user" | "bot" | "channel" | "reserved" | "renamed" | "quarantined"

Source: wire/addressing.ts:255

NonCanonicalReason type

data.reason of address.non_canonical (01 §7.5). Receivers treat an unknown value as malformed.

type NonCanonicalReason = "malformed" | "local_not_prepared" | "domain_not_alabel" | "alias_domain" | string & {}

Source: wire/addressing.ts:170

NotAllowedReason type

data.reason of address.not_allowed (01 §5.4, §3.6).

type NotAllowedReason = "too_short" | "blocked" | string & {}

Source: wire/addressing.ts:176

NotForwardableReason type

data.reason of report.not_forwardable (10 §10.9).

type NotForwardableReason = "not_allowed" | "same_server" | "nothing_verified" | "already_forwarded" | "not_forwardable_kind" | string & {}

Source: wire/moderation.ts:625

NotFoundReason type

data.reason of address.not_found when available is false (01 §9.4). Receivers treat an unknown value as taken.

type NotFoundReason = "reserved" | "too_similar" | "not_allowed" | "taken" | string & {}

Source: wire/addressing.ts:182

NotificationCreated type

notification.created (19 §16.1).

type NotificationCreated = { record: NotificationRecord; badge: number } | ReducedNotificationPayload

Source: wire/notifications.ts:655

NotificationErrorCode type

Every error code 19 owns (19 §17).

type NotificationErrorCode = keyof typeof NOTIFY_ERRORS | keyof typeof PUSH_ERRORS | keyof typeof NOTIFICATION_ERRORS

Source: wire/notifications.ts:738

NotificationKind type

A notification kind (19 §5.3). Receivers must tolerate unknown values: a notify.event receiver answers ignored (19 §5.6 V4), and a client shows a generic notification (19 §8.1).

type NotificationKind = NotifyEventKind | HomeLocalNotificationKind | string & {}

Source: wire/notifications.ts:34

NotificationLevel type

A notification level (19 §7). Unknown stored values are treated as mentions (19 §7.1).

type NotificationLevel = "default" | "all" | "mentions" | "nothing" | string & {}

Source: wire/notifications.ts:234

NotificationSettingsChanged type

notification.settings_changed (19 §16.1); a deleted entry is sent with its defaults. A client treats an unknown scope as nothing to act on (19 §16.1); the union is closed so that scope narrows settings, so check scope before using settings.

type NotificationSettingsChanged = { scope: "global"; settings: NotificationSettings } | { scope: "community"; settings: CommunityNotificationSettings } | { scope: "context"; settings: ContextNotificationSettings }

Source: wire/notifications.ts:672

NotificationState type

Record state (19 §8.2); unknown values are treated as read.

type NotificationState = "unread" | "read" | "dismissed" | "withdrawn" | string & {}

Source: wire/notifications.ts:333

NotificationUpdated type

notification.updated (19 §16.1): the full new state.

type NotificationUpdated = { record: NotificationRecord; badge: number } | ReducedNotificationPayload

Source: wire/notifications.ts:658

NotificationWindowAction type

What the hosting server must do after a step (19 §4.4, §4.5).

type NotificationWindowAction = { type: "notify.triggered"; trigger: NotifyTrigger } | { type: "send"; aggregate: NotifyAggregate }

Source: api/notifications.ts:561

NotificationWindowInput type

An input to stepNotificationWindow (19 §4.5 state machine "Event" column).

type NotificationWindowInput = { type: "trigger"; trigger: NotifyTrigger; now: number; attentive: boolean; connected?: boolean; rateCapReached: boolean } | { type: "removed"; mid: string } | { type: "deadline"; now: number; attentive: boolean; readSeq: number | null; rateCapReached: boolean; capFreesAt?: number }

Source: api/notifications.ts:532

NotifyContextKind type

The context kind, which agrees with the ctx prefix ch:, dm:, gdm: (19 §5.2).

type NotifyContextKind = "channel" | "direct" | "group"

Source: wire/notifications.ts:97

NotifyEventKind type

Kinds a hosting server may send in notify.event (19 §5.3).

type NotifyEventKind = MessageNotificationKind | CallNotificationKind | "withdrawn"

Source: wire/notifications.ts:25

NotifyEventValidation type

The outcome a home server gives a notify.event (19 §5.6, 06 §9.4).

type NotifyEventValidation = { result: "rejected"; code: "federation.event_invalid" | "federation.event_not_authorized" | "notify.secure_preview" | "address.non_canonical" } | { result: "ignored" } | { result: "accepted" }

Source: wire/notifications.ts:216

NotifyRingEndReason type

Why a ring ended (15 §13.1); unknown values are treated as cancelled (19 §5.2).

type NotifyRingEndReason = "answered" | "declined" | "timeout" | "cancelled" | string & {}

Source: wire/notifications.ts:136

NotifySecurity type

The context's security mode when the event was sequenced; unknown values are treated as secure (19 §5.2).

type NotifySecurity = "insecure" | "secure" | string & {}

Source: wire/notifications.ts:100

NotifySender type

A trigger's sender (19 §4.4, §5.2): an AddressRef with kind, or 11's webhook Sender.

type NotifySender = NotifyAccountSender | NotifyWebhookSender

Source: wire/notifications.ts:94

OAuthTokenError type

RFC 6749 §5.2 error values at /v1/auth/par and /v1/auth/token (05 §7.8, left column).

type OAuthTokenError = "invalid_request" | "invalid_client" | "invalid_grant" | "unsupported_grant_type" | "server_error" | string & {}

Source: wire/accounts.ts:357

OutboxState type

States of an outbox item (11 §13.3).

type OutboxState = "uploading" | "queued" | "sending" | "waiting_for_server" | "waiting_for_keys" | "waiting_for_action" | "sent" | "failed"

Source: wire/messaging.ts:839

OverwriteTargetType type

What an overwrite applies to; receivers ignore overwrites with unknown values (10 §5.1).

type OverwriteTargetType = "role" | "member" | string & {}

Source: wire/moderation.ts:170

PairingAbortReason type

reason of abort (08 §6.6.2). A receiver treats an unknown reason as internal.

type PairingAbortReason = "wrong_code" | "verification_failed" | "cancelled" | "internal" | string & {}

Source: wire/device-setup.ts:240

PairingCredentialKind type

cred of cpace_a: how the entering device got the secret (04 §11.3 prs_kind 1 or 2).

type PairingCredentialKind = "qr" | "code"

Source: wire/device-setup.ts:195

PairingEndReason type

endReason of a PairingSession (08 §6.2). A client treats an unknown value as protocol_error.

type PairingEndReason = "completed" | "wrong_code" | "denied" | "cancelled" | "superseded" | "timeout" | "expired" | "identity_changed" | "device_revoked" | "protocol_error" | "registration_failed" | string & {}

Source: wire/device-setup.ts:133

PairingMessageRequest type

Body of POST /v1/me/pairing/{id}/messages (08 §6.4.4).

type PairingMessageRequest = { [K in PairingMessageType]: { type: K; body: PairingMessageBodies[K] } }[PairingMessageType]

Source: wire/device-setup.ts:261

PairingMessageType type

A pairing message type (08 §6.4.4).

type PairingMessageType = keyof PairingMessageBodies

Source: wire/device-setup.ts:258

PairingRole type

Which device shows the QR code and 6-digit code (08 §6.1).

type PairingRole = "new_device" | "enrolled_device"

Source: wire/device-setup.ts:130

PairingState type

state of a PairingSession (08 §6.2, §6.8). A client treats an unknown value as a terminal failure.

type PairingState = "waiting" | "joined" | "exchanging" | "confirmed" | "delivered" | "completed" | "failed" | "expired" | "cancelled" | string & {}

Source: wire/device-setup.ts:117

ParsedStream type

A parsed stream name (03 §8.3). id is the part after the prefix.

type ParsedStream = { kind: "channel"; ref: ChannelRef; id: string } | { kind: "dm"; ref: DmRef; id: string } | { kind: "gdm"; ref: GroupDmRef; id: string } | { kind: "me"; ref: "me" } | { kind: "community"; ref: "community" }

Source: wire/transport.ts:325

ParticipantKind type

A participant's account kind (15 §2.5.2). Unknown values: treat as user.

type ParticipantKind = "user" | "bot" | string & {}

Source: wire/calls.ts:37

PeerPinState type

Pin states (02 §10.1). Unknown values on the wire: treat as suspended.

type PeerPinState = "pinned" | "suspended"

Source: wire/discovery.ts:288

PeerResumedHow type

discovery.peer_resumed how (02 §16.3). Unknown values: treat as auto.

type PeerResumedHow = "auto" | "evidence" | "admin"

Source: wire/discovery.ts:400

Permission type

A permission name as carried on the wire: a known one, or a name from a later minor version that clients ignore when computing and preserve when editing (10 §3.3).

type Permission = KnownPermission | string & {}

Source: wire/moderation.ts:54

PermissionScope type

channel permissions can be overridden per channel; community ones can't (10 §3.2).

type PermissionScope = "channel" | "community"

Source: wire/moderation.ts:57

PinConflictReason type

Why a pin was suspended (02 §10.2, in its priority order). Unknown values: a generic conflict.

type PinConflictReason = "key_unrevoked" | "secure_downgrade" | "canonical_changed" | "chain_fork" | "chain_rollback" | "base_url_changed" | "keys_changed"

Source: wire/discovery.ts:291

PinEvaluation type

The outcome of evaluatePinChange.

type PinEvaluation = { accepted: true; pin: ServerPinRecord; changed: boolean; baseUrlChanged: boolean; acceptedByEvidence: boolean; chain: ChainAcceptance } | { accepted: false; reason: PinConflictReason; rejected: PinConflictReason[]; pin: ServerPinRecord; chain: ChainAcceptance }

Source: discovery/pins.ts:122

PinOutcome type

What pinning did during a resolution (02 §10.6).

type PinOutcome = "created" | "unchanged" | "updated" | "none"

Source: discovery/resolver.ts:50

PinState type

state of a pin record (07 §16.3). A client treats an unknown value as verified_blocked (fail safe, 07 §16.1).

type PinState = "pinned" | "verified" | "changed" | "verified_blocked" | "accepted" | "downgraded" | "downgraded_blocked" | "new_account" | string & {}

Source: wire/identity.ts:335

PinVaultRecordPlaintext type

Plaintext of a pin record (08 §8.6.2): 07's pin record plus t.

type PinVaultRecordPlaintext = PinRecord & { t: "pin" }

Source: wire/device-setup.ts:468

PlaintextRefusal type

Why a client must not send plaintext into a DM (12 §11.1, §6.2).

type PlaintextRefusal = "computed_secure" | "reported_secure" | "secure_pin" | "unverified_downgrade" | "state"

Source: api/dms.ts:532

PreUpgradeHistory type

preUpgradeHistory (09 §6.1): set together with upgradeSeq.

type PreUpgradeHistory = "kept" | "deleted" | string & {}

Source: wire/communities.ts:104

PreviewsSetting type

What notifications show (19 §7.1); unknown values are treated as sender_only.

type PreviewsSetting = "full" | "sender_only" | "none" | string & {}

Source: wire/notifications.ts:231

PrsKind type

prs_kind: 1 = QR secret, 2 = typed code (04 §11.3).

type PrsKind = 1 | 2

Source: api/pairing.ts:225

PurgeReason type

PurgeEvent.reason (11 §8.2). Unknown values count as admin.

type PurgeReason = "retention" | "pre_upgrade_deleted" | "admin" | string & {}

Source: wire/messaging.ts:184

PushGatewayPolicy type

endpoints.push.gatewayPolicy (02 §7.3.1). Unknown values are treated as listed.

type PushGatewayPolicy = "any" | "listed"

Source: wire/discovery.ts:121

PushRegistrationRemovedReason type

Why a registration was removed (19 §16.1); unknown values need no action.

type PushRegistrationRemovedReason = "gone" | "rejected" | "gateway_not_allowed" | string & {}

Source: wire/notifications.ts:678

PushResultStatus type

Status of one push (19 §11.3); a home server treats unknown values as deferred.

type PushResultStatus = "accepted" | "gone" | "rejected" | "deferred" | string & {}

Source: wire/notifications.ts:603

PushTransport type

Registration transport (19 §9.1).

type PushTransport = "gateway" | "webpush"

Source: wire/notifications.ts:459

PushType type

A push type (19 §10.3).

type PushType = "alert" | "call" | "background"

Source: wire/notifications.ts:456

PushUrgency type

Push urgency (19 §10.3, §11.3); gateways treat unknown values as normal.

type PushUrgency = "high" | "normal" | string & {}

Source: wire/notifications.ts:553

QueryValue type

A query parameter value. A plain list is sent comma-separated in one parameter, the default of 03 §2.6 item 4; a RepeatedQueryValue repeats the parameter.

type QueryValue = string | number | boolean | null | undefined | readonly (string | number)[] | RepeatedQueryValue

Source: core/http.ts:74

RandomSource type

A source of random bytes. Injectable for tests; production code uses randomBytes. UUIDv7 rand_b must come from a CSPRNG (03 §8.2 item 2).

type RandomSource = (n: number) => Uint8Array

Source: core/random.ts:11

RateLimitPolicyName type

A rate-limit policy name (policy-name, 03 §15.1).

type RateLimitPolicyName = typeof BASE_RATE_LIMIT_POLICIES[number] | string & {}

Source: wire/transport.ts:742

ReactionAddedEvent type

d of reaction.added: a ReactionEntry without seq (11 §8.1).

type ReactionAddedEvent = Omit<ReactionEntry, "seq">

Source: wire/messaging.ts:574

ReconnectAction type

What the client does after a socket closes (03 §5.10).

type ReconnectAction = "none" | "reconnect" | "recover_token" | "session_ended" | "replaced" | "stop"

Source: core/backoff.ts:18

ReconnectDelayMode type

How the reconnect delay is chosen.

type ReconnectDelayMode = "backoff" | "immediate" | "range"

Source: core/backoff.ts:33

RecordInvalidReason type

data.reason of discovery.record_invalid (02 §17).

type RecordInvalidReason = "malformed" | "conflicting" | "bad_url" | "wellknown_invalid"

Source: wire/discovery.ts:457

RecoveryPhraseInput type

The outcome of parseRecoveryPhraseInput (08 §4.3).

type RecoveryPhraseInput = { status: "valid"; entropy: Uint8Array; phrase: string; tokens: RecoveryToken[] } | { status: "incomplete"; tokens: RecoveryToken[] } | { status: "wrong"; tokens: RecoveryToken[] }

Source: api/backup.ts:260

RecoveryReason type

reason of a recovery record (08 §8.6.5). Unknown values are treated as replaced.

type RecoveryReason = "new" | "replaced" | "lost_or_stolen" | string & {}

Source: wire/device-setup.ts:489

RecoverySaveMethod type

saveMethod of a recovery record (08 §8.6.5). Unknown values are kept and treated as saved.

type RecoverySaveMethod = "password_manager" | "print" | "shown" | string & {}

Source: wire/device-setup.ts:492

RedirectUriForm type

The form of a redirect URI (05 §5.2).

type RedirectUriForm = "loopback" | "claimed_https" | "private_use"

Source: auth/oauth.ts:192

ReferenceTextRecord type

The record members notificationReferenceText reads (19 §8.1).

type ReferenceTextRecord = Pick<NotificationRecord, "kind" | "ctxKind" | "sender" | "count" | "otherSenders" | "community" | "call"> & Partial<Pick<NotificationRecord, "ctxName" | "ctxAddr">>

Source: api/notifications.ts:989

RegistrationClosedReason type

data.reason of auth.registration_closed (05 §7.3, §19).

type RegistrationClosedReason = "server" | "provider" | string & {}

Source: wire/accounts.ts:130

RegistrationPolicy type

auth.registration (02 §7.3.2). Unknown values: treat as closed.

type RegistrationPolicy = "open" | "invite" | "closed"

Source: wire/discovery.ts:160

RejoinOutcome type

What to do after a failed join attempt (15 §10.5).

type RejoinOutcome = { kind: "transient"; retryAfterMs: number | null; code: string | null } | { kind: "resend"; change: "fresh_join" | "fresh_join_create" | "take_over"; code: string } | { kind: "renew_session"; code: string } | { kind: "mls_join"; code: string } | { kind: "dm_upgrade_wait"; code: string } | { kind: "terminal"; reason: ContinuityEndReason; code: string | null }

Source: calls/continuity.ts:119

RelayClosingAction type

What a client does on relay.closing (15 §6.6, §10.1):

  • terminal: the seat was removed; no auto-rejoin.
  • none: a replaced the client caused itself.
  • planned_migration: drain (relay migration, §6.9).
  • call_restarted: planned migration into the new call (§12.1 steps 1–6 at once).
  • unexpected_drop: auto-rejoin (§10); for session_expired renew the session first.
type RelayClosingAction = { action: "terminal"; reason: string } | { action: "none" } | { action: "planned_migration" } | { action: "call_restarted" } | { action: "unexpected_drop"; renewSession: boolean }

Source: calls/relay.ts:178

RelayClosingReason type

relay.closing reasons (15 §6.6). A client treats an unknown reason as an unexpected drop.

type RelayClosingReason = "left" | "removed" | "revoked" | "moved" | "switched" | "call_ended" | "replaced" | "drain" | "call_restarted" | "timeout" | "overloaded" | "session_expired" | string & {}

Source: wire/calls.ts:92

RelayConnectFailureClass type

How a failed POST {relayUrl}/connect is handled (15 §6.2 item 3):

  • rejoin_now: ticket problems and relay.call_unknown. Rejoin at once; if that rejoin's connection fails the same way, continue with the schedule.
  • wait_then_rejoin: relay.overloaded, network errors, timeouts, other 5xx. Wait retryAfterMs or until the next scheduled time, whichever is later.
  • rejoin_once: relay.wrong_relay, relay.bad_offer, other 4xx, and SDK-side failures such as an invalid relay.url. Rejoin once at once; the same class again is terminal, with a call_failure report of phase relay_connect.
type RelayConnectFailureClass = "rejoin_now" | "wait_then_rejoin" | "rejoin_once"

Source: calls/relay.ts:219

RelayConnectResult type

Result of POST {relayUrl}/connect: either a 201 SDP answer or a 200 TURN ICE-servers challenge.

type RelayConnectResult = RelayConnectResponse | RelayConnectIceServersResponse

Source: wire/calls.ts:683

RelayFailureCause type

Why a relay connection was declared failed (15 §6.7 item 2).

type RelayFailureCause = "control_silence" | "ice_failed" | "ice_disconnected" | "transport_closed"

Source: calls/relay.ts:253

RelayVideoFeedback type

The relay-originated feedback kinds (17 §7.1 item 3). A sender accepts them only on its relay connection's sv-control channel with no from member.

type RelayVideoFeedback = VideoViewerStateFeedback | VideoAudienceFeedback | VideoUploadPressureFeedback

Source: wire/media.ts:252

RemoteSessionState type

Remote session state (06 §6.7). A client treats an unknown value as active (06 §6.2).

type RemoteSessionState = "active" | "extended" | string & {}

Source: wire/federation.ts:169

RemoteSessionStatus type

What the provider currently knows about its remote server, for status lines (06 §15):

  • idle: no session yet;
  • active / extended: a live session (06 §6.7);
  • home_unreachable: the home server can't issue assertions (06 §13.1);
  • remote_unreachable: the remote server isn't answering (06 §13.2);
  • unreachable: the remote server can't be used for now (audience mismatch, persistent verification failures, issuer unreachable, 06 §6.10);
  • sign_in_required: the home session is gone (03 §3.3);
  • blocked: federation.blocked, never retried (06 §12);
  • stopped: the home account is suspended or needs an upgrade, or the account is banned here (06 §6.10 rule 7);
  • ended: the session ended and must not be silently recreated.
type RemoteSessionStatus = "idle" | "active" | "extended" | "home_unreachable" | "remote_unreachable" | "unreachable" | "sign_in_required" | "blocked" | "stopped" | "ended"

Source: auth/remote.ts:1090

RemoteSessionWithToken type

A RemoteSession as returned by create and renew: token and tokenType present (06 §6.1).

type RemoteSessionWithToken = RemoteSession & { token: string; tokenType: "Bearer" }

Source: wire/federation.ts:225

ReportCategory type

A category as received (10 §10.2).

type ReportCategory = KnownReportCategory | string & {}

Source: wire/moderation.ts:409

ReportItemKind type

message, edit or reaction (10 §10.2). Unknown: treat as message.

type ReportItemKind = "message" | "edit" | "reaction" | string & {}

Source: wire/moderation.ts:436

ReportItemResult type

Results of the report verification procedure (14 §13.5). Unknown values: not verified.

type ReportItemResult = "verified" | "plaintext" | "not_found" | "credential_invalid" | "bad_signature" | "bad_key" | "decrypt_failed" | "bad_content" | "not_referenced" | string & {}

Source: wire/history.ts:135

ReportItemRole type

reported or context (10 §10.2). Unknown: treat as context.

type ReportItemRole = "reported" | "context" | string & {}

Source: wire/moderation.ts:434

ReportKind type

messages or member (10 §10.2). Unknown: treat as member.

type ReportKind = "messages" | "member" | string & {}

Source: wire/moderation.ts:395

ReportOrigin type

Where a report was filed (10 §10.2). Unknown: treat as local.

type ReportOrigin = "local" | "forwarded" | "reporter_home" | string & {}

Source: wire/moderation.ts:393

ReportOutcome type

The coarse outcome the reporter sees (10 §10.6).

type ReportOutcome = "action_taken" | "reviewed" | string & {}

Source: wire/moderation.ts:432

ReportResolution type

Resolution (10 §10.6). Unknown: treat as no_action.

type ReportResolution = "action_taken" | "no_action" | "invalid" | "duplicate" | "expired" | string & {}

Source: wire/moderation.ts:430

ReportRouting type

moderators (default) or admins (10 §10.5).

type ReportRouting = "moderators" | "admins" | string & {}

Source: wire/moderation.ts:424

ReportStatus type

Report status (10 §10.6). Unknown: treat as open.

type ReportStatus = "open" | "in_review" | "resolved" | "withdrawn" | string & {}

Source: wire/moderation.ts:428

ReportVerification type

Summary over reported items (10 §10.2). Unknown: treat as failed.

type ReportVerification = "verified" | "partial" | "failed" | "not_applicable" | string & {}

Source: wire/moderation.ts:426

ReservedClass type

Class of a reserved local part (01 §5.4): P protocol, A administrative, C channel names.

type ReservedClass = "P" | "A" | "C"

Source: wire/addressing.ts:258

ResetIdentityRequest type

Body of POST /v1/me/identity/reset (07 §11.6).

type ResetIdentityRequest = { mode: "new_key"; expectedIgen: number; identityCertificate: string; deviceCertificate: string; keyPackages?: ResetKeyPackageUpload } | { mode: "downgrade"; expectedIgen: number }

Source: wire/identity.ts:231

ResolveRequestOptions type

Options of ResolveApi.resolve. auth defaults to 'session': the session token raises the rate limit from 30 to 120 per 60 s (02 §6.1). Pass auth: 'none' before sign-in (a web client's bootstrap server).

type ResolveRequestOptions = PublicReadOptions

Source: discovery/resolve-api.ts:16

ResultOutcome type

How the tracker read one SubscriptionResult (03 §5.6, §7.3).

type ResultOutcome = { action: "following"; position: number | null; replayThrough: number | null } | { action: "heads" } | { action: "refused" } | { action: "self_resync"; start: ResyncStart }

Source: events/tracker.ts:87

ResyncReason type

session.resync_required reasons. A client treats an unknown value like gap_too_large (03 §7.5).

type ResyncReason = "gap_too_large" | "expired" | "ahead" | "access_changed" | "buffer_overflow" | "server_reset" | string & {}

Source: wire/transport.ts:548

RetryMode type

Which failures FetchHttpClient retries by itself (03 §2.7):

  • 'auto' (default): network errors, timeouts, problems with retryable: true, and bare 429/502/503/504, for idempotent requests.
  • 'transport': only failures that carry no problem object from the server (network errors, timeouts, bare 429/502/503/504), for idempotent requests. Every problem the server returns, retryable or not, goes to the caller at once. For endpoints whose owner defines its own recovery for retryable codes ("or earlier where the owner says so", 03 §2.7), such as 13's mls.* refusals, while an unknown outcome is still resent with the same bytes.
  • 'none': no automatic retries.

In every mode a 401 is recovered once (03 §3.3) and 425 core.too_early is retried once (03 §2.2 item 4), because the server didn't process the request.

type RetryMode = "auto" | "transport" | "none"

Source: core/http.ts:95

RevokeDeviceReason type

The reasons a client may send to POST /v1/me/devices/{did}/revoke (05 §12.9).

type RevokeDeviceReason = "removed" | "lost_or_stolen"

Source: wire/accounts.ts:112

RevokedReason type

Revocation reason (05 §12.3). Receivers treat an unknown value as other.

type RevokedReason = "signed_out" | "removed" | "lost_or_stolen" | "signed_out_elsewhere" | "shared_expired" | "inactive" | "token_reuse" | "code_reuse" | "bot_token_revoked" | "bot_token_expired" | "account_deleted" | "admin" | "other" | string & {}

Source: wire/accounts.ts:95

RingEndReason type

Why a target's ring ended (15 §13.1, §15). Unknown values: treat as cancelled.

type RingEndReason = "answered" | "declined" | "timeout" | "cancelled" | string & {}

Source: wire/calls.ts:132

RoleAction type

A role change to check with checkRoleAction (10 §4.3, §7.3, §7.4).

type RoleAction = { type: "create"; position?: number; permissions?: readonly string[] } | { type: "update"; roleId: string } & UpdateRoleRequest | { type: "delete"; roleId: string } | { type: "grant"; roleId: string; target: MemberLike } | { type: "remove"; roleId: string; target: MemberLike }

Source: permissions.ts:499

RoleListPage type

Response of GET /v1/roles (10 §7.2).

type RoleListPage = CollectionPage<Role>

Source: wire/moderation.ts:131

S2SEventType type

An S2S event type registered in v1 (06 §10.1).

type S2SEventType = keyof typeof S2S_EVENT_CATALOGUE

Source: wire/federation.ts:492

S2SLane type

Delivery lane (06 §9.8).

type S2SLane = "high" | "normal"

Source: wire/federation.ts:422

S2SUnauthenticatedReason type

data.reason of federation.s2s_unauthenticated (06 §17.4).

type S2SUnauthenticatedReason = "missing" | "malformed" | "alg" | "typ" | "claims" | "kid" | "issuer_not_canonical" | "key_unknown" | "key_status" | "signature" | "audience" | "method" | "uri" | "body_hash" | "expired" | "not_yet_valid" | "lifetime" | "replayed" | string & {}

Source: wire/federation.ts:633

SdkErrorCode type

A code in the reserved sdk.* area.

type SdkErrorCode = typeof SDK_ERROR_CODES[keyof typeof SDK_ERROR_CODES]

Source: core/errors.ts:41

SealedKind type

A SealedMessage kind (14 §4.3; meanings owned by 11 §3.1). A receiver that meets an unknown kind verifies it and then ignores it.

type SealedKind = "message" | "edit" | "reaction" | "delete" | string & {}

Source: wire/history.ts:60

SealedOutcome type

Outcomes of opening a SealedMessage on a client (14 §6.4).

type SealedOutcome = "ok" | "pending_key" | "pending_sender" | "unavailable" | "invalid" | "fork_evidence"

Source: wire/history.ts:129

SealedVerifyStep type

The step of 14 §6.3 that failed, as reported in the sealed_verify diagnostic (14 §9.4).

type SealedVerifyStep = "format" | "context" | "credential" | "signature" | "ekid" | "kc" | "decrypt" | "content" | "timeout"

Source: wire/history.ts:132

SeatRemovalReason type

Why a seat was removed, as call.participant_left reports it (15 §2.6, §15). Unknown values: treat as left.

type SeatRemovalReason = "left" | "timeout" | "removed" | "revoked" | "session_expired" | "moved" | "switched" | "call_ended" | string & {}

Source: wire/calls.ts:77

SeatState type

A seat's state (15 §2.5.2, §2.6). Unknown values: treat as connecting.

type SeatState = "connecting" | "connected" | "reconnecting" | string & {}

Source: wire/calls.ts:40

SecStatePin type

Any known secure-state pin record (09 §13.2).

type SecStatePin = ChannelSecPin | CommunitySecPin | GroupDmSecPin

Source: wire/communities.ts:733

SecureAccess type

Secure access of a remote session (06 §6.2, §7.3): full, existing_only (an extended session) or none. A client treats an unknown value as none.

type SecureAccess = "full" | "existing_only" | "none" | string & {}

Source: wire/federation.ts:175

SecureHostOutcome type

What happens to a DM whose hosting server is (or has become) a secure server (12 §13.1).

type SecureHostOutcome = { result: "unchanged" } | { result: "encryption_pending" } | { result: "closed"; successorHost: string | null }

Source: api/dms.ts:673

SecurityState type

Account security state: insecure or secure (06 §4.3). A verifier rejects other values.

type SecurityState = "insecure" | "secure"

Source: wire/federation.ts:27

SenderKind type

Sender.kind (11 §5.1). A receiver treats an unknown value as bot.

type SenderKind = "user" | "bot" | "webhook" | string & {}

Source: wire/messaging.ts:178

SeqRange type

A seq range [start, end]; null as the end means "open" (11 §7.1).

type SeqRange = [number, number | null]

Source: wire/messaging.ts:476

ServerEventsOptions type

Options of ServerClient.events: the EventSocketOptions the server client doesn't fill in itself.

type ServerEventsOptions = Omit<EventSocketOptions, "baseUrl" | "tokens" | "client"> & { client?: string }

Source: client.ts:200

ServerKeyCheck type

Result of checkServerKey.

type ServerKeyCheck = { kind: "valid"; key: ServerKey; publicKey: Uint8Array } | { kind: "ignored" } | { kind: "invalid"; detail: string } | { kind: "private"; detail: string }

Source: discovery/keys.ts:59

ServerKeyPurpose type

What a server key may sign (02 §11.3). Keys with any other value are ignored.

type ServerKeyPurpose = "sign" | "mls-external-sender"

Source: wire/discovery.ts:80

ServerKeyResolver type

Resolves a server key for 06 §3.2. Throw SloppyVoiceError with code discovery.unknown_key or discovery.key_unusable (02) for those failures; they map to data.reason key_unknown and key_status. Any other error (for example 503 federation.issuer_unreachable or discovery.peer_suspended) is passed through unchanged.

type ServerKeyResolver = (req: ServerKeyRequest) => FederationKey | Promise<FederationKey>

Source: auth/remote.ts:295

ServerKeyStatus type

Server key lifecycle states (02 §11.4). Keys with any other value are ignored.

type ServerKeyStatus = "next" | "active" | "retired" | "revoked"

Source: wire/discovery.ts:83

ServerLimits type

ServerMetadata limits (02, 03 §16): every limit of 03 §16.3, each optional. Unknown limit names are ignored (03 §16.1 rule 3).

type ServerLimits = { [K in LimitName]?: number } & { [name: string]: number | undefined }

Source: wire/transport.ts:819

ServerProposalBody type

The body of a server proposal (13 §6.3).

type ServerProposalBody = { type: "remove"; removed: number } | { type: "group_context_extensions"; extensions: readonly MlsExtension[] }

Source: mls/provider.ts:807

ServerProposalReason type

Server proposal reason: a removal reason, or key_rotation for a GroupContextExtensions proposal (13 §13.1).

type ServerProposalReason = MlsRemovalReason | "key_rotation"

Source: wire/mls.ts:191

ServerProposalType type

Server proposal type (13 §7.7).

type ServerProposalType = "remove" | "group_context_extensions" | string & {}

Source: wire/mls.ts:194

SessionEndedReason type

reason of federation.session_ended (event and problem data) (06 §6.7, §6.8, §17.4). A client treats an unknown value as admin.

type SessionEndedReason = "expired" | "extension_limit" | "device_revoked" | "identity_changed" | "account_deleted" | "blocked" | "key_revoked" | "moderation" | "replaced" | "signed_out" | "admin" | string & {}

Source: wire/federation.ts:278

SessionErrorCode type

A session.* error code (03 §10.6).

type SessionErrorCode = keyof typeof SESSION_ERRORS

Source: wire/transport.ts:228

SessionPing type

session.ping payload, {} (03 §5.9).

type SessionPing = EmptyPayload

Source: wire/transport.ts:461

SessionPong type

session.pong payload, {}, with re = the ping's id (03 §5.9).

type SessionPong = EmptyPayload

Source: wire/transport.ts:463

SettingsOutcome type

The settings outcome (19 §6.2).

type SettingsOutcome = "drop" | "silent" | "notify"

Source: api/notifications.ts:756

SettingsRule type

Which rule decided (19 §6.2 H1–H9), or home_local for the fixed rules of 19 §6.5.

type SettingsRule = "H1" | "H2" | "H3" | "H4" | "H5" | "H8" | "H9" | "home_local"

Source: api/notifications.ts:759

SfuClosedReason type

Why an SFU session closed (15 §15). Unknown values: treat as sfu_failed.

type SfuClosedReason = "route_changed" | "negotiation_timeout" | "removed" | "sfu_failed" | string & {}

Source: wire/calls.ts:138

SfuFrameCodecName type

A codec allowed on the SFU path of a secure call (18 §8.4.2).

type SfuFrameCodecName = keyof typeof SFU_FRAME_CODECS

Source: wire/media.ts:138

Sleep type

Sleep for ms, rejecting with the signal's reason if it aborts. Injectable for tests.

type Sleep = (ms: number, signal?: AbortSignal) => Promise<void>

Source: core/time.ts:19

SourceId type

A media source ID, 0–15 (15 §4.1).

type SourceId = number

Source: wire/calls.ts:126

StreamName type

A stream name: a context reference, me or community (03 §7.1, §8.3).

type StreamName = CtxRef | "me" | "community"

Source: wire/transport.ts:292

StreamPositions type

Stream name → position P (03 §7.3).

type StreamPositions = Partial<Record<StreamName, number>>

Source: events/seq-store.ts:11

StructuredValue type

A bare item or parameter value of a structured field (RFC 9651).

type StructuredValue = string | number | boolean

Source: core/http.ts:267

SubscriptionLevel type

Subscription level (03 §5.6).

type SubscriptionLevel = "full" | "heads"

Source: wire/transport.ts:367

SubscriptionRequest type

What the client asked for a stream, so its SubscriptionResult can be read (03 §5.4, §5.6, §7.3).

type SubscriptionRequest = { kind: "resume"; position: number } | { kind: "subscribe" } | { kind: "heads" } | { kind: "self_resync" }

Source: events/tracker.ts:48

SubscriptionStatus type

SubscriptionResult status. A client treats an unknown value as refused (03 §5.6).

type SubscriptionStatus = "ok" | "refused" | string & {}

Source: wire/transport.ts:370

SvTokenKind type

The kind of a Sloppy Voice credential, told by its prefix (05 §7.4).

type SvTokenKind = keyof typeof TOKEN_PREFIXES

Source: wire/accounts.ts:38

SvTokenPrefix type

A token prefix (05 §7.4 token-prefix).

type SvTokenPrefix = typeof TOKEN_PREFIXES[SvTokenKind]

Source: wire/accounts.ts:41

SystemRole type

everyone, admin, or null for an ordinary role; unknown values display as null and are never offered for deletion (10 §4.1).

type SystemRole = "everyone" | "admin" | string & {}

Source: wire/moderation.ts:64

T6CheckAnswer type

The answer to the check before T6: GET /v1/channels/{P.ctx} (09 §13.4).

type T6CheckAnswer = { status: 200; channel: Channel } | { status: 404 } | { status: 410 }

Source: api/channels.ts:911

TalkStateReason type

TalkState reason values (16 §7.10).

type TalkStateReason = "muted" | "not_allowed" | "connecting" | "reconnecting" | "waiting_for_keys" | "no_microphone" | MuteReason

Source: wire/media.ts:363

TalkStateState type

TalkState state values (16 §7.10). A UI that gets an unknown value shows it as not_heard with no reason.

type TalkStateState = "off" | "transmitting" | "not_heard" | "muted" | "idle"

Source: wire/media.ts:360

ThumbnailMime type

A thumbnail media type (11 §3.6).

type ThumbnailMime = typeof THUMBNAIL_MIME_TYPES[number]

Source: wire/messaging.ts:150

TickResult type

The outcome of offering a tick to a LeaseTracker.

type TickResult = "accepted" | "stale_seq" | "other_call" | "invalid"

Source: calls/lease.ts:79

TickSource type

Where a lease tick came from (15 §4.4, 16 §12.1 item 1): the relay's sv-control channel, the event WebSocket, or a join or rejoin response. The client accepts ticks from no other source (16 §12.1 item 2).

type TickSource = "relay" | "websocket" | "join"

Source: calls/lease.ts:76

TimelineItem type

A timeline item (11 §7.1). Items of an unknown type are ignored apart from their seq.

type TimelineItem = Message & { type: "message" } | SystemItem

Source: wire/messaging.ts:473

Timestamp type

An RFC 3339 timestamp string (00 §7.2).

type Timestamp = string

Source: wire/communities.ts:26

TokenRequest type

Any body of POST /v1/auth/token (05 §7.2).

type TokenRequest = AuthorizationCodeGrantRequest | RefreshTokenGrantRequest

Source: wire/accounts.ts:403

TokenResponse type

Any success body of POST /v1/auth/token (05 §7.3, §7.6, §8.2).

type TokenResponse = SessionTokenResponse | SignupTokenResponse | ReauthTokenResponse | LinkTokenResponse | RefreshTokenResponse

Source: wire/accounts.ts:485

TrackDirection type

SFU track direction (15 §8.2).

type TrackDirection = "send" | "recv" | string & {}

Source: wire/calls.ts:141

TrackState type

SFU track state (15 §8.2). Unknown values: treat as paused.

type TrackState = "active" | "paused" | string & {}

Source: wire/calls.ts:144

TransmitMode type

Transmit mode, a per-device user setting (16 §7.1).

type TransmitMode = "ptt" | "vad" | "open_mic"

Source: wire/media.ts:348

TransportErrorCode type

Every error code this document registers (03 §10.5, §10.6).

type TransportErrorCode = CoreErrorCode | SessionErrorCode

Source: wire/transport.ts:231

TxtLookupResult type

The result of one TXT lookup at _sloppyv.<domain> after following any CNAME chain (02 §3.4, §3.5).

  • answer: the RRset (an empty list is NODATA). ttlSec is the smallest TTL in the answer, including every CNAME in the chain; when unknown the SDK uses the 300 s minimum (02 §13.1).
  • nxdomain / nodata: no record. negativeTtlSec is the SOA minimum (RFC 2308), if known.
  • servfail (including DNSSEC "bogus"), refused, timeout, truncated (and not retriable over TCP) or error (including a CNAME chain longer than 8 links): a temporary DNS failure.

dnssec: 'secure' may be reported only by a resolver that validated the whole answer itself or is reached over a channel the verifier trusts; the AD bit from a resolver reached over an unauthenticated path MUST NOT be reported as validation (02 §3.5).

type TxtLookupResult = { status: "answer"; records: TxtRecord[]; ttlSec?: number; dnssec?: DnssecStatus } | { status: "nxdomain" | "nodata"; negativeTtlSec?: number; dnssec?: DnssecStatus } | { status: "servfail" | "refused" | "timeout" | "truncated" | "error"; detail?: string }

Source: discovery/txt.ts:28

TxtRecord type

One TXT resource record: its character-strings in order. Strings are read as octets (each UTF-16 code unit as one octet when ≤ 0xFF); resolvers that decoded UTF-8 still produce non-ASCII characters for non-ASCII octets, which is all the classification needs.

type TxtRecord = readonly (string | Uint8Array)[]

Source: discovery/record.ts:16

TxtRecordClass type

The classification of one TXT resource record (02 §3.2).

type TxtRecordClass = { kind: "foreign" } | { kind: "valid"; baseUrl: string; params: Record<string, string> } | { kind: "malformed"; reason: Extract<RecordInvalidReason, "malformed" | "bad_url">; detail: string }

Source: discovery/record.ts:19

TxtRRsetOutcome type

The outcome of processing a TXT RRset that was answered (02 §3.4).

type TxtRRsetOutcome = { kind: "none" } | { kind: "delegation"; baseUrl: string } | { kind: "invalid"; reason: Extract<RecordInvalidReason, "malformed" | "conflicting" | "bad_url">; detail: string }

Source: discovery/record.ts:92

UserAction type

userAction as it appears on the wire (03 §10.2). Unknown values are tolerated in the type and treated as none by the SDK.

type UserAction = KnownUserAction | string & {}

Source: wire/transport.ts:44

VaultIntegrityCheck type

Which reader check of 08 §8.4 failed; the check of a vault_integrity diagnostic (08 §16.4).

type VaultIntegrityCheck = "decrypt" | "type" | "rid" | "bucket"

Source: api/vault.ts:236

VaultPlaintext type

A record plaintext: a JSON object whose t is the record type (08 §8.4).

type VaultPlaintext = unknown

Source: api/vault.ts:116

VaultRecordType type

A vault record type (08 §8.6). Grammar [a-z][a-z0-9_]{0,31}; clients ignore unknown types.

type VaultRecordType = "archive" | "shared_keys" | "pin" | "sec_pin" | "settings" | "recovery" | string & {}

Source: wire/device-setup.ts:305

VaultWriteResult type

One result of a vault write (08 §8.7.3).

type VaultWriteResult = { rid: string; ok: true; ver: number; vseq: number } | { rid: string; ok: false; error: VaultRecordProblem }

Source: wire/device-setup.ts:359

VerifyMethod type

verifyMethod of a pin record (07 §16.1).

type VerifyMethod = "safety_number" | "qr" | string & {}

Source: wire/identity.ts:347

VideoBlockedBy type

Why video is false in a VoiceLease (15 §4.1).

type VideoBlockedBy = "no_permission" | "timed_out" | "other" | string & {}

Source: wire/calls.ts:111

VideoCodecName type

A video codec name, as used in VideoPreference decode lists and VideoStats (17 §5.1).

type VideoCodecName = keyof typeof VIDEO_DC_CODECS

Source: wire/media.ts:118

VideoCodecNameWire type

A codec name as received: unknown names are ignored in decode and stored as given in stats (17 §5.1, §7.3, §14).

type VideoCodecNameWire = VideoCodecName | string & {}

Source: wire/media.ts:121

VideoRoute type

How video travels in a call (15 §2.5.1, §7.2). Unknown values: treat as dc.

type VideoRoute = "dc" | "sfu" | string & {}

Source: wire/calls.ts:28

VideoSourceId type

The video sources carried by video-dc/1: 1 screen video, 3 webcam (17 §6.2).

type VideoSourceId = 1 | 3

Source: wire/media.ts:45

VideoViewerState type

A relay's per-viewer forwarding state for a source (17 §8.2). Unknown values: treat as paused.

type VideoViewerState = "normal" | "thinned" | "keyframes_only" | "paused" | string & {}

Source: wire/media.ts:218

VisibilityChange type

One change to a channel member's visibility ranges (09 §7.2 table).

type VisibilityChange = { type: "joined"; seq: number; channelSecurity: "insecure" | "secure" } | { type: "reactivated"; seq: number } | { type: "left"; seq: number } | { type: "upgrade_cannot_follow"; upgradeSeq: number } | { type: "downgraded"; seq: number } | { type: "upgrade_followed" }

Source: api/channels.ts:397

VisibilityRange type

One visibility range [from, to]; to is null while open (09 §7.2).

type VisibilityRange = [from: number, to: number | null]

Source: wire/communities.ts:32

W9Trigger type

W9 trigger IDs (09 §13.4); collectors store unknown values as other (09 §13.6 step 5).

type W9Trigger = "T1" | "T2" | "T3" | "T4" | "T5" | "T6"

Source: wire/communities.ts:736

WebhookDisabledReason type

Webhook.disabledReason (11 §15.2).

type WebhookDisabledReason = "admin" | "secure_context" | string & {}

Source: wire/messaging.ts:785

WebhookState type

Webhook.state (11 §15.2). A receiver treats an unknown value as disabled.

type WebhookState = "active" | "disabled" | string & {}

Source: wire/messaging.ts:782

WebSocketConstructor type

A WebSocket constructor: new WebSocket(url, protocols) (03 §5.1 item 2).

type WebSocketConstructor = (url: string, protocols?: string | string[]) => WebSocketLike

Source: events/websocket.ts:63

WellKnownFetch type

One outcome of a .well-known fetch (02 §4.2).

type WellKnownFetch = { outcome: "present"; baseUrl: string; freshnessSec: number } | { outcome: "invalid"; detail: string } | { outcome: "absent"; detail: string } | { outcome: "unavailable"; detail: string; networkError?: boolean }

Source: discovery/fetch.ts:79

WellKnownParse type

The result of reading a .well-known/sloppyv body (02 §4.1).

type WellKnownParse = { kind: "present"; baseUrl: string } | { kind: "invalid"; detail: string } | { kind: "absent" }

Source: discovery/record.ts:116

WithheldReason type

Why evidence members are withheld from the caller (10 §10.5).

type WithheldReason = "security.account_required" | "security.device_not_enrolled" | string & {}

Source: wire/moderation.ts:452

WrongHostStep type

What to do after dm.wrong_host (12 §4.4).

type WrongHostStep = { action: "retry_at"; host: string } | { action: "retry_original"; host: string; delayMs: number } | { action: "give_up"; code: "core.unavailable" }

Source: api/dms.ts:297

Constants

ACCOUNT_ERRORS const

The auth.*, account.*, device.* and bot.* codes with their registry entries (05 §19). At /v1/auth/par and /v1/auth/token the HTTP status follows 05 §7.8 instead (400 for OAuth errors, 401 for invalid_client), so read the status from the problem, never from this table.

const ACCOUNT_ERRORS: { readonly auth.invalid_client: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly auth.invalid_redirect_uri: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly auth.unsupported_grant_type: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly auth.invalid_grant: { readonly status: 400; readonly retryable: false; readonly userAction: "sign_in" }; readonly auth.refresh_reused: { readonly status: 401; readonly retryable: false; readonly userAction: "sign_in" }; readonly auth.session_revoked: { readonly status: 401; readonly retryable: false; readonly userAction: "sign_in" }; readonly auth.home_session_required: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly auth.provider_unknown: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly auth.provider_error: { readonly status: 502; readonly retryable: true; readonly userAction: "retry" }; readonly auth.access_denied: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly auth.transaction_expired: { readonly status: 400; readonly retryable: false; readonly userAction: "retry" }; readonly auth.reauth_required: { readonly status: 403; readonly retryable: false; readonly userAction: "sign_in" }; readonly auth.reauth_mismatch: { readonly status: 403; readonly retryable: false; readonly userAction: "sign_in" }; readonly auth.registration_closed: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly auth.invite_required: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly auth.invite_invalid: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly auth.terms_not_accepted: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly auth.signup_token_invalid: { readonly status: 401; readonly retryable: false; readonly userAction: "sign_in" }; readonly auth.identity_already_linked: { readonly status: 409; readonly retryable: false; readonly userAction: "sign_in" }; readonly auth.provider_in_use: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly auth.last_provider: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly auth.too_many_providers: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly auth.too_many_devices: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly account.suspended: { readonly status: 403; readonly retryable: false; readonly userAction: "contact_admin" }; readonly account.deleted: { readonly status: 410; readonly retryable: false; readonly userAction: "none" }; readonly account.confirmation_mismatch: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly account.avatar_invalid: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly device.already_revoked: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly device.name_invalid: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly device.revocation_invalid: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly bot.not_allowed: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly bot.permission_required: { readonly status: 403; readonly retryable: false; readonly userAction: "contact_admin" }; readonly bot.not_owner: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly bot.invalid_owner: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly bot.limit_reached: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly bot.token_limit_reached: { readonly status: 409; readonly retryable: false; readonly userAction: "none" } }

Source: wire/accounts.ts:788

ACCOUNT_FIELD_LIMITS const

Field length limits a client checks before sending (05 §5.3, §7.3, §11.1, §12.2).

const ACCOUNT_FIELD_LIMITS: { readonly clientSoftwareMax: 64; readonly deviceNameMax: 64; readonly aboutMaxCodePoints: 190; readonly aboutMaxLineBreaks: 4; readonly stateMax: 512; readonly codeVerifierMin: 43; readonly codeVerifierMax: 128 }

Source: wire/accounts.ts:931

ADDRESS_ERRORS const

The address.* error codes, with HTTP status, userAction and retryable (01 §12.1).

const ADDRESS_ERRORS: { readonly address.invalid: { readonly status: 400; readonly userAction: "none"; readonly retryable: false; readonly title: "That isn't an address or a link" }; readonly address.invalid_local_part: { readonly status: 400; readonly userAction: "none"; readonly retryable: false; readonly title: "That name can't be used in an address" }; readonly address.invalid_domain: { readonly status: 400; readonly userAction: "none"; readonly retryable: false; readonly title: "That domain isn't valid" }; readonly address.invalid_link: { readonly status: 400; readonly userAction: "none"; readonly retryable: false; readonly title: "That link isn't valid" }; readonly address.non_canonical: { readonly status: 400; readonly userAction: "none"; readonly retryable: false; readonly title: "Address isn't in canonical form" }; readonly address.display_name_mismatch: { readonly status: 400; readonly userAction: "none"; readonly retryable: false; readonly title: "Display name doesn't match the address" }; readonly address.not_allowed: { readonly status: 403; readonly userAction: "none"; readonly retryable: false; readonly title: "That name isn't allowed here" }; readonly address.not_found: { readonly status: 404; readonly userAction: "none"; readonly retryable: false; readonly title: "Nothing has this address" }; readonly address.taken: { readonly status: 409; readonly userAction: "none"; readonly retryable: false; readonly title: "That address is taken" }; readonly address.too_similar: { readonly status: 409; readonly userAction: "none"; readonly retryable: false; readonly title: "That name is too close to an existing name" }; readonly address.reserved: { readonly status: 409; readonly userAction: "none"; readonly retryable: false; readonly title: "That name is reserved" }; readonly address.quarantined: { readonly status: 409; readonly userAction: "none"; readonly retryable: false; readonly title: "That address was recently deleted" }; readonly address.deleted: { readonly status: 410; readonly userAction: "none"; readonly retryable: false; readonly title: "This address was deleted" } }

Source: wire/addressing.ts:76

ADDRESS_LIMITS const

Limits and timers of 01 §14.2.

const ADDRESS_LIMITS: { readonly localPartMaxOctets: 64; readonly prepareInputMaxCodePoints: 256; readonly parseInputMaxCodePoints: 1024; readonly registrationMinDefault: 2; readonly registrationMinCap: 3; readonly displayNameMaxOctets: 128; readonly domainMaxOctets: 253; readonly labelMaxOctets: 63; readonly maxCombiningMarks: 4; readonly inviteMaxCodePoints: 64; readonly quarantineDays: 365; readonly renameReservationDays: 90; readonly ckeyMaxRounds: 3; readonly lookupRateMinPerMinute: 30; readonly lookupRateDefaultMaxPerMinute: 120; readonly lookupMaxAgeSeconds: 60; readonly liveCheckDebounceMs: 300; readonly shareLinkMaxRedirects: 3; readonly shareLinkTimeoutMs: 5000; readonly shareLinkMaxBodyBytes: 65536; readonly joinTemplateMaxOctets: 512 }

Source: wire/addressing.ts:331

API_PATH_PREFIX const

The versioned HTTP API path prefix of protocol version 1: endpoints live at {base}/v1/… (00 §7.1, 03 §2.1).

const API_PATH_PREFIX: "/v1" = '/v1'

Source: version.ts:21

ARGON2ID_ACCEPT const

The "verifiers accept" ranges of 04 §12.1.

const ARGON2ID_ACCEPT: { readonly m: readonly [65536, 262144]; readonly t: readonly [3, 10]; readonly p: 1; readonly v: 19; readonly saltBytes: 16; readonly tagBytes: 32 }

Source: api/backup.ts:319

ARGON2ID_PRODUCER_PARAMS const

The producer values of 04 §12.1 (D-052), without the salt.

const ARGON2ID_PRODUCER_PARAMS: { readonly alg: "argon2id"; readonly v: 19; readonly m: 65536; readonly t: 3; readonly p: 1 }

Source: api/backup.ts:316

AUTH_TIMERS const

Timers of 05 §20 that a client relies on, in milliseconds.

const AUTH_TIMERS: { readonly pushedRequestMs: 60000; readonly transactionMs: 600000; readonly authorizationCodeMs: 60000; readonly accessTokenMs: 900000; readonly signupTokenMs: 900000; readonly signupAttempts: 5; readonly refreshRetryWindowMs: 30000; readonly refreshMinIntervalMs: 10000; readonly maxBotTokenGraceMs: 86400000; readonly maxBotTokenLifetimeYears: 2 }

Source: wire/accounts.ts:888

AVATAR_CONTENT_TYPES const

The avatar media types PUT …/avatar accepts (05 §11.7).

const AVATAR_CONTENT_TYPES: readonly AvatarContentType[]

Source: api/me.ts:15

BASE_RATE_LIMIT_POLICIES const

The base rate-limit policy names (03 §15.1). Owners add <area>.<name> policies.

const BASE_RATE_LIMIT_POLICIES: readonly ["session", "ip", "peer", "socket", "handshake"]

Source: wire/transport.ts:739

BLOCKED_BY_PRECEDENCE const

When several inputs block a list, …BlockedBy names the first of these that applies (15 §4.1).

const BLOCKED_BY_PRECEDENCE: readonly ["timed_out", "no_permission", "muted_for_everyone", "server_muted"]

Source: wire/calls.ts:117

BOT_TOKEN_PREFIX const

The bot token prefix, with its separator (05 §7.4).

const BOT_TOKEN_PREFIX: "svb_" = 'svb_'

Source: auth/bots.ts:18

CALL_END_REASONS const

Every call.ended reason defined in v1 (15 §2.4).

const CALL_END_REASONS: readonly ["empty", "completed", "unanswered", "declined", "security_upgraded", "security_downgraded", "group_restarted", "channel_deleted", "context_closed", "server_restart"]

Source: wire/calls.ts:60

CALL_ERRORS const

The call.*, relay.* and sfu.* error codes with their registry entries (15 §16.1).

const CALL_ERRORS: { readonly call.unsupported_context: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly call.not_active: { readonly status: 404; readonly retryable: false; readonly userAction: "none" }; readonly call.ended: { readonly status: 410; readonly retryable: false; readonly userAction: "none" }; readonly call.already_in_call: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly call.full: { readonly status: 409; readonly retryable: true; readonly userAction: "wait" }; readonly call.rejoin_expired: { readonly status: 410; readonly retryable: false; readonly userAction: "none" }; readonly call.rejoin_invalid: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly call.moved: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly call.not_participant: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly call.not_permitted: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly call.mls_join_required: { readonly status: 409; readonly retryable: true; readonly userAction: "none" }; readonly call.epoch_unknown: { readonly status: 409; readonly retryable: true; readonly userAction: "none" }; readonly call.ring_not_allowed: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly call.relay_unavailable: { readonly status: 503; readonly retryable: true; readonly userAction: "wait" }; readonly relay.ticket_invalid: { readonly status: 401; readonly retryable: false; readonly userAction: "none" }; readonly relay.ticket_expired: { readonly status: 401; readonly retryable: false; readonly userAction: "none" }; readonly relay.ticket_replayed: { readonly status: 401; readonly retryable: false; readonly userAction: "none" }; readonly relay.wrong_relay: { readonly status: 421; readonly retryable: false; readonly userAction: "none" }; readonly relay.call_unknown: { readonly status: 404; readonly retryable: true; readonly userAction: "none" }; readonly relay.bad_offer: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly relay.overloaded: { readonly status: 503; readonly retryable: true; readonly userAction: "wait" }; readonly relay.bad_message: { readonly status: 0; readonly retryable: false; readonly userAction: "none" }; readonly sfu.not_active: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly sfu.unavailable: { readonly status: 503; readonly retryable: true; readonly userAction: "wait" }; readonly sfu.bad_sdp: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly sfu.negotiation_conflict: { readonly status: 409; readonly retryable: true; readonly userAction: "none" }; readonly sfu.session_unknown: { readonly status: 404; readonly retryable: true; readonly userAction: "none" } }

Source: wire/calls.ts:1128

CALL_LIMITS const

The limits this document adds to ServerMetadata limits (15 §2.7, §16.2).

const CALL_LIMITS: { readonly maxCallParticipants: { readonly default: 200; readonly floor: 25 } }

Source: wire/calls.ts:191

CALL_RATE_LIMITS const

Per-session rate limits of the call API (15 §3.1). Servers MAY set higher limits.

const CALL_RATE_LIMITS: { readonly joinPerMinute: 30; readonly participantUpdatesPerSecond: 10; readonly epochReadyPerSecond: 10; readonly ringMinIntervalMs: 10000; readonly ringMaxPerCall: 5; readonly diagnosticsPerHour: 30 }

Source: wire/calls.ts:291

CALL_TIMERS const

Every timer of 15 §2.7, in milliseconds.

const CALL_TIMERS: { readonly leaseSnapshotIntervalMs: 1000; readonly leaseValidityMs: 3000; readonly revocationPushShouldMs: 100; readonly revocationPushMustMs: 500; readonly relayTickReemitShouldMs: 50; readonly tickMaxQueueMs: 250; readonly relayStaleSnapshotMs: 3000; readonly revocationCutoffMs: 4000; readonly sfuRevocationMs: 1000; readonly relayTicketLifetimeMs: 60000; readonly relayUnknownCallWaitMs: 2000; readonly relayPingIntervalMs: 5000; readonly relayFailureMs: 5000; readonly relayClientGoneMs: 10000; readonly relayConnectTimeoutMs: 10000; readonly connectingSeatTimeoutMs: 20000; readonly reconnectingSeatMs: 30000; readonly rejoinTokenWindowMs: 60000; readonly screenShareHoldMs: 30000; readonly restoringTimeoutMs: 10000; readonly epochSwitchCapMs: 2000; readonly oldEpochRetentionMs: 10000; readonly laggingSenderGateMs: 8000; readonly unknownEpochHoldMs: 200; readonly videoRouteOverlapMs: 5000; readonly moveVoiceAdmissionMs: 3000; readonly ringTimeoutMs: 45000; readonly dmNoRingSoloMs: 60000; readonly diagnosticsSampleMs: 10000; readonly reconnectingBadgeDelayMs: 2000; readonly pidQuarantineMs: 60000; readonly migrateDeadlineMs: 10000; readonly relayMigrationWindowMs: 10000; readonly sfuNegotiationTimeoutMs: 10000; readonly turnGatheringWaitMs: 3000; readonly turnCredentialMinLifetimeMs: number; readonly turnCredentialMaxLifetimeMs: number; readonly turnRenewLeadMs: number; readonly turnRenewAgainLeadMs: number; readonly iceRestartAnswerMs: 5000; readonly iceRestartTimeoutMs: 10000; readonly iceRestartRetryMs: 30000 }

Source: wire/calls.ts:197

CHANNEL_ERRORS const

The channel.* codes (09 §15.3). Note that the error code channel.deleted and the event type channel.deleted share a name but are different things.

const CHANNEL_ERRORS: { readonly channel.deleted: { readonly status: 410; readonly retryable: false; readonly userAction: "none" }; readonly channel.join_required: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly channel.kind_immutable: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly channel.limit_reached: { readonly status: 409; readonly retryable: false; readonly userAction: "contact_admin" }; readonly channel.category_not_found: { readonly status: 404; readonly retryable: false; readonly userAction: "none" }; readonly channel.version_conflict: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly channel.already_secure: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly channel.upgrade_plan_stale: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly channel.upgrade_in_progress: { readonly status: 409; readonly retryable: true; readonly userAction: "wait" }; readonly channel.bootstrap_required: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly channel.plaintext_rejected: { readonly status: 409; readonly retryable: false; readonly userAction: "none" } }

Source: wire/communities.ts:954

CHANNEL_ID_PATTERN const

channel-id (09 §2): a UUIDv7, or ch + : (or %3A/%3a) + UUIDv7.

const CHANNEL_ID_PATTERN: RegExp

Source: wire/communities.ts:1143

CHANNEL_KINDS const

The channel kinds of D-064 (09 §6.2).

const CHANNEL_KINDS: readonly ["text", "voice"]

Source: wire/communities.ts:91

CHANNEL_MEMBER_STATES const

The ChannelMember states of 09 §4.5.

const CHANNEL_MEMBER_STATES: readonly ["active", "needs_encryption", "left"]

Source: wire/communities.ts:73

CHANNEL_PERMISSIONS const

The channel-scoped permissions (rows 1–12): CH of 10 §6.1.

const CHANNEL_PERMISSIONS: readonly KnownPermission[]

Source: permissions.ts:70

CHANNEL_SECURITY_MODES const

The channel security modes (09 §6.1).

const CHANNEL_SECURITY_MODES: readonly ["insecure", "secure"]

Source: wire/communities.ts:96

CHOSEN_STATUSES const

The chosen statuses (11 §11.1).

const CHOSEN_STATUSES: readonly ["online", "idle", "dnd", "invisible"]

Source: wire/messaging.ts:656

CLIENT_CLOSE_CODES const

Close codes a client may send (03 §5.10, §5.2): 1000, 1001, 4008 and the protocol-violation codes. Browsers substitute 4000 for 1002, 1003, 1007 and 1009 (03 §5.2 item 6).

const CLIENT_CLOSE_CODES: readonly [1000, 1001, 1002, 1003, 1007, 1009, 4000, 4008]

Source: wire/transport.ts:534

CLOSE_CODES const

The close codes of 03 §5.10 with their reasons. Client actions are implemented in core/backoff.ts.

const CLOSE_CODES: { readonly 1000: { readonly reason: null; readonly meaning: "Normal closure by the client" }; readonly 1001: { readonly reason: null; readonly meaning: "Going away (either side)" }; readonly 1002: { readonly reason: null; readonly meaning: "WebSocket protocol violation" }; readonly 1003: { readonly reason: null; readonly meaning: "Binary message" }; readonly 1007: { readonly reason: null; readonly meaning: "Invalid UTF-8" }; readonly 1009: { readonly reason: "too_large"; readonly meaning: "A message exceeded maxEventBytes" }; readonly 1011: { readonly reason: null; readonly meaning: "Internal server error" }; readonly 1012: { readonly reason: "server_shutdown"; readonly meaning: "Service restart or connection moved" }; readonly 1013: { readonly reason: null; readonly meaning: "Try again later" }; readonly 4000: { readonly reason: "protocol_error"; readonly meaning: "Invalid envelope or session.hello payload, message before hello" }; readonly 4001: { readonly reason: "unauthenticated"; readonly meaning: "Token invalid, expired or revoked at hello, or the authentication deadline passed without session.reauth" }; readonly 4004: { readonly reason: "session_ended"; readonly meaning: "The client session ended" }; readonly 4008: { readonly reason: readonly ["hello_timeout", "idle_timeout"]; readonly meaning: "No hello within 10 s, or no message for 75 s" }; readonly 4010: { readonly reason: "replaced"; readonly meaning: "A newer socket of the same client session took over" }; readonly 4011: { readonly reason: "slow_consumer"; readonly meaning: "The client couldn't keep up" }; readonly 4026: { readonly reason: "unsupported_version"; readonly meaning: "Client protocol below minClient, or a client envelope with an unknown v" }; readonly 4029: { readonly reason: "rate_limited"; readonly meaning: "Too many client messages or connections" } }

Source: wire/transport.ts:504

COLLECTION_PAGE_LIMIT const

Collection page size bounds: 1 to 100, default 50; an owner may raise the maximum up to 1,000 (03 §13.2).

const COLLECTION_PAGE_LIMIT: { readonly min: 1; readonly max: 100; readonly ownerMax: 1000; readonly default: 50 }

Source: wire/transport.ts:668

COMMUNITY_ERRORS const

The community.* codes (09 §15.1).

const COMMUNITY_ERRORS: { readonly community.closed: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly community.invite_required: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly community.rules_acceptance_required: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly community.version_conflict: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly community.icon_invalid: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly community.local_admin_required: { readonly status: 403; readonly retryable: false; readonly userAction: "contact_admin" }; readonly community.confirmation_mismatch: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly community.upgrade_plan_stale: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly community.upgrade_in_progress: { readonly status: 409; readonly retryable: true; readonly userAction: "wait" }; readonly community.list_full: { readonly status: 409; readonly retryable: false; readonly userAction: "none" } }

Source: wire/communities.ts:929

COMMUNITY_EVENT_TYPES const

The event types of CommunityEvents (09 §14.2).

const COMMUNITY_EVENT_TYPES: readonly ["community.updated", "community.security_changed", "community.layout_changed", "community.list_changed", "member.joined", "member.left", "member.removed", "member.updated", "member.requested", "member.rejected", "channel.created", "channel.updated", "channel.security_changed", "channel.deleted", "invite.created", "invite.revoked"]

Source: wire/communities.ts:905

COMMUNITY_FIXED const

Fixed values of 09 §16.

const COMMUNITY_FIXED: { readonly communityNameMax: 64; readonly categoryNameMax: 100; readonly descriptionMax: 1000; readonly rulesTextMax: 8000; readonly topicMax: 1024; readonly retentionDaysMin: 1; readonly retentionDaysMax: 36500; readonly iconPixelsMin: 16; readonly iconPixelsMax: 1024; readonly inviteMaxAgeMsMin: 300000; readonly inviteMaxAgeMsMax: 31536000000; readonly inviteMaxAgeMsDefault: 604800000; readonly inviteMaxUsesMin: 1; readonly inviteMaxUsesMax: 10000; readonly inviteCodeLength: 12; readonly invitePurgeDays: 30; readonly failedInviteAttempts: 30; readonly pendingRequestDays: 30; readonly leftRecordDeleteAfterDays: 90; readonly upgradePlanNamesListed: 100; readonly membershipCheckMinAddrs: 1; readonly membershipCheckMaxAddrs: 20; readonly membershipCheckMinRatePerMinute: 60; readonly membershipCheckPositiveCacheMs: 3600000; readonly membershipCheckNegativeCacheMs: 600000; readonly identityStateFreshnessMs: 300000; readonly joinIntentLifetimeMs: 86400000; readonly deletedContentPurgeDays: 30; readonly channelTombstoneDays: 400; readonly renamedAddressReservationDays: 90; readonly t6HorizonDays: 90; readonly channelPinDeleteAfterDays: 400; readonly serverUpgradeTimeoutMs: 120000; readonly memberCountStalenessMs: 300000; readonly communityListRetryInitialMs: 1000; readonly communityListRetryMaxMs: 300000; readonly t5SecuredAtToleranceMs: 300000 }

Source: wire/communities.ts:1083

COMMUNITY_ICON_MEDIA_TYPES const

Icon media types (09 §3.4).

const COMMUNITY_ICON_MEDIA_TYPES: readonly ["image/png", "image/jpeg", "image/webp"]

Source: wire/communities.ts:115

COMMUNITY_LIMITS const

Limits advertised in ServerMetadata limits that 09 owns (09 §16).

const COMMUNITY_LIMITS: { readonly maxChannels: { readonly default: 500; readonly floor: 100; readonly owner: "09" }; readonly maxCategories: { readonly default: 50; readonly floor: 20; readonly owner: "09" }; readonly maxActiveInvites: { readonly default: 1000; readonly floor: 100; readonly owner: "09" }; readonly maxCommunityIconBytes: { readonly default: number; readonly floor: number; readonly owner: "09" }; readonly maxCommunitiesPerAccount: { readonly default: 500; readonly floor: 100; readonly owner: "09" } }

Source: wire/communities.ts:1071

COMMUNITY_MEMBER_ACTIVE_STATES const

The states that count as "community member" (09 §2).

const COMMUNITY_MEMBER_ACTIVE_STATES: readonly ["active", "needs_encryption"]

Source: wire/communities.ts:50

COMMUNITY_MEMBER_STATES const

The CommunityMember states of 09 §4.2.

const COMMUNITY_MEMBER_STATES: readonly ["active", "pending", "needs_encryption", "banned", "left"]

Source: wire/communities.ts:45

COMMUNITY_PERMISSIONS const

The community-scoped permissions (rows 13–20), never in overwrites (10 §3.2).

const COMMUNITY_PERMISSIONS: readonly KnownPermission[]

Source: permissions.ts:75

CONTROL_MESSAGE_TYPE_PATTERN const

msg-type = area "." name of an sv-control message (15 §6.5).

const CONTROL_MESSAGE_TYPE_PATTERN: RegExp

Source: wire/calls.ts:316

CORE_ERRORS const

The core.* error codes with their registry entries (03 §10.5, 00 §7.9). core.idempotency_conflict is retryable for reason: "in_progress" only.

const CORE_ERRORS: { readonly core.invalid_request: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly core.unauthenticated: { readonly status: 401; readonly retryable: false; readonly userAction: "sign_in" }; readonly core.token_expired: { readonly status: 401; readonly retryable: true; readonly userAction: "none" }; readonly core.forbidden: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly core.not_found: { readonly status: 404; readonly retryable: false; readonly userAction: "none" }; readonly core.method_not_allowed: { readonly status: 405; readonly retryable: false; readonly userAction: "none" }; readonly core.conflict: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly core.idempotency_conflict: { readonly status: 409; readonly retryable: "varies"; readonly userAction: "none" }; readonly core.gone: { readonly status: 410; readonly retryable: false; readonly userAction: "none" }; readonly core.too_large: { readonly status: 413; readonly retryable: false; readonly userAction: "none" }; readonly core.unsupported_media_type: { readonly status: 415; readonly retryable: false; readonly userAction: "none" }; readonly core.too_early: { readonly status: 425; readonly retryable: true; readonly userAction: "retry" }; readonly core.rate_limited: { readonly status: 429; readonly retryable: true; readonly userAction: "wait" }; readonly core.unsupported_version: { readonly status: 400; readonly retryable: false; readonly userAction: "update_app" }; readonly core.unsupported_feature: { readonly status: 501; readonly retryable: false; readonly userAction: "none" }; readonly core.internal: { readonly status: 500; readonly retryable: true; readonly userAction: "retry" }; readonly core.unavailable: { readonly status: 503; readonly retryable: true; readonly userAction: "wait" } }

Source: wire/transport.ts:191

DATA_CHANNELS const

The data-channel layout of every relay connection (15 §6.4). Every channel is created with negotiated: true and the fixed id.

const DATA_CHANNELS: { readonly control: { readonly id: 0; readonly label: "sv-control"; readonly protocol: "sv-control/1"; readonly ordered: true; readonly messageType: "text" }; readonly audio: { readonly id: 1; readonly label: "sv-audio"; readonly protocol: "voice-dc/1"; readonly ordered: false; readonly maxRetransmits: 0; readonly messageType: "binary" }; readonly video: { readonly id: 2; readonly label: "sv-video"; readonly protocol: "video-dc/1"; readonly ordered: false; readonly maxPacketLifeTime: 120; readonly messageType: "binary" } }

Source: wire/calls.ts:738

DEFAULT_ALERT_LOC_KEY const

The RECOMMENDED APNs alert localization key (19 §10.2).

const DEFAULT_ALERT_LOC_KEY: "SV_NOTIFICATION"

Source: api/push.ts:373

DEFAULT_ANTI_SPAM_POLICY const

The policy defaults (10 §12.2), without version.

const DEFAULT_ANTI_SPAM_POLICY: { readonly newMember: { readonly enabled: true; readonly durationMs: 600000; readonly restricted: readonly ["attach_files", "mention_everyone", "create_invites"] }; readonly newAccount: { readonly enabled: true; readonly ageMs: 86400000; readonly maxNewDmsPerDay: 5 }; readonly slowMode: {}; readonly mentionLimit: 20; readonly floodTimeout: { readonly enabled: true; readonly durationMs: 600000 } }

Source: wire/moderation.ts:819

DEFAULT_DIAGNOSTICS_SETTING const

The default diagnostics setting (15 §14.2, D-089).

const DEFAULT_DIAGNOSTICS_SETTING: DiagnosticsSetting = 'failures'

Source: wire/calls.ts:150

DEFAULT_EVERYONE_PERMISSIONS const

The initial permissions of the everyone role: the "Yes" rows of 10 §3.1 (10 §4.2).

const DEFAULT_EVERYONE_PERMISSIONS: readonly KnownPermission[]

Source: permissions.ts:80

DEFAULT_MAX_ATTEMPTS const

Default cap on attempts of one request, the first included (03 §2.7: stop after 5 attempts).

const DEFAULT_MAX_ATTEMPTS: 5 = 5

Source: core/http.ts:412

DEFAULT_MODERATOR_PERMISSIONS const

The permissions of the "Moderator" role pre-created at position 1 with every community (10 §4.2).

const DEFAULT_MODERATOR_PERMISSIONS: readonly KnownPermission[]

Source: permissions.ts:85

DEFAULT_NOTIFICATION_SETTINGS const

The defaults of 19 §7.1 (writable members).

const DEFAULT_NOTIFICATION_SETTINGS: { readonly enabled: true; readonly previews: "full"; readonly channels: "mentions"; readonly dms: "all"; readonly groupDms: "all"; readonly everyone: true; readonly calls: true }

Source: wire/notifications.ts:272

DEFAULT_TIMEOUT_MS const

Default per-attempt request timeout (03 §2.3 item 5).

const DEFAULT_TIMEOUT_MS: 30000 = 30_000

Source: core/http.ts:410

DEFINITIVE_DISCOVERY_FAILURES const

The definitive (non-retryable) failures of 02 §13.2, which discard cached results.

const DEFINITIVE_DISCOVERY_FAILURES: readonly ["discovery.not_found", "discovery.record_invalid", "discovery.delegation_conflict", "discovery.metadata_invalid", "discovery.domain_not_served", "discovery.canonical_mismatch", "discovery.forbidden_target", "discovery.version_unsupported", "core.unsupported_version"]

Source: wire/discovery.ts:476

DELEGATION_EVIDENCE_LEVELS const

The evidence levels in the classification order of 02 §9.1.

const DELEGATION_EVIDENCE_LEVELS: readonly ["dnssec", "same-site", "wellknown", "dns-only"]

Source: wire/discovery.ts:35

DEVICE_ID_PATTERN const

A device ID: 16 random bytes, base64url without padding, 22 characters, the last one A, Q, g or w (05 §12.4 did). An account incarnation inc uses the same grammar (05 §11.1).

const DEVICE_ID_PATTERN: RegExp

Source: wire/accounts.ts:58

DEVICE_INACTIVITY_MS const

Device inactivity limits (05 §12.5), in milliseconds. Bots have none.

const DEVICE_INACTIVITY_MS: { readonly desktop: number; readonly ios: number; readonly android: number; readonly web: number; readonly sharedComputer: number }

Source: wire/accounts.ts:922

DEVICE_PROOF_MAX_BYTES const

Maximum serialized DeviceProof size in octets (06 §5.2).

const DEVICE_PROOF_MAX_BYTES: 1024 = 1024

Source: wire/federation.ts:138

DEVICE_PROOF_MAX_LIFETIME_SEC const

Maximum DeviceProof lifetime in seconds (06 §3.3, §5.2).

const DEVICE_PROOF_MAX_LIFETIME_SEC: 60 = 60

Source: wire/federation.ts:141

DEVICE_PROOF_TYP const

JWS typ of a DeviceProof (06 §5.2, 04 §6.3).

const DEVICE_PROOF_TYP: "sv-devproof+jwt" = 'sv-devproof+jwt'

Source: wire/federation.ts:37

DEVICE_SETUP_ERRORS const

The pairing.*, backup.* and vault.* error codes of 08 §15.

const DEVICE_SETUP_ERRORS: { readonly pairing.not_found: { readonly status: 404; readonly retryable: false; readonly userAction: "none" }; readonly pairing.expired: { readonly status: 410; readonly retryable: false; readonly userAction: "retry" }; readonly pairing.ended: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly pairing.already_joined: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly pairing.role_mismatch: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly pairing.out_of_order: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly pairing.account_not_secure: { readonly status: 409; readonly retryable: false; readonly userAction: "enable_encryption" }; readonly pairing.unsupported_client: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly backup.not_found: { readonly status: 404; readonly retryable: false; readonly userAction: "none" }; readonly backup.invalid: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly backup.identity_mismatch: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly backup.version_conflict: { readonly status: 409; readonly retryable: true; readonly userAction: "none" }; readonly backup.stale_generation: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly backup.phrase_change_required: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly backup.required: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly vault.not_initialized: { readonly status: 409; readonly retryable: true; readonly userAction: "none" }; readonly vault.version_conflict: { readonly status: 409; readonly retryable: true; readonly userAction: "none" }; readonly vault.stale_generation: { readonly status: 409; readonly retryable: true; readonly userAction: "none" }; readonly vault.generation_conflict: { readonly status: 409; readonly retryable: true; readonly userAction: "none" }; readonly vault.rotation_required: { readonly status: 409; readonly retryable: true; readonly userAction: "none" }; readonly vault.quota_exceeded: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly vault.record_too_large: { readonly status: 413; readonly retryable: false; readonly userAction: "none" }; readonly vault.invalid_box_key: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly vault.invalid_generation: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly vault.grant_not_found: { readonly status: 404; readonly retryable: true; readonly userAction: "wait" }; readonly vault.changes_expired: { readonly status: 410; readonly retryable: false; readonly userAction: "none" }; readonly vault.retired_expired: { readonly status: 410; readonly retryable: false; readonly userAction: "none" } }

Source: wire/device-setup.ts:726

DEVICE_SETUP_LIMITS const

Limits and timers of 08 §16 that clients use.

const DEVICE_SETUP_LIMITS: { readonly maxBackupBytesDefault: 65536; readonly maxBackupBytesFloor: 16384; readonly maxVaultBytesDefault: 268435456; readonly maxVaultBytesFloor: 33554432; readonly maxVaultRecordBytesDefault: 16384; readonly maxVaultRecordBytesFloor: 4096; readonly pairingSessionMs: 600000; readonly pairingStepMs: 60000; readonly pairingFinishMs: 300000; readonly pairingCreatesPerHour: 5; readonly pairingOpenPerAccount: 3; readonly pairingPayloadMaxBytes: 65536; readonly pairingMessageMaxBytes: 2048; readonly pairingPollMinMs: 1000; readonly stagedBackupLifetimeMs: 86400000; readonly backupDownloadMaxAgeMs: 3600000; readonly enableEncryptionMaxAgeMs: 86400000; readonly enableEncryptionClientMaxAgeMs: 82800000; readonly vaultWriteBatchMax: 100; readonly vaultPageMax: 500; readonly vaultListDefault: 100; readonly vaultChangesDefault: 200; readonly vaultTombstoneDays: 30; readonly retiredVaultDays: 30; readonly archiveFlushMs: 60000; readonly archiveFlushKeys: 100; readonly sharedKeysPerRecord: 32; readonly rotationJitterMs: 5000; readonly grantNeededThrottleMs: 600000; readonly reSetupAfterMs: number; readonly vaultCasRetries: 5; readonly vaultCasJitterMs: 500; readonly w8IntervalMs: number; readonly clipboardClearMs: 60000 }

Source: wire/device-setup.ts:787

DIAGNOSTIC_KIND_PATTERN const

A report kind: 1–64 characters of lowercase letters, digits, _ and . (15 §14.4).

const DIAGNOSTIC_KIND_PATTERN: RegExp

Source: wire/calls.ts:173

DISCOVERY_ERRORS const

The discovery.* error codes of 02 §17, with HTTP status, retryable and userAction.

const DISCOVERY_ERRORS: { readonly discovery.invalid_domain: { readonly status: 400; readonly retryable: false; readonly userAction: "none"; readonly title: "Not a valid domain" }; readonly discovery.not_found: { readonly status: 404; readonly retryable: false; readonly userAction: "none"; readonly title: "No Sloppy Voice server at this domain" }; readonly discovery.record_invalid: { readonly status: 502; readonly retryable: false; readonly userAction: "none"; readonly title: "The discovery record is invalid" }; readonly discovery.delegation_conflict: { readonly status: 502; readonly retryable: false; readonly userAction: "none"; readonly title: "The discovery record and .well-known document disagree" }; readonly discovery.dns_failure: { readonly status: 503; readonly retryable: true; readonly userAction: "retry"; readonly title: "DNS lookup failed" }; readonly discovery.server_unreachable: { readonly status: 503; readonly retryable: true; readonly userAction: "retry"; readonly title: "The server could not be reached" }; readonly discovery.metadata_invalid: { readonly status: 502; readonly retryable: false; readonly userAction: "none"; readonly title: "The server metadata is invalid" }; readonly discovery.domain_not_served: { readonly status: 404; readonly retryable: false; readonly userAction: "none"; readonly title: "That server doesn't serve this domain" }; readonly discovery.canonical_mismatch: { readonly status: 502; readonly retryable: false; readonly userAction: "none"; readonly title: "The canonical domain resolves to a different server" }; readonly discovery.version_unsupported: { readonly status: 502; readonly retryable: false; readonly userAction: "none"; readonly title: "The server speaks only older protocol versions" }; readonly discovery.forbidden_target: { readonly status: 502; readonly retryable: false; readonly userAction: "none"; readonly title: "The server address is not allowed" }; readonly discovery.peer_suspended: { readonly status: 503; readonly retryable: true; readonly userAction: "wait"; readonly retryAfterMs: 900000; readonly title: "Federation with this server is suspended" }; readonly discovery.unknown_key: { readonly status: 400; readonly retryable: true; readonly userAction: "retry"; readonly retryAfterMs: 60000; readonly title: "Unknown server key" }; readonly discovery.key_unusable: { readonly status: 400; readonly retryable: false; readonly userAction: "none"; readonly title: "Server key cannot be used" } }

Source: wire/discovery.ts:436

DISCOVERY_LIMITS const

The timers and limits of 02 §18 (durations in ms unless the name says otherwise).

const DISCOVERY_LIMITS: { readonly maxRecordBytes: 1024; readonly maxBaseUrlBytes: 512; readonly maxCnameChain: 8; readonly dnsAttemptTimeoutMs: 5000; readonly dnsAttempts: 2; readonly dnsTotalTimeoutMs: 10000; readonly maxWellKnownBytes: 4096; readonly wellKnownConnectTimeoutMs: 5000; readonly wellKnownTotalTimeoutMs: 10000; readonly maxWellKnownRedirects: 3; readonly maxMetadataBytes: 262144; readonly metadataConnectTimeoutMs: 5000; readonly metadataTotalTimeoutMs: 10000; readonly resolutionTimeoutMs: 30000; readonly maxJoinTemplateBytes: 512; readonly maxUrlMemberBytes: 512; readonly minDomains: 1; readonly maxDomains: 100; readonly minKeys: 1; readonly maxKeys: 16; readonly maxKeyChain: 64; readonly maxKeyRotationBytes: 2048; readonly maxProviders: 16; readonly maxPushGateways: 32; readonly nextKeyPrePublicationSec: number; readonly retiredKeyMinLifetimeSec: number; readonly maxKeyLifetimeSec: 63158400; readonly unknownKidRefetchIntervalMs: 60000; readonly clockSkewSec: 60; readonly minFreshnessSec: 300; readonly maxFreshnessSec: 86400; readonly defaultFreshnessSec: 3600; readonly dnsFailureWellKnownFreshnessSec: 300; readonly maxStaleMs: number; readonly staleNewSignaturesMs: 86400000; readonly notFoundNegativeMinSec: 60; readonly notFoundNegativeMaxSec: 900; readonly notFoundNegativeDefaultSec: 300; readonly definitiveNegativeSec: 300; readonly temporaryNegativeInitialSec: 30; readonly temporaryNegativeMaxSec: 300; readonly userRetryIntervalMs: 10000; readonly invalidationIntervalMs: 60000; readonly suspendedRecheckIntervalMs: number; readonly metadataChangedJitterMs: 30000; readonly metadataChangedUrgentJitterMs: 5000; readonly pinRetentionMs: number; readonly suspendedInboundRecheckIntervalMs: 60000; readonly keyChainRetentionSec: number; readonly keyChainMinRecent: 16; readonly keyRotationRecommendedSec: number; readonly revokedKeyMinListedSec: number; readonly resolveRateLimitAnonymous: 30; readonly resolveRateLimitAuthenticated: 120; readonly resolveRateLimitWindowMs: 60000; readonly pinsListDefaultLimit: 50; readonly pinsListMaxLimit: 100; readonly serverOutboundResolutionsPerSec: 10; readonly metadataChangedSendWithinMs: 60000; readonly metadataChangedUrgentSendWithinMs: 10000; readonly selfCheckIntervalMs: number; readonly selfResolutionIntervalMs: 300000; readonly pslRefreshMs: number; readonly pslMaxAgeMs: number }

Source: wire/discovery.ts:496

DISCOVERY_RECORD_PREFIX const

The owner-name prefix of the discovery record: _sloppyv.<domain> (02 §3.1).

const DISCOVERY_RECORD_PREFIX: "_sloppyv." = '_sloppyv.'

Source: wire/discovery.ts:23

DISCOVERY_RECORD_VERSION_TAG const

The version tag of an sv1 discovery record (02 §3.2). Compared case-insensitively.

const DISCOVERY_RECORD_VERSION_TAG: "v=sv1" = 'v=sv1'

Source: wire/discovery.ts:20

DM_ERRORS const

Every dm.* error code (12 §17). dm.host_mismatch is S2S only (an EventResult error, 06 §9.3).

const DM_ERRORS: { readonly dm.wrong_host: { readonly status: 409; readonly retryable: true; readonly userAction: "retry"; readonly data: readonly ["host", "ctx"] }; readonly dm.invalid_participants: { readonly status: 400; readonly retryable: false; readonly userAction: "none"; readonly data: readonly ["reason", "addr"] }; readonly dm.recipient_not_found: { readonly status: 404; readonly retryable: false; readonly userAction: "none"; readonly data: readonly ["addr"] }; readonly dm.too_many_participants: { readonly status: 409; readonly retryable: false; readonly userAction: "none"; readonly data: readonly ["max"] }; readonly dm.security_mismatch: { readonly status: 409; readonly retryable: true; readonly userAction: "retry"; readonly data: readonly ["security", "participants"] }; readonly dm.upgrade_in_progress: { readonly status: 409; readonly retryable: true; readonly userAction: "none"; readonly data: readonly ["generation"] }; readonly dm.encryption_pending: { readonly status: 409; readonly retryable: true; readonly userAction: "wait"; readonly data: readonly ["waitingFor"] }; readonly dm.closed: { readonly status: 409; readonly retryable: false; readonly userAction: "none"; readonly data: readonly ["reason", "successor"] }; readonly dm.not_participant: { readonly status: 403; readonly retryable: false; readonly userAction: "none"; readonly data: readonly [] }; readonly dm.not_accepted: { readonly status: 403; readonly retryable: false; readonly userAction: "none"; readonly data: readonly [] }; readonly dm.not_group: { readonly status: 409; readonly retryable: false; readonly userAction: "none"; readonly data: readonly [] }; readonly dm.not_owner: { readonly status: 403; readonly retryable: false; readonly userAction: "none"; readonly data: readonly ["owner"] }; readonly dm.reservation_expired: { readonly status: 409; readonly retryable: true; readonly userAction: "retry"; readonly data: readonly ["addr"] }; readonly dm.request_not_pending: { readonly status: 409; readonly retryable: false; readonly userAction: "none"; readonly data: readonly ["state"] }; readonly dm.entry_active: { readonly status: 409; readonly retryable: false; readonly userAction: "none"; readonly data: readonly ["state"] }; readonly dm.host_mismatch: { readonly status: 403; readonly retryable: false; readonly userAction: "none"; readonly data: readonly ["ctx"] } }

Source: wire/dms.ts:695

DM_LIMITS const

The fixed limits and timers of 12 §18. maxGroupDmParticipants and maxDmRequestBytes are ServerMetadata limits with a default and a floor; they are in LIMITS of wire/transport.ts.

const DM_LIMITS: { readonly hostingMetadataMaxAgeMs: 3600000; readonly wrongHostServerRefetchAgeMs: 60000; readonly wrongHostRetryDelayMs: 5000; readonly hostIdentityStateMaxAgeMs: 300000; readonly requestIdentityStateMaxAgeMs: 86400000; readonly homeIdentityStateRefreshAgeMs: 3600000; readonly maxIdentityStateBytes: 32768; readonly creatorBootstrapGrantMs: 60000; readonly bootstrapGrantMs: 30000; readonly securityRecheckIntervalMs: 30000; readonly requestBatchIntervalMs: 5000; readonly activityHintIntervalMs: 60000; readonly reservationMs: 60000; readonly communityCheckTimeoutMs: 5000; readonly communityCheckPositiveCacheMs: 3600000; readonly communityCheckNegativeCacheMs: 600000; readonly communityMemberCountCacheMs: 86400000; readonly maxCommunityChecks: 10; readonly maxSharedCommunityMembers: 200; readonly maxCommunityHints: 10; readonly maxGroupNameScalars: 100; readonly maxGroupNameBytes: 400; readonly maxAddsPerRequest: 10; readonly maxNewInvitationsPerDay: 20; readonly maxIncomingPerSenderPerDay: 20; readonly maxIncomingPerOriginPerDay: 200; readonly maxPendingRequests: 200; readonly maxPendingRequestsPerHost: 20; readonly requestLifetimeMs: number; readonly invitationLifetimeMs: number; readonly declineQuietPeriodMs: number; readonly autoAcceptedEventRetentionMs: number; readonly silentRequestBlockThreshold: 3; readonly silentRequestBlockWindowMs: number; readonly s2sRetryWindowMs: 86400000; readonly maxIndexListLimit: 100; readonly defaultIndexListLimit: 50; readonly maxBlocks: 10000; readonly minGroupOtherParticipants: 2 }

Source: wire/dms.ts:800

DM_TIMELINE_EVENT_TYPES const

The context event types of 12 §16.1 that are timeline items (11 §7.1 SystemItems).

const DM_TIMELINE_EVENT_TYPES: readonly ["dm.created", "dm.participant_added", "dm.participant_removed", "dm.participant_updated", "dm.settings_changed", "dm.call_logged", "dm.security_changed", "dm.closed"]

Source: wire/dms.ts:670

EAGER_VAULT_TYPES const

The record types a device syncs eagerly (08 §7 E4, §8.6).

const EAGER_VAULT_TYPES: readonly VaultRecordType[]

Source: api/vault.ts:900

elligator2Generator const

calculate_generator of draft-irtf-cfrg-cpace-13 for CPACE-X25519-SHA512 (04 §11.4): SHA-512(lv_cat("CPace255", PRS, zero_bytes(len_zpad), CI, sid)), the first 32 bytes with the top bit cleared, mapped with Elligator 2.

const elligator2Generator: CpaceGenerator

Source: api/pairing.ts:347

ENTITLED_DEVICE_LEVEL_REASONS const

The removal reasons after which a device may rejoin with a new leaf ("entitled device-level", 13 §2.2, §13.2).

const ENTITLED_DEVICE_LEVEL_REASONS: readonly ["evicted", "stale_leaf", "identity_changed"]

Source: wire/mls.ts:188

ENTRY_KINDS const

The kinds v1 defines (11 §3.1).

const ENTRY_KINDS: readonly ["message", "edit", "reaction", "delete"]

Source: wire/messaging.ts:166

ENVELOPE_VERSION const

The envelope version on the sloppyv.v1 subprotocol (03 §6.1).

const ENVELOPE_VERSION: 1 = 1

Source: wire/transport.ts:238

EVERYONE_TOKEN const

The <@everyone> token (11 §3.4 rule 2).

const EVERYONE_TOKEN: "<@everyone>" = EVERYONE

Source: content.ts:433

FEATURES const

The feature registry (03 §12.2). Secure-mode support is mandatory and has no flag (D-066).

const FEATURES: { readonly voice-dc/1: { readonly owner: "16"; readonly servers: "mandatory"; readonly clients: "Mandatory for Full and Web clients; optional for Bot clients"; readonly meaning: "Voice frames over WebRTC data channels through the hosting server's relay (D-094)." }; readonly video-dc/1: { readonly owner: "17"; readonly servers: "mandatory"; readonly clients: "Mandatory for Full and Web clients; optional for Bot clients"; readonly meaning: "Screen share and webcam over WebRTC data channels." }; readonly sfu-rtp/1: { readonly owner: "17"; readonly servers: "optional"; readonly clients: "Mandatory for Full and Web clients; optional for Bot clients"; readonly meaning: "RTP media through an SFU (required for the SFU-capable server class)." }; readonly webhooks: { readonly owner: "11"; readonly servers: "optional"; readonly clients: "Not applicable (management endpoints only)"; readonly meaning: "Webhooks in insecure contexts." } }

Source: wire/transport.ts:683

FEDERATION_BLOCK_NOTE_MAX const

Maximum length of a block note (06 §12.2).

const FEDERATION_BLOCK_NOTE_MAX: 500 = 500

Source: wire/federation.ts:570

FEDERATION_ERRORS const

The federation.* error codes with their registry entries (06 §16). federation.session_ended has retryable = data.retry and userAction retry when data.retry is true, otherwise none.

const FEDERATION_ERRORS: { readonly federation.audience_is_home: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly federation.blocked: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly federation.assertion_invalid: { readonly status: 401; readonly retryable: false; readonly userAction: "none" }; readonly federation.assertion_replayed: { readonly status: 401; readonly retryable: true; readonly userAction: "retry" }; readonly federation.wrong_audience: { readonly status: 401; readonly retryable: true; readonly userAction: "retry" }; readonly federation.device_proof_required: { readonly status: 401; readonly retryable: true; readonly userAction: "retry" }; readonly federation.device_proof_invalid: { readonly status: 401; readonly retryable: false; readonly userAction: "none" }; readonly federation.identity_mismatch: { readonly status: 409; readonly retryable: true; readonly userAction: "retry" }; readonly federation.issuer_unreachable: { readonly status: 503; readonly retryable: true; readonly userAction: "wait" }; readonly federation.session_ended: { readonly status: 401; readonly retryable: "varies"; readonly userAction: "none" }; readonly federation.home_unreachable: { readonly status: 503; readonly retryable: true; readonly userAction: "wait" }; readonly federation.home_reachable: { readonly status: 409; readonly retryable: true; readonly userAction: "retry" }; readonly federation.extension_limit: { readonly status: 409; readonly retryable: false; readonly userAction: "wait" }; readonly federation.s2s_unauthenticated: { readonly status: 401; readonly retryable: true; readonly userAction: "none" }; readonly federation.not_authorized: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly federation.batch_invalid: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly federation.event_invalid: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly federation.event_too_large: { readonly status: 413; readonly retryable: false; readonly userAction: "none" }; readonly federation.event_not_authorized: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly federation.event_expired: { readonly status: 410; readonly retryable: false; readonly userAction: "none" } }

Source: wire/federation.ts:581

FRESH_AUTH_MAX_AGE const

The fresh-authentication limits of 05 §9.1, in milliseconds.

const FRESH_AUTH_MAX_AGE: { readonly default: 600000; readonly keyBackupDownload: 3600000; readonly turnOnEncryption: 86400000 }

Source: wire/accounts.ts:912

GENERIC_NOTIFICATION_TEXT const

"New notification": the text for an unusable payload or unavailable record (19 §13.7).

const GENERIC_NOTIFICATION_TEXT: "New notification" = 'New notification'

Source: api/notifications.ts:986

HISTORY_ERRORS const

The sealed.* and history.* error codes with their registry entries (14 §15).

const HISTORY_ERRORS: { readonly sealed.invalid: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly sealed.header_mismatch: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly sealed.not_secure: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly sealed.required: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly sealed.device_mismatch: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly sealed.not_in_group: { readonly status: 409; readonly retryable: true; readonly userAction: "retry" }; readonly sealed.wrong_epoch: { readonly status: 409; readonly retryable: true; readonly userAction: "retry" }; readonly sealed.kind_unsupported: { readonly status: 422; readonly retryable: false; readonly userAction: "none" }; readonly sealed.ref_invalid: { readonly status: 422; readonly retryable: false; readonly userAction: "none" }; readonly sealed.bad_signature: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly history.disabled: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly history.not_member: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly history.share_invalid: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly history.share_forbidden: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly history.share_range_invalid: { readonly status: 422; readonly retryable: false; readonly userAction: "none" }; readonly history.share_too_large: { readonly status: 413; readonly retryable: false; readonly userAction: "none" } }

Source: wire/history.ts:332

HISTORY_LIMITS const

Limits and timers of 14 §16.1 and §16.2.

const HISTORY_LIMITS: { readonly sealedVersion: 1; readonly shareVersion: 1; readonly maxShareItems: 5000; readonly shareKeyWrapsMin: 1; readonly shareKeyWrapsMax: 100; readonly sharesPerHour: 30; readonly shareListLimit: { readonly min: 1; readonly max: 10; readonly default: 5 }; readonly sharedKeysPerRecord: 32; readonly credentialLookupMax: 100; readonly paddingBucket: 256; readonly kindMaxChars: 32; readonly generationMax: 2147483647; readonly sealedGraceMs: 30000; readonly archiveAppendWithinMs: 60000; readonly pendingSenderRetryStartMs: 5000; readonly pendingSenderRetryMaxMs: 600000; readonly pendingSenderGiveUpMs: number }

Source: wire/history.ts:18

HOME_ASSERTION_MAX_BYTES const

Maximum serialized HomeAssertion size in octets (06 §4.6).

const HOME_ASSERTION_MAX_BYTES: 4096 = 4096

Source: wire/federation.ts:91

HOME_ASSERTION_MAX_LIFETIME_SEC const

Maximum HomeAssertion lifetime exp − iat in seconds (06 §3.3, §4.3).

const HOME_ASSERTION_MAX_LIFETIME_SEC: 300 = 300

Source: wire/federation.ts:94

HOME_ASSERTION_TYP const

JWS typ of a HomeAssertion (06 §4.3, 04 §6.3).

const HOME_ASSERTION_TYP: "sv-assert+jwt" = 'sv-assert+jwt'

Source: wire/federation.ts:34

ICE_SERVERS_ID_PATTERN const

iceServersId: 1–64 characters of [A-Za-z0-9_-] (15 §6.2, §6.10.1).

const ICE_SERVERS_ID_PATTERN: RegExp

Source: wire/calls.ts:328

IDEMPOTENCY_KEY_PATTERN const

The idempotency-key grammar: 1 to 64 of ALPHA / DIGIT / "-" / "." / "_" / "~" (03 §8.4, §14.2 item 2).

const IDEMPOTENCY_KEY_PATTERN: RegExp

Source: core/http.ts:225

IDENTITY_CHECK_RESULTS const

Every identity check result defined by 07 §10.6, in the table's order.

const IDENTITY_CHECK_RESULTS: readonly ["malformed", "typ_mismatch", "bad_signature", "non_canonical", "subject_mismatch", "issuer_mismatch", "generation_mismatch", "key_mismatch", "kind_mismatch", "identity_key_as_leaf", "dsk_mismatch", "dkf_mismatch", "device_not_listed", "device_revoked", "device_mismatch", "account_insecure", "state_stale", "state_unavailable", "state_rollback", "state_equivocation", "duplicate_device_leaf", "mixed_identity", "credential_changed", "wrong_credential_type", "not_participant", "pin_mismatch", "not_permitted"]

Source: wire/identity.ts:69

IDENTITY_ERRORS const

The identity.* error codes of 07 §19.

const IDENTITY_ERRORS: { readonly identity.not_found: { readonly status: 404; readonly userAction: "none"; readonly retryable: false }; readonly identity.account_deleted: { readonly status: 410; readonly userAction: "none"; readonly retryable: false }; readonly identity.invalid_certificate: { readonly status: 400; readonly userAction: "none"; readonly retryable: false }; readonly identity.subject_mismatch: { readonly status: 403; readonly userAction: "none"; readonly retryable: false }; readonly identity.generation_mismatch: { readonly status: 409; readonly userAction: "none"; readonly retryable: false }; readonly identity.already_secure: { readonly status: 409; readonly userAction: "set_up_device"; readonly retryable: false }; readonly identity.not_secure: { readonly status: 409; readonly userAction: "enable_encryption"; readonly retryable: false }; readonly identity.key_reused: { readonly status: 409; readonly userAction: "none"; readonly retryable: false }; readonly identity.device_mismatch: { readonly status: 403; readonly userAction: "none"; readonly retryable: false }; readonly identity.device_revoked: { readonly status: 403; readonly userAction: "sign_in"; readonly retryable: false }; readonly identity.device_conflict: { readonly status: 409; readonly userAction: "none"; readonly retryable: false }; readonly identity.unknown_device: { readonly status: 404; readonly userAction: "none"; readonly retryable: false }; readonly identity.too_many_devices: { readonly status: 409; readonly userAction: "none"; readonly retryable: false }; readonly identity.downgrade_not_allowed: { readonly status: 409; readonly userAction: "none"; readonly retryable: false } }

Source: wire/identity.ts:428

IDENTITY_LIMITS const

Limits and timers of 07 §20 that clients use.

const IDENTITY_LIMITS: { readonly skewSec: 60; readonly maxStateLifetimeSec: 86400; readonly channelAsFreshSec: 300; readonly dmAdmissionFreshSec: 86400; readonly dmRefetchAfterSec: 21600; readonly channelLookupsPerMinute: 20; readonly maxIdentityCertificateBytes: 2048; readonly maxDeviceCertificateBytes: 2048; readonly maxDeviceRevocationBytes: 1024; readonly maxIdentityStateBytes: 32768; readonly maxCredentialVectorBytes: 2048; readonly maxEnrolledDevicesDefault: 50; readonly maxEnrolledDevicesFloor: 10; readonly maxEnrolledDevicesCeiling: 64; readonly maxRevokedEntries: 50; readonly maxRevokedWithRev: 8; readonly qrValiditySec: 600; readonly safetyNumberIterations: 5200; readonly removalFallbackSec: 60; readonly verifierStoreRetentionDays: 30 }

Source: wire/identity.ts:452

INCARNATION_PATTERN const

The incarnation grammar: the grammar of did (05 §11.1).

const INCARNATION_PATTERN: RegExp = DEVICE_ID_PATTERN

Source: wire/accounts.ts:61

INLINE_BLOB_CONTENT_TYPES const

Media types whose blobs are served with their own Content-Type in insecure contexts and shown inline by clients; everything else is application/octet-stream (11 §14.4).

const INLINE_BLOB_CONTENT_TYPES: readonly ["image/png", "image/jpeg", "image/gif", "image/webp", "video/mp4", "video/webm", "audio/ogg", "audio/mpeg", "audio/mp4", "audio/webm"]

Source: wire/messaging.ts:133

INVITE_CODE_ALPHABET const

The Crockford base32 alphabet of invite codes (09 §8.2).

const INVITE_CODE_ALPHABET: "0123456789ABCDEFGHJKMNPQRSTVWXYZ" = '0123456789ABCDEFGHJKMNPQRSTVWXYZ'

Source: wire/communities.ts:1137

INVITE_CODE_PATTERN const

sv-invite-code (09 §2): exactly 12 characters of the alphabet.

const INVITE_CODE_PATTERN: RegExp

Source: wire/communities.ts:1140

INVITE_ERRORS const

The invite.* codes (09 §15.4).

const INVITE_ERRORS: { readonly invite.not_found: { readonly status: 404; readonly retryable: false; readonly userAction: "none" }; readonly invite.expired: { readonly status: 410; readonly retryable: false; readonly userAction: "none" }; readonly invite.used_up: { readonly status: 410; readonly retryable: false; readonly userAction: "none" }; readonly invite.revoked: { readonly status: 410; readonly retryable: false; readonly userAction: "none" }; readonly invite.not_allowed: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly invite.limit_reached: { readonly status: 409; readonly retryable: false; readonly userAction: "contact_admin" } }

Source: wire/communities.ts:969

INVITE_STATES const

The invite states of 09 §8.1.

const INVITE_STATES: readonly ["active", "expired", "used_up", "revoked"]

Source: wire/communities.ts:107

JOIN_POLICIES const

The join policies of 09 §3.3, in table order.

const JOIN_POLICIES: readonly ["open", "invite", "request", "closed"]

Source: wire/communities.ts:40

KEY_ROTATION_TYP const

The JWS typ of a KeyRotation (02 §12.1, 04 §6.3).

const KEY_ROTATION_TYP: "sv-keyrot+jwt" = 'sv-keyrot+jwt'

Source: wire/discovery.ts:248

LEASE_VALIDITY_MS const

Lease validity used by every receiver, whatever validMs says (15 §4.2, 16 §12.1 item 6).

const LEASE_VALIDITY_MS: 3000 = CALL_TIMERS.leaseValidityMs

Source: calls/lease.ts:26

LIMITS const

Every limit of the limits index (03 §16.3, 00 §7.12) with default and floor. A client uses the advertised value, and assumes the floor when a limit is absent (03 §16.1 rule 3).

const LIMITS: { readonly maxRequestBytes: { readonly default: number; readonly floor: number; readonly owner: "03" }; readonly maxEventBytes: { readonly default: number; readonly floor: number; readonly owner: "03" }; readonly maxSubscriptions: { readonly default: 1000; readonly floor: 250; readonly owner: "03" }; readonly maxReplayEvents: { readonly default: 5000; readonly floor: 1000; readonly owner: "03" }; readonly maxMessageBytes: { readonly default: number; readonly floor: number; readonly owner: "11" }; readonly maxAttachmentBytes: { readonly default: number; readonly floor: number; readonly owner: "11" }; readonly maxSecureLeaves: { readonly default: 1000; readonly floor: 100; readonly owner: "13" }; readonly maxGroupDmParticipants: { readonly default: 25; readonly floor: 10; readonly owner: "12" }; readonly maxDmRequestBytes: { readonly default: number; readonly floor: number; readonly owner: "12" }; readonly maxMlsUploadBytes: { readonly default: number; readonly floor: number; readonly owner: "13" }; readonly maxFederationEventBytes: { readonly default: number; readonly floor: number; readonly owner: "06" }; readonly maxDevices: { readonly default: 30; readonly floor: 10; readonly owner: "05" }; readonly maxLinkedProviders: { readonly default: 10; readonly floor: 2; readonly owner: "05" }; readonly maxAvatarBytes: { readonly default: number; readonly floor: number; readonly owner: "05" }; readonly maxBotsPerAccount: { readonly default: 10; readonly floor: 1; readonly owner: "05" }; readonly maxBotTokens: { readonly default: 10; readonly floor: 2; readonly owner: "05" }; readonly maxPushRegistrationsPerDevice: { readonly default: 4; readonly floor: 4; readonly owner: "19" } }

Source: wire/transport.ts:772

LOCAL_PART_FAILURE_REASONS const

The LocalPartFailureReason values defined by 01 §3.9, in table order.

const LOCAL_PART_FAILURE_REASONS: readonly ["empty", "too_long", "too_short", "disallowed_code_point", "restricted_code_point", "unassigned", "leading_mark", "no_letter", "too_many_marks", "repeated_mark", "confusable_mark", "mixed_script", "mixed_digits", "bidi_rule", "unstable", "contains_at", "invalid_utf8"]

Source: wire/addressing.ts:123

LOOPBACK_CLIENT_ID const

The reserved client ID of native apps using loopback redirects (05 §5.1).

const LOOPBACK_CLIENT_ID: "urn:sloppyv:client:loopback" = 'urn:sloppyv:client:loopback'

Source: wire/accounts.ts:67

MANDATORY_FEATURES const

The features every server must list (02 §7.2, 03 §12.2).

const MANDATORY_FEATURES: readonly ["voice-dc/1", "video-dc/1"]

Source: discovery/metadata.ts:33

MAX_CREDENTIAL_LENGTH const

Maximum credential length (credentials = 1*4096token-char, 03 §3.1).

const MAX_CREDENTIAL_LENGTH: 4096 = 4096

Source: core/auth.ts:48

MAX_DATA_CHANNEL_MESSAGE_BYTES const

Every data-channel message is at most 16 KiB; both sides advertise a=max-message-size ≥ 65,536 (15 §6.3).

const MAX_DATA_CHANNEL_MESSAGE_BYTES: number

Source: wire/calls.ts:745

MAX_DIAGNOSTIC_SAMPLES const

At most 30 samples are kept and uploaded (15 §14.1).

const MAX_DIAGNOSTIC_SAMPLES: 30 = 30

Source: wire/calls.ts:310

MAX_DIAGNOSTICS_BYTES const

Maximum diagnostics request body: 64 KiB (15 §14.3).

const MAX_DIAGNOSTICS_BYTES: number

Source: wire/calls.ts:307

MAX_EVENTS_PER_BATCH const

Maximum events per batch; fixed, not advertised (06 §9.1, §17.3).

const MAX_EVENTS_PER_BATCH: 100 = 100

Source: wire/federation.ts:397

MAX_FEATURE_NAME_LENGTH const

Maximum length of a feature name, and maximum entries in a feature list (03 §12.2 rule 1).

const MAX_FEATURE_NAME_LENGTH: 64 = 64

Source: wire/transport.ts:717

MAX_FEATURES const

Maximum number of entries in a feature list (03 §12.2 rule 1, §5.4).

const MAX_FEATURES: 64 = 64

Source: wire/transport.ts:719

MAX_FEDERATION_EVENT_BYTES_DEFAULT const

Default and floor of maxFederationEventBytes (06 §9.2, §17.3).

const MAX_FEDERATION_EVENT_BYTES_DEFAULT: 131072 = 131072

Source: wire/federation.ts:400

MAX_PID const

The largest participant index (00 §7.6, 15 §2.5.2).

const MAX_PID: 65535 = 65535

Source: wire/calls.ts:319

MAX_REDIRECTS const

Maximum redirects followed for one attempt (03 §2.3 item 2).

const MAX_REDIRECTS: 5 = 5

Source: core/http.ts:414

MAX_SDP_BYTES const

Maximum SDP size of SFU offers and answers: 16 KiB (15 §8.2).

const MAX_SDP_BYTES: number

Source: wire/calls.ts:304

MAX_SECURE_LEAVES_CEILING const

The upper bound on maxSecureLeaves (00 §7.12, 13).

const MAX_SECURE_LEAVES_CEILING: 65536 = 65_536

Source: wire/transport.ts:813

MAX_TURN_ICE_SERVERS const

Maximum number of TURN server entries in a relay ICE-servers payload (15 §6.10.2).

const MAX_TURN_ICE_SERVERS: 4 = 4

Source: wire/calls.ts:322

MAX_TURN_ICE_URLS const

Maximum number of URLs per TURN server entry (15 §6.10.2).

const MAX_TURN_ICE_URLS: 4 = 4

Source: wire/calls.ts:325

MEDIA_ATTESTATION_MAX_OCTETS const

Largest serialized media.attestation message; receivers drop larger ones (18 §9.5).

const MEDIA_ATTESTATION_MAX_OCTETS: 3600 = 3600

Source: wire/media.ts:314

MEDIA_ATTESTATION_REPORT_KIND const

The diagnostics report kind that carries MediaAttestationReportData (18 §10.3, 15 §14.4).

const MEDIA_ATTESTATION_REPORT_KIND: "media_attestation" = 'media_attestation'

Source: wire/media.ts:562

MEDIA_ATTESTATION_TYPE const

The control-channel message type of a MediaAttestation (18 §9.5, §12.1).

const MEDIA_ATTESTATION_TYPE: "media.attestation" = 'media.attestation'

Source: wire/media.ts:276

MEDIA_ERRORS const

The media.* codes with their registry entries (18 §10.1). Each names a local condition in the media engine; no HTTP endpoint returns one. No media.* code defines data. Clients never show these codes, or text derived from them, as a security warning (D-055).

const MEDIA_ERRORS: { readonly media.keys_unavailable: { readonly status: 409; readonly retryable: true; readonly userAction: "wait"; readonly title: "Media keys aren't ready yet" }; readonly media.key_exhausted: { readonly status: 409; readonly retryable: true; readonly userAction: "wait"; readonly title: "Media key usage limit reached" }; readonly media.decrypt_failed: { readonly status: 400; readonly retryable: false; readonly userAction: "none"; readonly title: "A media frame didn't decrypt" }; readonly media.unknown_epoch: { readonly status: 400; readonly retryable: false; readonly userAction: "none"; readonly title: "A media frame's epoch wasn't installed in time" }; readonly media.replay: { readonly status: 400; readonly retryable: false; readonly userAction: "none"; readonly title: "A media frame failed the replay check" }; readonly media.kid_mismatch: { readonly status: 400; readonly retryable: false; readonly userAction: "none"; readonly title: "A KID doesn't match its transport or sender" }; readonly media.malformed_frame: { readonly status: 400; readonly retryable: false; readonly userAction: "none"; readonly title: "Malformed media frame" }; readonly media.stream_limit: { readonly status: 400; readonly retryable: false; readonly userAction: "none"; readonly title: "Too many media streams for one source" }; readonly media.attestation_invalid: { readonly status: 400; readonly retryable: false; readonly userAction: "none"; readonly title: "Invalid MediaAttestation" }; readonly media.attestation_mismatch: { readonly status: 400; readonly retryable: false; readonly userAction: "none"; readonly title: "MediaAttestation mismatch" }; readonly media.unattested: { readonly status: 400; readonly retryable: false; readonly userAction: "none"; readonly title: "Media frames left unattested" }; readonly media.attestation_unexpected: { readonly status: 400; readonly retryable: false; readonly userAction: "none"; readonly title: "MediaAttestation in an insecure call" } }

Source: wire/media.ts:325

MEDIA_FEEDBACK_KINDS const

The d.kind values 16 and 17 define for call.media_feedback (16 §4.7, 17 §7.1).

const MEDIA_FEEDBACK_KINDS: readonly ["audio_loss", "keyframe_request", "video_pref", "video_report", "video_viewer_state", "video_audience", "video_upload_pressure"]

Source: wire/media.ts:258

MEDIA_PROFILE_IDS const

The media profile names negotiated as features (00 §7.8; 16 §4, 17 §6, 17 §12).

const MEDIA_PROFILE_IDS: { readonly voiceDc: "voice-dc/1"; readonly videoDc: "video-dc/1"; readonly sfuRtp: "sfu-rtp/1" }

Source: wire/media.ts:55

MEDIA_PROFILES const

The three media profiles of v1 (15 §2.5.1).

const MEDIA_PROFILES: readonly ["voice-dc/1", "video-dc/1", "sfu-rtp/1"]

Source: wire/calls.ts:34

MEDIA_SOURCE_IDS const

The sourceId registry (18 §4.2): 0 microphone, 1 screen video, 2 screen or application sound, 3 webcam. 4–15 are reserved; senders never use them and receivers treat them as invalid.

const MEDIA_SOURCE_IDS: { readonly microphone: 0; readonly screen: 1; readonly screenAudio: 2; readonly webcam: 3 }

Source: wire/media.ts:31

MEMBER_ERRORS const

The member.* codes (09 §15.2).

const MEMBER_ERRORS: { readonly member.not_member: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly member.pending: { readonly status: 403; readonly retryable: true; readonly userAction: "wait" }; readonly member.not_found: { readonly status: 404; readonly retryable: false; readonly userAction: "none" }; readonly member.not_pending: { readonly status: 409; readonly retryable: false; readonly userAction: "none" } }

Source: wire/communities.ts:943

MESSAGE_KIND_PRIORITY const

The message kinds, in priority order mention > reply > mention_all > dm_message (19 §4.1, §4.5).

const MESSAGE_KIND_PRIORITY: readonly ["mention", "reply", "mention_all", "dm_message"]

Source: wire/notifications.ts:67

MESSAGING_CONSTANTS const

The fixed protocol constants of 11 §2.2. They aren't advertised and servers MUST NOT change them. Durations are in milliseconds (…Ms).

const MESSAGING_CONSTANTS: { readonly MAX_TEXT_CHARS: 4000; readonly MAX_MENTIONS: 50; readonly MAX_ATTACHMENTS: 10; readonly MAX_FILENAME_BYTES: 255; readonly MAX_REACTION_KEY_BYTES: 64; readonly MAX_REACTIONS_PER_USER: 20; readonly MAX_REACTION_KEYS: 20; readonly INLINE_REACTION_ENTRIES: 100; readonly PAD_BLOCK: 256; readonly TYPING_TTL_MS: 8000; readonly TYPING_DISPLAY_TTL_MS: 10000; readonly TYPING_REFRESH_MS: 6000; readonly TYPING_MIN_INTERVAL_MS: 3000; readonly IDLE_AFTER_MS: number; readonly OFFLINE_GRACE_MS: 30000; readonly MAX_STATUS_CHARS: 128; readonly PRESENCE_SNAPSHOT_MAX: 1000; readonly UPLOAD_PENDING_TTL_MS: number; readonly UPLOAD_URL_TTL_MS: number; readonly DOWNLOAD_URL_TTL_MS: number; readonly THUMB_MAX_PX: 512; readonly THUMB_MAX_BYTES: 262144; readonly TOMBSTONE_MIN_MS: number; readonly MID_MEMORY_MIN_MS: number; readonly CHANGES_HORIZON_MIN_MS: number; readonly RETENTION_PURGE_MAX_MS: number; readonly OUTBOX_MAX_AGE_MS: number; readonly MAX_WEBHOOKS_PER_CHANNEL: 15; readonly MAX_ATTACHMENT_IDS: 20; readonly UNREAD_CAP: 1000; readonly MAX_PENDING_UPLOADS: 50; readonly MAX_WEBHOOK_NAME_CHARS: 80; readonly READ_ADVANCE_MIN_INTERVAL_MS: 2000; readonly CLEAR_AT_MAX_MS: number; readonly OUTBOX_SENT_LINGER_MS: 60000; readonly OUTBOX_REQUEST_TIMEOUT_MS: 30000; readonly MAX_PARALLEL_RESYNCS: 4; readonly AUTO_DOWNLOAD_MAX_BYTES: number }

Source: wire/messaging.ts:24

MESSAGING_ERRORS const

The error codes owned by 11, with their registry entries (11 §17.1).

const MESSAGING_ERRORS: { readonly message.invalid_content: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly message.too_large: { readonly status: 413; readonly retryable: false; readonly userAction: "none" }; readonly message.too_many_mentions: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly message.target_not_found: { readonly status: 404; readonly retryable: false; readonly userAction: "none" }; readonly message.target_deleted: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly message.not_author: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly message.not_editable: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly message.changes_expired: { readonly status: 410; readonly retryable: false; readonly userAction: "none" }; readonly message.webhook_limit: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly reaction.invalid_key: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly reaction.already_exists: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly reaction.too_many: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly attachment.too_large: { readonly status: 413; readonly retryable: false; readonly userAction: "none" }; readonly attachment.not_found: { readonly status: 404; readonly retryable: false; readonly userAction: "none" }; readonly attachment.not_uploaded: { readonly status: 409; readonly retryable: true; readonly userAction: "retry" }; readonly attachment.already_bound: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly attachment.expired: { readonly status: 410; readonly retryable: false; readonly userAction: "retry" }; readonly attachment.size_mismatch: { readonly status: 422; readonly retryable: true; readonly userAction: "retry" }; readonly attachment.hash_mismatch: { readonly status: 422; readonly retryable: true; readonly userAction: "retry" }; readonly attachment.quota_exceeded: { readonly status: 429; readonly retryable: true; readonly userAction: "wait" }; readonly attachment.blocked: { readonly status: 403; readonly retryable: false; readonly userAction: "contact_admin" } }

Source: wire/messaging.ts:879

MESSAGING_EVENT_TYPES const

The event types of 11 (11 §8.1, §18).

const MESSAGING_EVENT_TYPES: readonly ["message.created", "message.edited", "message.deleted", "message.purged", "reaction.added", "reaction.removed", "read.updated", "typing.started", "typing.stopped", "presence.updated", "presence.snapshot"]

Source: wire/messaging.ts:932

MESSAGING_VAULT_SETTINGS const

The AccountVault settings 11 owns (11 §4.4, §10.3, §18; 08 §8.6.4), with their names and defaults. Both are booleans that default to true. For an insecure account, which has no AccountVault, typing_indicators is stored on the device (11 §10.3 rule 4).

const MESSAGING_VAULT_SETTINGS: { readonly mentionHints: { readonly name: "mention_hints"; readonly default: true }; readonly typingIndicators: { readonly name: "typing_indicators"; readonly default: true } }

Source: wire/messaging.ts:121

MIN_MAX_MESSAGE_SIZE const

Minimum advertised a=max-message-size (15 §6.3).

const MIN_MAX_MESSAGE_SIZE: 65536 = 65_536

Source: wire/calls.ts:748

MLS_CONTENT_TYPES const

RFC 9420 content types.

const MLS_CONTENT_TYPES: { readonly application: 1; readonly proposal: 2; readonly commit: 3 }

Source: mls/provider.ts:769

MLS_ERRORS const

The mls.* error codes with their registry entries (13 §18).

const MLS_ERRORS: { readonly mls.epoch_conflict: { readonly status: 409; readonly retryable: true; readonly userAction: "none" }; readonly mls.commit_required: { readonly status: 409; readonly retryable: true; readonly userAction: "none" }; readonly mls.proposals_changed: { readonly status: 409; readonly retryable: true; readonly userAction: "none" }; readonly mls.commit_busy: { readonly status: 425; readonly retryable: true; readonly userAction: "wait" }; readonly mls.credential_rejected: { readonly status: 403; readonly retryable: "varies"; readonly userAction: "none" }; readonly mls.verification_failed: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly mls.policy_violation: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly mls.not_member: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly mls.group_not_found: { readonly status: 404; readonly retryable: true; readonly userAction: "none" }; readonly mls.group_exists: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly mls.group_id_mismatch: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly mls.generation_retired: { readonly status: 410; readonly retryable: false; readonly userAction: "none" }; readonly mls.group_full: { readonly status: 409; readonly retryable: "varies"; readonly userAction: "none" }; readonly mls.log_truncated: { readonly status: 410; readonly retryable: false; readonly userAction: "none" }; readonly mls.fork_detected: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly mls.welcome_not_found: { readonly status: 404; readonly retryable: false; readonly userAction: "none" }; readonly mls.keypackage_invalid: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly mls.keypackage_limit: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly mls.context_not_secure: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly mls.bootstrap_not_allowed: { readonly status: 403; readonly retryable: false; readonly userAction: "none" } }

Source: wire/mls.ts:763

MLS_EVENT_CLASSES const

Event class of each mls.* event (13 §8.1).

const MLS_EVENT_CLASSES: { readonly mls.group_created: "durable"; readonly mls.handshake: "durable"; readonly mls.proposal: "durable"; readonly mls.group_retired: "durable"; readonly mls.commit_needed: "ephemeral"; readonly mls.welcome: "ephemeral"; readonly mls.resync_required: "ephemeral"; readonly mls.keypackages_low: "ephemeral" }

Source: wire/mls.ts:747

MLS_EXPORTER_USES const

Exporter labels used with an sv1 group (13 §3.10; the 04 registry is authoritative).

const MLS_EXPORTER_USES: { readonly history: "sv1 history"; readonly sframe: "SFrame 1.0 Base Key" }

Source: wire/mls.ts:51

MLS_LIMITS const

Limits of 13 §17.1. maxSecureLeaves and maxMlsUploadBytes are advertised in ServerMetadata limits.

const MLS_LIMITS: { readonly maxSecureLeaves: { readonly default: 1000; readonly floor: 100; readonly max: 65536 }; readonly maxMlsUploadBytes: { readonly default: number; readonly floor: number }; readonly keyPackagesStoredPerDevice: 100; readonly keyPackagesPerUpload: 100; readonly keyPackageLifetimeMaxSec: number; readonly keyPackageNotBeforeSkewSec: 3600; readonly keyPackageLowWatermark: 10; readonly keyPackageTarget: 50; readonly claimTargetsMax: 64; readonly svParticipantsMin: 1; readonly svParticipantsMax: 1024; readonly svParticipantAddressMinBytes: 3; readonly svParticipantAddressMaxBytes: 320; readonly groupIdMaxBytes: 320; readonly generationMax: 2147483647; readonly handshakesLimit: { readonly min: 1; readonly max: 100; readonly default: 50 }; readonly reportsPerHour: 10; readonly reportReasonMaxChars: 64; readonly reportDetailMaxChars: 1024 }

Source: wire/mls.ts:63

MLS_PROPOSAL_TYPES const

RFC 9420 proposal types.

const MLS_PROPOSAL_TYPES: { readonly add: 1; readonly update: 2; readonly remove: 3; readonly psk: 4; readonly reinit: 5; readonly externalInit: 6; readonly groupContextExtensions: 7 }

Source: mls/provider.ts:758

MLS_SENDER_TYPES const

RFC 9420 sender types.

const MLS_SENDER_TYPES: { readonly member: 1; readonly external: 2; readonly newMemberProposal: 3; readonly newMemberCommit: 4 }

Source: mls/provider.ts:755

MLS_TIMERS const

Client-relevant timers of 13 §17.2, in milliseconds.

const MLS_TIMERS: { readonly commitDeadlineMs: 3000; readonly conflictJitterMs: 500; readonly conflictBackoffStartMs: 1000; readonly conflictBackoffMaxMs: 30000; readonly conflictBackoffAfter: 5; readonly epochAckWithinMs: 5000; readonly resyncDelayMaxMs: 2000; readonly resyncMinIntervalMs: 10000; readonly resyncMaxBackoffMs: 600000; readonly groupInfoPollStartMs: 60000; readonly groupInfoPollMaxMs: 3600000; readonly removalPendingStartMs: 2000; readonly removalPendingMaxMs: 60000; readonly groupNotFoundStartMs: 2000; readonly groupNotFoundMaxMs: 60000; readonly readdRecheckStartMs: 30000; readonly readdRecheckMaxMs: 600000; readonly stateUnavailableRetryMs: 30000; readonly selfUpdateIntervalMs: number; readonly selfUpdateJitterMs: 60000; readonly firstUpdateAfterWelcomeMs: number; readonly backgroundRefreshMs: number; readonly forkSettlementMs: 30000; readonly keyPackageCheckIntervalMs: number; readonly lastResortReplaceAfterUseMs: number; readonly lastResortMaxAgeMs: number; readonly unknownStateRefetchMs: 60000 }

Source: wire/mls.ts:100

MLS_VARINT_MAX const

Largest length a variable-length integer can carry (2^30 − 1, RFC 9420 §2.1.2).

const MLS_VARINT_MAX: 1073741823 = 0x3fffffff

Source: mls/provider.ts:38

MLS_WIRE_VALUES const

The fixed MLS wire values of the profile (13 §2.3).

const MLS_WIRE_VALUES: { readonly protocolVersion: 1; readonly cipherSuite: 1; readonly credentialBasic: 1; readonly credentialSvDevice: 62880; readonly extensionRatchetTree: 2; readonly extensionRequiredCapabilities: 3; readonly extensionExternalPub: 4; readonly extensionExternalSenders: 5; readonly extensionSvParticipants: 62881; readonly wireFormatPublicMessage: 1; readonly wireFormatPrivateMessage: 2; readonly wireFormatWelcome: 3; readonly wireFormatGroupInfo: 4; readonly wireFormatKeyPackage: 5 }

Source: wire/mls.ts:19

MODERATION_ERRORS const

The role.*, permission.*, moderation.* and report.* error codes with their registry entries (10 §14).

const MODERATION_ERRORS: { readonly role.not_found: { readonly status: 404; readonly retryable: false; readonly userAction: "none" }; readonly role.hierarchy: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly role.system_role: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly role.last_admin: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly role.limit_reached: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly role.version_conflict: { readonly status: 409; readonly retryable: true; readonly userAction: "retry" }; readonly role.name_taken: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly role.name_invalid: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly permission.unknown: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly permission.not_held: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly permission.not_overwritable: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly permission.overwrite_limit: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly moderation.banned: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly moderation.timed_out: { readonly status: 403; readonly retryable: true; readonly userAction: "wait" }; readonly moderation.new_member_restricted: { readonly status: 403; readonly retryable: true; readonly userAction: "wait" }; readonly moderation.slow_mode: { readonly status: 429; readonly retryable: true; readonly userAction: "wait" }; readonly moderation.target_protected: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly moderation.self_target: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly moderation.not_member: { readonly status: 404; readonly retryable: false; readonly userAction: "none" }; readonly moderation.invalid_duration: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly moderation.invalid_target: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly moderation.ban_not_found: { readonly status: 404; readonly retryable: false; readonly userAction: "none" }; readonly moderation.version_conflict: { readonly status: 409; readonly retryable: true; readonly userAction: "retry" }; readonly report.not_found: { readonly status: 404; readonly retryable: false; readonly userAction: "none" }; readonly report.duplicate: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly report.invalid_items: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly report.too_many_items: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly report.unverifiable: { readonly status: 422; readonly retryable: false; readonly userAction: "none" }; readonly report.status_conflict: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly report.version_conflict: { readonly status: 409; readonly retryable: true; readonly userAction: "retry" }; readonly report.not_forwardable: { readonly status: 403; readonly retryable: false; readonly userAction: "none" } }

Source: wire/moderation.ts:974

MODERATION_EVENT_STREAMS const

Event classes and streams of 10 §13.2, for routing and tests. channel means the channel's own ch:… stream. role.member_removed is also copied to the former holder's me stream when they no longer subscribe to community.

const MODERATION_EVENT_STREAMS: { readonly role.created: { readonly class: "durable"; readonly stream: "community" }; readonly role.updated: { readonly class: "durable"; readonly stream: "community" }; readonly role.deleted: { readonly class: "durable"; readonly stream: "community" }; readonly role.reordered: { readonly class: "durable"; readonly stream: "community" }; readonly role.member_added: { readonly class: "durable"; readonly stream: "community" }; readonly role.member_removed: { readonly class: "durable"; readonly stream: "community" }; readonly permission.overwrite_set: { readonly class: "durable"; readonly stream: "channel" }; readonly permission.overwrite_removed: { readonly class: "durable"; readonly stream: "channel" }; readonly permission.changed: { readonly class: "ephemeral"; readonly stream: "me" }; readonly moderation.applied: { readonly class: "durable"; readonly stream: "me" }; readonly moderation.lifted: { readonly class: "durable"; readonly stream: "me" }; readonly moderation.server_mute_changed: { readonly class: "durable"; readonly stream: "community" }; readonly moderation.policy_updated: { readonly class: "durable"; readonly stream: "community" }; readonly moderation.logged: { readonly class: "durable"; readonly stream: "me" }; readonly report.created: { readonly class: "durable"; readonly stream: "me" }; readonly report.updated: { readonly class: "durable"; readonly stream: "me" }; readonly report.resolved: { readonly class: "durable"; readonly stream: "me" } }

Source: wire/moderation.ts:949

MODERATION_FIXED const

Fixed, non-configurable values (10 §15).

const MODERATION_FIXED: { readonly maxContextItemsPerSide: 10; readonly maxReasonLength: 512; readonly maxNoteLength: 1000; readonly maxResolutionNoteLength: 2000; readonly minMuteOrTimeoutMs: 60000; readonly maxMuteOrTimeoutMs: 2419200000; readonly minBanDurationMs: 3600000; readonly minDeleteWindowMs: 60000; readonly maxDeleteWindowMs: 604800000; readonly maxMidsPerDeletion: 100; readonly maxAuthorDeletionsPerRequest: 10000; readonly maxRoleNameLength: 40; readonly maxRolesPageLimit: 250; readonly maxAuditLogPageLimit: 100; readonly minSlowModeMs: 1000; readonly maxSlowModeMs: 21600000; readonly maxNewMemberDurationMs: 604800000; readonly maxNewDmsPerDay: 100; readonly minMentionLimit: 1; readonly maxMentionLimit: 50; readonly minFloodTimeoutMs: 60000; readonly maxFloodTimeoutMs: 86400000; readonly evidenceRetentionDays: 90; readonly reportExpiryDays: 365; readonly reopenWindowDays: 30; readonly reportAfterLossDays: 30; readonly forwardedEvidenceDays: 30; readonly maxForwardedReportsPerOriginPerDay: 100; readonly auditRetentionFloorDays: 90; readonly auditRetentionDefaultDays: 365; readonly expiryRecordedWithinMs: 60000 }

Source: wire/moderation.ts:1087

MODERATION_LIMITS const

ServerMetadata limits owned by 10, with defaults and floors (10 §4.5, §15).

const MODERATION_LIMITS: { readonly maxRoles: { readonly default: 100; readonly floor: 25 }; readonly maxRolesPerMember: { readonly default: 25; readonly floor: 10 }; readonly maxOverwritesPerChannel: { readonly default: 100; readonly floor: 25 }; readonly maxReportItems: { readonly default: 25; readonly floor: 10 } }

Source: wire/moderation.ts:1079

MODERATION_RATE_LIMITS const

Default rate limits this document adds (10 §12.1). Servers MAY change them; over a limit they answer 429 core.rate_limited with Retry-After, and clients queue and retry quietly, never before Retry-After has passed.

const MODERATION_RATE_LIMITS: { readonly communityPostsPerMinute: 120; readonly invitesPerHour: 10; readonly joinsPer10Minutes: 10; readonly reportsPerHour: 20; readonly reportsPerDay: 100; readonly moderationRequestsPerMinute: 60 }

Source: wire/moderation.ts:1151

NO_PUBLIC_SUFFIX_LIST const

The conservative list used when none is configured: every host is treated as a public suffix, so registrableDomain() is always undefined and same-site evidence is recorded only when the base-URL host equals the queried domain. This never records evidence stronger than the real list would, but it records dns-only where the real list gives same-site (for example 02 §20.3 E1). Configure a real list for spec-conformant evidence.

const NO_PUBLIC_SUFFIX_LIST: PublicSuffixList

Source: discovery/evidence.ts:32

NOTIFICATION_ERRORS const

notification.* error codes (19 §17.3).

const NOTIFICATION_ERRORS: { readonly notification.level_unsupported: { readonly status: 400; readonly retryable: false; readonly userAction: "none" } }

Source: wire/notifications.ts:733

NOTIFICATION_KINDS const

The notification kinds of 19 §5.3.

const NOTIFICATION_KINDS: { readonly mention: { readonly origin: "hosting"; readonly inNotifyEvent: true; readonly createsRecord: true; readonly pushType: "alert"; readonly coalesced: true }; readonly reply: { readonly origin: "hosting"; readonly inNotifyEvent: true; readonly createsRecord: true; readonly pushType: "alert"; readonly coalesced: true }; readonly mention_all: { readonly origin: "hosting"; readonly inNotifyEvent: true; readonly createsRecord: true; readonly pushType: "alert"; readonly coalesced: true }; readonly dm_message: { readonly origin: "hosting_or_home"; readonly inNotifyEvent: true; readonly createsRecord: true; readonly pushType: "alert"; readonly coalesced: true }; readonly call_ring: { readonly origin: "hosting"; readonly inNotifyEvent: true; readonly createsRecord: true; readonly pushType: "call"; readonly coalesced: false }; readonly call_ring_ended: { readonly origin: "hosting"; readonly inNotifyEvent: true; readonly createsRecord: false; readonly pushType: null; readonly coalesced: false }; readonly withdrawn: { readonly origin: "hosting"; readonly inNotifyEvent: true; readonly createsRecord: false; readonly pushType: "background"; readonly coalesced: false }; readonly call_missed: { readonly origin: "home"; readonly inNotifyEvent: false; readonly createsRecord: true; readonly pushType: "alert"; readonly coalesced: false }; readonly dm_request: { readonly origin: "home"; readonly inNotifyEvent: false; readonly createsRecord: true; readonly pushType: "alert"; readonly coalesced: false }; readonly pairing_request: { readonly origin: "home"; readonly inNotifyEvent: false; readonly createsRecord: true; readonly pushType: "alert"; readonly coalesced: false }; readonly account_alert: { readonly origin: "home"; readonly inNotifyEvent: false; readonly createsRecord: true; readonly pushType: "alert"; readonly coalesced: false }; readonly test: { readonly origin: "home"; readonly inNotifyEvent: false; readonly createsRecord: true; readonly pushType: "alert"; readonly coalesced: false } }

Source: wire/notifications.ts:51

NOTIFICATION_LIMITS const

Limits and timers of 19 §18.

const NOTIFICATION_LIMITS: { readonly windowMs: 30000; readonly windowLatenessMs: 2000; readonly rateCapEvents: 20; readonly rateCapWindowMs: 60000; readonly rateCapMaxDelayMs: 60000; readonly maxItems: 20; readonly maxNotifyEventBytes: number; readonly previewMaxScalars: 140; readonly nameMaxScalars: 100; readonly nameShortenedScalars: 64; readonly withdrawalMemoryMs: number; readonly withdrawalBatchMs: 5000; readonly maxWithdrawnMids: 50; readonly ticketMaxChars: 64; readonly ticketLifetimeMs: number; readonly ticketUsesPerMinute: 30; readonly ringEndedExpiryMs: 60000; readonly ringTombstoneMs: 120000; readonly maxRecords: 1000; readonly unreadRetentionMs: number; readonly otherRetentionMs: number; readonly maxReadIds: 100; readonly listLimitMax: 100; readonly listLimitDefault: 50; readonly badgeCap: 9999; readonly maxCommunitySettings: 1000; readonly maxContextSettings: 10000; readonly muteMaxAheadMs: number; readonly maxPushRegistrationsPerDevice: 4; readonly fetchTokenMaxChars: 64; readonly fetchTokenLifetimeMs: number; readonly reregisterIntervalMs: number; readonly testPushesPerHour: 5; readonly testPushWaitMs: 30000; readonly pushPayloadBytes: 93; readonly pushKeyMaxChars: 1024; readonly alertTtlMs: 86400000; readonly backgroundTtlMs: 3600000; readonly callMinTtlMs: 1000; readonly maxTtlMs: 86400000; readonly gatewayMaxPushes: 100; readonly gatewayMaxBodyBytes: number; readonly gatewayMaxPayloadBytes: 256; readonly pushJwtMaxLifetimeSec: 60; readonly pushJwtMaxBytes: 4096; readonly backgroundPushIntervalMs: 30000; readonly readSyncIntervalMs: 2000; readonly iosNseBudgetMs: 20000; readonly androidBudgetMs: 8000; readonly webBudgetMs: 10000; readonly deviceRequestTimeoutMs: 5000; readonly handledIdsMemoryMs: number; readonly maxExtraRecordFetches: 10; readonly reconcileMaxRecords: 1000; readonly testRecordAutoReadMs: 60000; readonly registrationRejectLimit: 3; readonly registrationFailingMaxMs: number; readonly collapseSecretBytes: 32; readonly collapseKeyChars: 22; readonly gatewayRetiredKeyMinMs: number; readonly gatewayPushesPerMinuteFloor: 60; readonly gatewayPushBurstFloor: 20; readonly gatewayRegistrationsPerMinuteFloor: 10; readonly gatewayAppIdMaxChars: 255; readonly gatewayTokenMaxChars: 4096; readonly gatewayMaxConcurrent: 4; readonly gatewayBatchWaitMs: 50; readonly pushRetryMaxDelayMs: 300000; readonly gatewayConnectTimeoutMs: 10000; readonly gatewayExchangeTimeoutMs: 30000; readonly homeBlockedPauseMs: number; readonly webPushEndpointMaxOctets: 2048; readonly webPushBodyBytes: 196; readonly webPushRecordSize: 4096; readonly vapidJwtMaxAheadMs: number; readonly oldVapidKeyMaxMs: number; readonly pushKitCallerDetailsMs: 10000; readonly pushKitFallbackRingMs: 45000 }

Source: wire/notifications.ts:786

NOTIFY_ERRORS const

notify.* error codes (19 §17.1).

const NOTIFY_ERRORS: { readonly notify.ticket_invalid: { readonly status: 401; readonly retryable: false; readonly userAction: "none" }; readonly notify.access_ended: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly notify.secure_preview: { readonly status: 400; readonly retryable: false; readonly userAction: "none" } }

Source: wire/notifications.ts:705

OAUTH_ERROR_MAP const

The RFC 6749 error that 05 §7.8 maps each code to at /par and /token (token) and in a redirect from /authorize, /callback or /consent (redirect). null means the code isn't returned there.

const OAUTH_ERROR_MAP: { readonly core.invalid_request: { readonly token: "invalid_request"; readonly redirect: "invalid_request" }; readonly auth.invalid_client: { readonly token: "invalid_client"; readonly redirect: null }; readonly auth.invalid_redirect_uri: { readonly token: "invalid_request"; readonly redirect: null }; readonly auth.invalid_grant: { readonly token: "invalid_grant"; readonly redirect: null }; readonly auth.refresh_reused: { readonly token: "invalid_grant"; readonly redirect: null }; readonly auth.session_revoked: { readonly token: "invalid_grant"; readonly redirect: null }; readonly auth.unsupported_grant_type: { readonly token: "unsupported_grant_type"; readonly redirect: null }; readonly auth.registration_closed: { readonly token: "invalid_grant"; readonly redirect: "access_denied" }; readonly account.suspended: { readonly token: "invalid_grant"; readonly redirect: "access_denied" }; readonly auth.provider_in_use: { readonly token: "invalid_grant"; readonly redirect: "access_denied" }; readonly auth.too_many_devices: { readonly token: "invalid_grant"; readonly redirect: "access_denied" }; readonly auth.access_denied: { readonly token: null; readonly redirect: "access_denied" }; readonly auth.reauth_mismatch: { readonly token: null; readonly redirect: "access_denied" }; readonly auth.reauth_required: { readonly token: null; readonly redirect: "access_denied" }; readonly auth.provider_unknown: { readonly token: "invalid_request"; readonly redirect: "invalid_request" }; readonly auth.provider_error: { readonly token: null; readonly redirect: "temporarily_unavailable" }; readonly core.rate_limited: { readonly token: "invalid_request"; readonly redirect: "temporarily_unavailable" }; readonly core.internal: { readonly token: "server_error"; readonly redirect: "server_error" }; readonly core.unavailable: { readonly token: "server_error"; readonly redirect: "server_error" } }

Source: wire/accounts.ts:836

PAIRING_QR_PREFIX const

The ASCII prefix of a pairing QR code (08 §6.3.1).

const PAIRING_QR_PREFIX: "SVPAIR1:" = 'SVPAIR1:'

Source: api/pairing.ts:51

PERMISSION_NAME_PATTERN const

permission-name = %x61-7A *31( %x61-7A / DIGIT / "_" ) (10 §3.3).

const PERMISSION_NAME_PATTERN: RegExp

Source: permissions.ts:97

PERMISSION_REGISTRY const

The complete permission registry of protocol version 1, in registry order (10 §3.1). Servers emit names in this order; the SDK sorts its outputs the same way (10 §6.4).

const PERMISSION_REGISTRY: readonly [{ readonly name: "view_channel"; readonly scope: "channel"; readonly inEveryoneByDefault: true }, { readonly name: "send_messages"; readonly scope: "channel"; readonly inEveryoneByDefault: true }, { readonly name: "add_reactions"; readonly scope: "channel"; readonly inEveryoneByDefault: true }, { readonly name: "attach_files"; readonly scope: "channel"; readonly inEveryoneByDefault: true }, { readonly name: "mention_everyone"; readonly scope: "channel"; readonly inEveryoneByDefault: false }, { readonly name: "speak_and_share"; readonly scope: "channel"; readonly inEveryoneByDefault: true }, { readonly name: "mute_members"; readonly scope: "channel"; readonly inEveryoneByDefault: false }, { readonly name: "manage_messages"; readonly scope: "channel"; readonly inEveryoneByDefault: false }, { readonly name: "create_invites"; readonly scope: "channel"; readonly inEveryoneByDefault: true }, { readonly name: "manage_channels"; readonly scope: "channel"; readonly inEveryoneByDefault: false }, { readonly name: "manage_roles"; readonly scope: "channel"; readonly inEveryoneByDefault: false }, { readonly name: "share_history"; readonly scope: "channel"; readonly inEveryoneByDefault: false }, { readonly name: "kick_members"; readonly scope: "community"; readonly inEveryoneByDefault: false }, { readonly name: "ban_members"; readonly scope: "community"; readonly inEveryoneByDefault: false }, { readonly name: "timeout_members"; readonly scope: "community"; readonly inEveryoneByDefault: false }, { readonly name: "manage_invites"; readonly scope: "community"; readonly inEveryoneByDefault: false }, { readonly name: "manage_community"; readonly scope: "community"; readonly inEveryoneByDefault: false }, { readonly name: "manage_bots"; readonly scope: "community"; readonly inEveryoneByDefault: false }, { readonly name: "manage_reports"; readonly scope: "community"; readonly inEveryoneByDefault: false }, { readonly name: "view_audit_log"; readonly scope: "community"; readonly inEveryoneByDefault: false }]

Source: permissions.ts:43

PERMISSIONS const

Every permission name in registry order: ALL of 10 §6.1.

const PERMISSIONS: readonly KnownPermission[]

Source: permissions.ts:67

PHRASE_ENTROPY_BYTES const

Bytes of phrase entropy E (08 §1.3).

const PHRASE_ENTROPY_BYTES: 10 = 10

Source: api/backup.ts:189

PHRASE_ID_BYTES const

Bytes of a phrase ID (08 §1.3).

const PHRASE_ID_BYTES: 16 = 16

Source: api/backup.ts:192

PHRASE_WORDS const

Words in a recovery phrase (08 §4.1).

const PHRASE_WORDS: 8 = 8

Source: api/backup.ts:195

PIN_CONFLICT_REASONS const

The suspension reasons in the priority order of 02 §10.2.

const PIN_CONFLICT_REASONS: readonly ["key_unrevoked", "secure_downgrade", "canonical_changed", "chain_fork", "chain_rollback", "base_url_changed", "keys_changed"]

Source: wire/discovery.ts:301

PLAN_VERSION_LABEL const

The hash domain-separation prefix of the plan version (09 §10.6, registry addition to 04).

const PLAN_VERSION_LABEL: "sv1 upgrade plan" = 'sv1 upgrade plan'

Source: wire/communities.ts:1134

PROBLEM_TYPE_PREFIX const

Prefix of every problem type: urn:sloppyv:error: + code (00 §7.1, 03 §10.1).

const PROBLEM_TYPE_PREFIX: "urn:sloppyv:error:" = 'urn:sloppyv:error:'

Source: wire/transport.ts:20

PROTOCOL_VERSION const

The protocol version this SDK implements, major.minor (03 §12.1). Sent as protocol in session.hello (03 §5.4) and compared with ServerMetadata versions and minClient (03 §12.1, §12.4). Protocol version 1 is sv1 (00 §7.1).

const PROTOCOL_VERSION: "1.0" = '1.0'

Source: version.ts:15

PROVIDER_ID_PATTERN const

provider-id = 1*32( %x61-7A / DIGIT / "-" / "_" ) (05 §4.1, 02 §7.3.2).

const PROVIDER_ID_PATTERN: RegExp

Source: wire/accounts.ts:64

PUSH_COLLAPSE_LABEL const

The HMAC label of collapse keys (19 §10.3, §19; 04 §8.4).

const PUSH_COLLAPSE_LABEL: "sv1 push collapse"

Source: api/push.ts:327

PUSH_ERRORS const

push.* error codes (19 §17.2). The gateway per-push codes appear only inside a 200 response's PushResult.error.

const PUSH_ERRORS: { readonly push.home_only: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly push.registration_invalid: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly push.gateway_not_allowed: { readonly status: 403; readonly retryable: false; readonly userAction: "contact_admin" }; readonly push.too_many_registrations: { readonly status: 409; readonly retryable: false; readonly userAction: "none" }; readonly push.device_not_eligible: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly push.unauthenticated: { readonly status: 401; readonly retryable: true; readonly userAction: "none" }; readonly push.home_blocked: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly push.key_invalid: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly push.home_mismatch: { readonly status: 403; readonly retryable: false; readonly userAction: "none" }; readonly push.type_unsupported: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly push.token_gone: { readonly status: 410; readonly retryable: false; readonly userAction: "none" }; readonly push.upstream_unavailable: { readonly status: 503; readonly retryable: true; readonly userAction: "wait" }; readonly push.app_unknown: { readonly status: 400; readonly retryable: false; readonly userAction: "none" }; readonly push.platform_unsupported: { readonly status: 400; readonly retryable: false; readonly userAction: "none" } }

Source: wire/notifications.ts:715

PUSH_JWT_TYP const

The JWS typ of the push gateway request token (19 §11.4).

const PUSH_JWT_TYP: "sv-push+jwt"

Source: wire/notifications.ts:620

PUSH_KEY_PATTERN const

A push key: 1–1,024 characters from ALPHA / DIGIT / "-" / "." / "_" / "~" (19 §9.1, §11.2).

const PUSH_KEY_PATTERN: RegExp

Source: api/push.ts:44

PUSH_PAYLOAD_LENGTH const

The serialized push payload is always this many octets (19 §10.1).

const PUSH_PAYLOAD_LENGTH: 93 = 93

Source: api/push.ts:281

PUSH_PAYLOAD_UUID_PATTERN const

The uuid of the push-payload ABNF: lowercase hex, hyphenated (19 §10.1).

const PUSH_PAYLOAD_UUID_PATTERN: RegExp

Source: api/push.ts:278

PUSH_TYPES const

The push types of 19 §10.3.

const PUSH_TYPES: readonly ["alert", "call", "background"]

Source: api/push.ts:41

RATE_LIMIT_DEFAULTS const

Rate-limit floors and recommended defaults (03 §15.3), as { requests, windowMs }.

const RATE_LIMIT_DEFAULTS: { readonly session: { readonly floor: { readonly requests: 120; readonly windowMs: 60000 }; readonly default: { readonly requests: 600; readonly windowMs: 60000 } }; readonly ipUnauthenticated: { readonly floor: { readonly requests: 60; readonly windowMs: 60000 }; readonly default: { readonly requests: 300; readonly windowMs: 60000 } }; readonly ipAll: { readonly floor: null; readonly default: { readonly requests: 3000; readonly windowMs: 60000 } }; readonly peer: { readonly floor: { readonly requests: 1200; readonly windowMs: 60000 }; readonly default: { readonly requests: 6000; readonly windowMs: 60000 } }; readonly socket: { readonly floor: { readonly requests: 20; readonly windowMs: 10000 }; readonly default: { readonly requests: 60; readonly windowMs: 10000 } }; readonly handshake: { readonly floor: { readonly requests: 10; readonly windowMs: 60000 }; readonly default: { readonly requests: 30; readonly windowMs: 60000 } } }

Source: wire/transport.ts:745

REACTIONS_PAGE_LIMIT const

Page size bounds of GET …/messages/{mid}/reactions: 1 to 100, default 50 (11 §7.3).

const REACTIONS_PAGE_LIMIT: { readonly min: 1; readonly max: 100; readonly default: 50 }

Source: wire/messaging.ts:107

READ_STATES_PAGE_LIMIT const

Page size bounds of GET /v1/me/read-states: 1 to 1,000, default 200 (11 §9.2).

const READ_STATES_PAGE_LIMIT: { readonly min: 1; readonly max: 1000; readonly default: 200 }

Source: wire/messaging.ts:104

RECOVERY_WORDS const

The BIP-39 English word list (english.txt, 2,048 words, SHA-256 2f5eed53a4727b4bf8880d8f3f199efc90e58503646d9ff8eff3a2ed3b24dbda), which 08 §4.1 uses as the recovery-phrase alphabet. Only the list is used; the phrase is not a BIP-39 mnemonic. Source: https://github.com/bitcoin/bips/blob/master/bip-0039/english.txt

const RECOVERY_WORDS: readonly string[]

Source: api/backup.ts:40

RECOVERY_WORDS_SHA256 const

SHA-256 of the word list file (english.txt, words joined by \n with a final newline) (08 §4.1).

const RECOVERY_WORDS_SHA256: "2f5eed53a4727b4bf8880d8f3f199efc90e58503646d9ff8eff3a2ed3b24dbda" = '2f5eed53a4727b4bf8880d8f3f199efc90e58503646d9ff8eff3a2ed3b24dbda'

Source: api/backup.ts:186

REJOIN_SCHEDULE_MS const

Auto-rejoin attempt offsets from t0 in ms before the every-30-s tail (15 §10.5).

const REJOIN_SCHEDULE_MS: readonly [0, 1000, 2000, 4000, 8000, 15000]

Source: wire/calls.ts:285

REJOIN_TAIL_INTERVAL_MS const

Interval of the auto-rejoin schedule's tail (15 §10.5).

const REJOIN_TAIL_INTERVAL_MS: 30000 = 30_000

Source: wire/calls.ts:288

REJOIN_TOKEN_PATTERN const

rejoin-token = 1*128( ALPHA / DIGIT / "-" / "_" ) (15 §10.2).

const REJOIN_TOKEN_PATTERN: RegExp

Source: wire/calls.ts:313

RELAY_FORWARDED_CONTROL_TYPES const

Control message types the relay forwards between participants (15 §6.5).

const RELAY_FORWARDED_CONTROL_TYPES: readonly ["call.media_feedback", "media.attestation"]

Source: wire/calls.ts:841

RELAY_ORIGINATED_FEEDBACK_KINDS const

The kinds only a relay originates (17 §7.1 item 3).

const RELAY_ORIGINATED_FEEDBACK_KINDS: readonly ["video_viewer_state", "video_audience", "video_upload_pressure"]

Source: wire/media.ts:269

RELAY_TICKET_MAX_BYTES const

A RelayTicket is at most 8,192 bytes (04 §6.3).

const RELAY_TICKET_MAX_BYTES: 8192 = 8192

Source: calls/relay-ticket.ts:25

RELAY_TICKET_MAX_LIFETIME_SEC const

exp − iat is at most 60 s (15 §5.1).

const RELAY_TICKET_MAX_LIFETIME_SEC: 60 = 60

Source: calls/relay-ticket.ts:28

RELAY_TICKET_TYP const

The JWS typ of a RelayTicket (15 §5, 04 §6.3).

const RELAY_TICKET_TYP: "sv-relay+jwt" = 'sv-relay+jwt'

Source: calls/relay-ticket.ts:22

REMOTE_SESSION_TIMING const

Remote session lifetimes and limits (06 §6.4, §6.6, §6.9, §6.10). Durations in milliseconds.

const REMOTE_SESSION_TIMING: { readonly lifetimeMs: 3600000; readonly previousTokenOverlapMs: 60000; readonly renewAfterBeforeExpiryMs: 600000; readonly renewWindowStartBeforeExpiryMs: 600000; readonly renewWindowEndBeforeExpiryMs: 300000; readonly extendWhenRemainingMs: 900000; readonly extendableForMs: 86400000; readonly minExtensionIntervalMs: 300000; readonly homeRetryMs: 60000; readonly homeFailureSpacingMs: 30000; readonly extendedHomeRetryMs: 300000; readonly extendedHomeRetryJitterMs: 30000; readonly backoffInitialMs: 1000; readonly backoffMaxMs: 60000; readonly endedRetryLimit: 3; readonly endedRetryWindowMs: 600000; readonly persistentFailureMs: 600000; readonly maxLiveSessionsPerDevice: 4 }

Source: wire/federation.ts:236

REPORT_CATEGORIES const

Report categories in the order 10 §10.3 step 2 shows them.

const REPORT_CATEGORIES: readonly ["spam", "harassment", "hate", "violence", "sexual_content", "child_safety", "self_harm", "illegal", "impersonation", "other"]

Source: wire/moderation.ts:411

REQUEST_URI_PREFIX const

The request_uri prefix of a pushed authorization request (05 §6.1, RFC 9126).

const REQUEST_URI_PREFIX: "urn:ietf:params:oauth:request_uri:" = 'urn:ietf:params:oauth:request_uri:'

Source: wire/accounts.ts:70

RESERVED_LOCAL_PARTS const

The initial reserved local parts registry (01 §5.4). Servers treat every entry as reserved; matching is by prepared local part and by collision key.

const RESERVED_LOCAL_PARTS: Readonly<Record<string, ReservedClass>>

Source: wire/addressing.ts:264

RESYNC_REASONS const

The session.resync_required reasons a client knows (03 §7.5).

const RESYNC_REASONS: readonly ["gap_too_large", "expired", "ahead", "access_changed", "buffer_overflow", "server_reset"]

Source: events/tracker.ts:25

S2S_DELIVERY const

S2S delivery, deduplication and revocation-mark numbers (06 §9.4, §9.5, §9.7, §9.8, §11.3, §11.4). Durations in milliseconds. Server-side; the SDK uses them only in s2sRetryDelayMs and tests.

const S2S_DELIVERY: { readonly maxFutureSkewMs: 300000; readonly maxEventAgeMs: 90000000; readonly dedupeRetentionMs: 172800000; readonly giveUpAfterMs: 86400000; readonly backoffCapMs: 3600000; readonly backoffJitterMin: 0.8; readonly backoffJitterMax: 1.2; readonly normalBatchWaitMs: 250; readonly concurrencyPerLane: 2; readonly urgentNotifyWithinMs: 120000; readonly fanOutStartMs: 1000; readonly audienceActMs: 60000; readonly revocationMarkMinMs: 3600000 }

Source: wire/federation.ts:429

S2S_ENDPOINTS const

The S2S endpoints of v1 (06 §8.1, §10.2). A client never calls these.

const S2S_ENDPOINTS: readonly [{ readonly method: "POST"; readonly path: "/v1/federation/events"; readonly owner: "06" }, { readonly method: "POST"; readonly path: "/v1/federation/keypackages/claim"; readonly owner: "13" }, { readonly method: "POST"; readonly path: "/v1/community/membership-check"; readonly owner: "09" }, { readonly method: "GET"; readonly path: "/v1/reports/{id}/evidence/{mid}"; readonly owner: "10" }, { readonly method: "GET"; readonly path: "/v1/reports/{id}/evidence/{mid}/attachments/{attachmentId}"; readonly owner: "10" }]

Source: wire/federation.ts:363

S2S_EVENT_CATALOGUE const

The S2S event catalogue index of v1 (06 §10.1). Payloads are owned and fully defined by the listed owner.

const S2S_EVENT_CATALOGUE: { readonly identity.changed: { readonly route: "home → each audience"; readonly payloadOwner: "07"; readonly lane: "high"; readonly orderKey: "d.sub"; readonly originMembers: readonly ["sub"]; readonly recipientMembers: readonly []; readonly expiresAt: "none"; readonly giveUpHook: null }; readonly device.revoked: { readonly route: "home → each audience"; readonly payloadOwner: "07"; readonly lane: "high"; readonly orderKey: "d.sub"; readonly originMembers: readonly ["sub"]; readonly recipientMembers: readonly []; readonly expiresAt: "none"; readonly giveUpHook: null }; readonly account.deleted: { readonly route: "home → each audience"; readonly payloadOwner: "05"; readonly lane: "high"; readonly orderKey: "d.addr"; readonly originMembers: readonly ["addr"]; readonly recipientMembers: readonly []; readonly expiresAt: "none"; readonly giveUpHook: null }; readonly account.suspended: { readonly route: "home → each audience"; readonly payloadOwner: "05"; readonly lane: "high"; readonly orderKey: "d.addr"; readonly originMembers: readonly ["addr"]; readonly recipientMembers: readonly []; readonly expiresAt: "none"; readonly giveUpHook: null }; readonly account.profile_changed: { readonly route: "home → each audience"; readonly payloadOwner: "05"; readonly lane: "normal"; readonly orderKey: "d.addr"; readonly originMembers: readonly ["addr"]; readonly recipientMembers: readonly []; readonly expiresAt: "none"; readonly giveUpHook: null }; readonly dm.request: { readonly route: "hosting → each recipient home"; readonly payloadOwner: "12"; readonly lane: "normal"; readonly orderKey: "d.ctx"; readonly originMembers: readonly ["host"]; readonly recipientMembers: readonly ["recipient"]; readonly expiresAt: "none"; readonly giveUpHook: "12 re-sends the invitation at the next content event (12 §15)" }; readonly dm.response: { readonly route: "recipient home → hosting"; readonly payloadOwner: "12"; readonly lane: "normal"; readonly orderKey: "d.ctx"; readonly originMembers: readonly ["recipient"]; readonly recipientMembers: readonly []; readonly expiresAt: "none"; readonly giveUpHook: null }; readonly dm.entry_updated: { readonly route: "hosting → participant home"; readonly payloadOwner: "12"; readonly lane: "normal"; readonly orderKey: "d.ctx"; readonly originMembers: readonly []; readonly recipientMembers: readonly ["recipient"]; readonly expiresAt: "none"; readonly giveUpHook: null }; readonly notify.event: { readonly route: "hosting → recipient home"; readonly payloadOwner: "19"; readonly lane: "conditional"; readonly orderKey: "d.recipient"; readonly originMembers: readonly ["host"]; readonly recipientMembers: readonly ["recipient"]; readonly expiresAt: "set by 19"; readonly giveUpHook: null }; readonly report.forwarded: { readonly route: "forwarding server → reported account home"; readonly payloadOwner: "10"; readonly lane: "normal"; readonly orderKey: "d.reportId"; readonly originMembers: readonly ["origin"]; readonly recipientMembers: readonly ["target"]; readonly expiresAt: "none"; readonly giveUpHook: null }; readonly discovery.metadata_changed: { readonly route: "any server → recent peers and audiences"; readonly payloadOwner: "02"; readonly lane: "conditional"; readonly orderKey: null; readonly originMembers: readonly []; readonly recipientMembers: readonly []; readonly expiresAt: "none"; readonly giveUpHook: null } }

Source: wire/federation.ts:477

S2S_TOKEN_MAX_BYTES const

Maximum serialized S2S token size in octets (06 §8.2).

const S2S_TOKEN_MAX_BYTES: 4096 = 4096

Source: wire/federation.ts:357

S2S_TOKEN_MAX_LIFETIME_SEC const

Maximum S2S token lifetime in seconds (06 §3.3, §8.2).

const S2S_TOKEN_MAX_LIFETIME_SEC: 60 = 60

Source: wire/federation.ts:360

S2S_TOKEN_TYP const

JWS typ of an S2S request token (06 §8.2, 04 §6.3).

const S2S_TOKEN_TYP: "sv-s2s+jwt" = 'sv-s2s+jwt'

Source: wire/federation.ts:40

SDK_ERROR_CODES const

Codes the SDK itself raises. The sdk area is not a protocol area (03 §10.4); these codes never travel on the wire.

const SDK_ERROR_CODES: { readonly invalidArgument: "sdk.invalid_argument"; readonly notImplemented: "sdk.not_implemented"; readonly protocolViolation: "sdk.protocol_violation"; readonly verificationFailed: "sdk.verification_failed"; readonly networkError: "sdk.network_error"; readonly closed: "sdk.closed" }

Source: core/errors.ts:22

SDK_VERSION const

The version of this SDK package (@sloppyvoice/sdk).

const SDK_VERSION: "0.1.0" = '0.1.0'

Source: version.ts:8

SEALED_KINDS const

The kinds v1 defines (14 §4.3, 11 §3.1).

const SEALED_KINDS: readonly ["message", "edit", "reaction", "delete"]

Source: wire/history.ts:63

SEC_PIN_KINDS const

The pin kinds of 09 §13.2. A client ignores a record with any other kind.

const SEC_PIN_KINDS: readonly ["channel", "community", "group_dm"]

Source: wire/communities.ts:682

SERVER_KEY_PURPOSES const

The known purposes (02 §11.3).

const SERVER_KEY_PURPOSES: readonly ["sign", "mls-external-sender"]

Source: wire/discovery.ts:86

SERVER_KEY_STATUSES const

The known statuses (02 §11.4).

const SERVER_KEY_STATUSES: readonly ["next", "active", "retired", "revoked"]

Source: wire/discovery.ts:89

SESSION_ENDED_REASONS const

The known federation.session_ended reasons, in the order of 06 §17.4.

const SESSION_ENDED_REASONS: readonly ["expired", "extension_limit", "device_revoked", "identity_changed", "account_deleted", "blocked", "key_revoked", "moderation", "replaced", "signed_out", "admin"]

Source: wire/federation.ts:293

SESSION_ERRORS const

The session.* error codes with their registry entries (03 §10.6). These occur only on the WebSocket. fatal says whether the server closes the socket (only session.hello_required, with close code 4000).

const SESSION_ERRORS: { readonly session.hello_required: { readonly status: 400; readonly retryable: false; readonly userAction: "none"; readonly fatal: true }; readonly session.duplicate_hello: { readonly status: 400; readonly retryable: false; readonly userAction: "none"; readonly fatal: false }; readonly session.unsupported_message: { readonly status: 400; readonly retryable: false; readonly userAction: "none"; readonly fatal: false }; readonly session.subscription_limit: { readonly status: 400; readonly retryable: false; readonly userAction: "none"; readonly fatal: false }; readonly session.wrong_session: { readonly status: 400; readonly retryable: false; readonly userAction: "none"; readonly fatal: false } }

Source: wire/transport.ts:219

SESSION_REQUEST_MAX_BYTES const

Maximum session request body in octets (06 §6.1, §6.9).

const SESSION_REQUEST_MAX_BYTES: 65536 = 65536

Source: wire/federation.ts:166

SESSION_TIMING const

Fixed timing values of the event WebSocket (03 §5.3, §5.9, §5.11, §5.12, §5.13).

const SESSION_TIMING: { readonly pingIntervalMs: 30000; readonly idleTimeoutMs: 75000; readonly helloTimeoutMs: 10000; readonly readyTimeoutMs: 15000; readonly clientPingMinIntervalMs: 5000; readonly clientPongTimeoutMs: 10000; readonly inCallLivenessMs: 3000; readonly foregroundMinIntervalMs: 5000; readonly stableReadyMs: 60000; readonly wakeReconnectMinIntervalMs: 5000; readonly authGraceMs: 60000; readonly reauthLeadMs: 120000; readonly replacedWindowMs: 60000; readonly gapWindowMs: 300000; readonly gapLimit: 3 }

Source: wire/transport.ts:603

SESSION_TOKEN_PATTERN const

Grammar of a remote session token: 1–512 of ALPHA / DIGIT / "-" / "." / "_" / "~" (06 §6.4).

const SESSION_TOKEN_PATTERN: RegExp

Source: wire/federation.ts:272

SFU_FRAME_CODECS const

The SfuFrameMetadata codec registry (18 §8.4.2, §12.1): 1 Opus, 2 VP8, 3 VP9; 0 and 4–255 reserved. Never copied from or to the video-dc/1 codec octets (18 §8.4.2).

const SFU_FRAME_CODECS: { readonly opus: 1; readonly vp8: 2; readonly vp9: 3 }

Source: wire/media.ts:131

sleep const

Wait ms milliseconds with setTimeout; reject at once if signal aborts.

const sleep: Sleep

Source: core/time.ts:27

SOURCE_IDS const

Media source IDs (15 §4.1; 18 assigns them). 4–15 are reserved: nobody forwards or plays them.

const SOURCE_IDS: { readonly microphone: 0; readonly screenVideo: 1; readonly screenAudio: 2; readonly webcam: 3 }

Source: wire/calls.ts:123

SOURCE_LEASE_LIST const

The lease list that governs each source (18 §4.2, 15 §4.1): audio for 0 and 2, video for 1 and 3.

const SOURCE_LEASE_LIST: { readonly 0: "audio"; readonly 1: "video"; readonly 2: "audio"; readonly 3: "video" }

Source: wire/media.ts:48

SOURCE_LIST const

Which lease list covers each defined source (15 §4.1).

const SOURCE_LIST: Readonly<Record<0 | 1 | 2 | 3, "audio" | "video">>

Source: wire/calls.ts:129

SPECIAL_USE_DOMAINS const

Special-use names refused as queried domains, with every name under them (02 §5.1): the names 02 lists, plus the entries of the IANA Special-Use Domain Names registry (RFC 6761, RFC 6762, RFC 7686, RFC 8375, RFC 9476). Every .arpa registry entry (home.arpa, ipv4only.arpa, resolver.arpa, service.arpa, the reverse zones, …) is covered by arpa.

const SPECIAL_USE_DOMAINS: readonly ["localhost", "local", "internal", "invalid", "test", "example", "arpa", "alt", "onion", "example.com", "example.net", "example.org"]

Source: discovery/domain.ts:16

SUBPROTOCOL const

The WebSocket subprotocol of protocol version 1 (00 §7.1, 03 §5.1 item 2).

const SUBPROTOCOL: "sloppyv.v1" = 'sloppyv.v1'

Source: version.ts:18

SV_TOKEN_LENGTH const

Length of every sv-token (05 §21.2: "Every token above is 47 characters long").

const SV_TOKEN_LENGTH: 47 = 47

Source: wire/accounts.ts:51

SV_TOKEN_PATTERN const

sv-token = token-prefix "_" 43b64u-char (05 §7.4): exactly 47 characters, lowercase prefix, no padding, and canonical trailing bits (32 bytes encode to 43 characters whose last one carries 4 data bits and 2 zero bits).

const SV_TOKEN_PATTERN: RegExp

Source: wire/accounts.ts:48

SV1_LEAF_CAPABILITIES const

The required leaf capabilities of 13 §3.4.

const SV1_LEAF_CAPABILITIES: Readonly<MlsCapabilities>

Source: mls/provider.ts:309

systemClock const

The device clock (Date.now()).

const systemClock: Clock

Source: core/time.ts:16

systemTimers const

The global timers (see Timers).

const systemTimers: Timers

Source: events/websocket.ts:72

TEMPORARY_DISCOVERY_FAILURES const

The temporary failures of 02 §13.2, during which a stale result may be used.

const TEMPORARY_DISCOVERY_FAILURES: readonly ["discovery.dns_failure", "discovery.server_unreachable"]

Source: wire/discovery.ts:489

THUMBNAIL_MIME_TYPES const

Thumbnail media types (11 §3.6 ThumbnailRef mime).

const THUMBNAIL_MIME_TYPES: readonly ["image/webp", "image/jpeg", "image/png"]

Source: wire/messaging.ts:147

TIMELINE_PAGE_LIMIT const

Timeline page size bounds: limit 1 to 100, default 50 (03 §13.1).

const TIMELINE_PAGE_LIMIT: { readonly min: 1; readonly max: 100; readonly default: 50 }

Source: wire/transport.ts:665

TIMEOUT_PRESETS_MS const

The timeout presets clients SHOULD offer: 1 minute, 10 minutes, 1 hour, 1 day, 1 week (10 §8.5).

const TIMEOUT_PRESETS_MS: readonly [60000, 600000, 3600000, 86400000, 604800000]

Source: api/moderation.ts:257

TOKEN_PREFIXES const

The token prefixes of 05 §7.4, by kind. Every Sloppy Voice credential is <prefix>_ followed by 43 base64url characters (32 random bytes).

const TOKEN_PREFIXES: { readonly access: "sva"; readonly refresh: "svr"; readonly signup: "svs"; readonly bot: "svb"; readonly code: "svc" }

Source: wire/accounts.ts:24

unimplementedMlsProvider const

A provider placeholder that throws sdk.not_implemented for every operation.

const unimplementedMlsProvider: MlsProvider

Source: mls/provider.ts:1340

USER_ACTIONS const

The userAction values of 03 §10.2, in registry order. A client treats an unknown value as none (03 §10.2).

const USER_ACTIONS: readonly ["none", "retry", "wait", "sign_in", "enable_encryption", "set_up_device", "update_app", "contact_admin"]

Source: wire/transport.ts:26

UUID_V7_PATTERN const

The uuid7 grammar of 03 §8.2: lowercase hex only, version 7, variant 10 (nibble 8, 9, a or b).

const UUID_V7_PATTERN: RegExp

Source: core/uuidv7.ts:14

VIDEO_DC_CODECS const

The video-dc/1 codec octets (17 §5.1). 0x00 and 0x05–0xFF are reserved; receivers drop such frames and count codecUnsupported. Unrelated to 18's SfuFrameMetadata codec values.

const VIDEO_DC_CODECS: { readonly vp8: 1; readonly vp9: 2; readonly h264: 3; readonly av1: 4 }

Source: wire/media.ts:110

VIDEO_DC_VT_FRAGMENT const

vt of a video-dc/1 fragment message: version 1, type 0 (17 §6.2).

const VIDEO_DC_VT_FRAGMENT: 16 = 0x10

Source: wire/media.ts:90

VIDEO_FLAGS const

Flag bits of a video-dc/1 frame header (17 §6.3).

const VIDEO_FLAGS: { readonly C: 128; readonly K: 64; readonly D: 32; readonly E: 16; readonly reserved: 15 }

Source: wire/media.ts:93

VOICE_DC_VT_FRAME const

vt of a voice-dc/1 frame message: version 1, type 0 (16 §4.2).

const VOICE_DC_VT_FRAME: 16 = 0x10

Source: wire/media.ts:69

VOICE_FLAGS const

Flag bits of a voice-dc/1 frame (16 §4.4).

const VOICE_FLAGS: { readonly C: 128; readonly S: 64; readonly E: 32; readonly D: 16; readonly reserved: 15 }

Source: wire/media.ts:72

WEBHOOK_TOKEN_PREFIX const

The prefix of a webhook token, whk_ followed by base64url of 32 random bytes (11 §15.2).

const WEBHOOK_TOKEN_PREFIX: "whk_" = 'whk_'

Source: wire/messaging.ts:110

WEBHOOKS_FEATURE const

The ServerMetadata feature that advertises webhooks (11 §15.1, §18).

const WEBHOOKS_FEATURE: "webhooks" = 'webhooks'

Source: wire/messaging.ts:113

WELL_KNOWN_PATH const

The .well-known path of the fallback document: https://<domain>/.well-known/sloppyv (02 §4.1).

const WELL_KNOWN_PATH: "/.well-known/sloppyv" = '/.well-known/sloppyv'

Source: wire/discovery.ts:26

WITHDRAWN_HISTORY_CODES const

Codes withdrawn with the automatic history handover; MUST NOT be reused (14 §15).

const WITHDRAWN_HISTORY_CODES: readonly ["history.handover_denied", "history.link_invalid", "history.epoch_out_of_range"]

Source: wire/history.ts:355

WS_CLOSED const

WebSocket.CLOSED (WHATWG WebSocket, RFC 6455; 03 §5.1).

const WS_CLOSED: 3 = 3

Source: events/websocket.ts:22

WS_CLOSING const

WebSocket.CLOSING (WHATWG WebSocket, RFC 6455; 03 §5.1).

const WS_CLOSING: 2 = 2

Source: events/websocket.ts:20

WS_CONNECTING const

WebSocket.CONNECTING (WHATWG WebSocket, RFC 6455; 03 §5.1).

const WS_CONNECTING: 0 = 0

Source: events/websocket.ts:16

WS_OPEN const

WebSocket.OPEN (WHATWG WebSocket, RFC 6455; 03 §5.1).

const WS_OPEN: 1 = 1

Source: events/websocket.ts:18

Re-exports

Also exported from this entry point; documented where they are defined.