Skip to content

@lelantos-org/sdk / services / FmdClient

Class: FmdClient ​

Defined in: @lelantos-org/sdk/dist/services/fmd-server/client.d.ts:3

Constructors ​

Constructor ​

ts
new FmdClient(
   baseUrl, 
   chainId, 
   opts?
): FmdClient;

Defined in: @lelantos-org/sdk/dist/services/fmd-server/client.d.ts:7

Parameters ​

ParameterType
baseUrlstring
chainIdbigint
opts?HttpClientOptions

Returns ​

FmdClient

Methods ​

createSubscription() ​

ts
createSubscription(input): Promise<SubscriptionOut>;

Defined in: @lelantos-org/sdk/dist/services/fmd-server/client.d.ts:55

Idempotent under a stable tokenHex: a repeat with the same detection key and γ re-attaches to the existing subscription (created: false). A repeat with a different detection key is rejected 409 rather than repointing the row, which would hand this caller the match stream of whoever registered the token first.

Parameters ​

ParameterType
inputCreateSubscriptionInput

Returns ​

Promise<SubscriptionOut>


deleteSubscription() ​

ts
deleteSubscription(token): Promise<void>;

Defined in: @lelantos-org/sdk/dist/services/fmd-server/client.d.ts:57

Token travels in the Authorization header, not the path; see listMatches.

Parameters ​

ParameterType
tokenstring

Returns ​

Promise<void>


fetchCommitmentChunk() ​

ts
fetchCommitmentChunk(chunkId, opts?): Promise<CommitmentChunkOut>;

Defined in: @lelantos-org/sdk/dist/services/fmd-server/client.d.ts:37

Leaves chunkId * 1024 .. +1024. Complete chunks are immutable.

Exempt from the SDK's default no-store. The feed is global and append-only: every wallet fetches identical bytes, so a cache entry reveals only that this device synced, which the request already reveals. The origin serves complete chunks as max-age=31536000, immutable, so a repeat sync can skip the network.

Parameters ​

ParameterType
chunkIdnumber
opts?{ signal?: AbortSignal; }
opts.signal?AbortSignal

Returns ​

Promise<CommitmentChunkOut>


fetchHead() ​

ts
fetchHead(): Promise<FmdHead>;

Defined in: @lelantos-org/sdk/dist/services/fmd-server/client.d.ts:13

Current sync watermarks, cheap enough to poll. Gates the expensive reads (listNotes, listMatches and the chunk feeds) on whether anything changed.

Returns ​

Promise<FmdHead>


fetchNullifierChunk() ​

ts
fetchNullifierChunk(chunkId, opts?): Promise<NullifierChunkOut>;

Defined in: @lelantos-org/sdk/dist/services/fmd-server/client.d.ts:45

Spent nullifiers chunkId * 1024 .. +1024 in insertion order. The whole set is paged down and filtered client-side so the server never learns which nullifiers a wallet cares about.

Parameters ​

ParameterType
chunkIdnumber
opts?{ signal?: AbortSignal; }
opts.signal?AbortSignal

Returns ​

Promise<NullifierChunkOut>


fetchTreeState() ​

ts
fetchTreeState(): Promise<FmdTreeState>;

Defined in: @lelantos-org/sdk/dist/services/fmd-server/client.d.ts:14

Returns ​

Promise<FmdTreeState>


listMatches() ​

ts
listMatches(opts): Promise<FmdMatchesPage>;

Defined in: @lelantos-org/sdk/dist/services/fmd-server/client.d.ts:23

Server-side FMD-filtered notes for a subscription, addressed by the capability token from createSubscription.

Parameters ​

ParameterType
opts{ after?: number; limit?: number; token: string; }
opts.after?number
opts.limit?number
opts.tokenstring

Returns ​

Promise<FmdMatchesPage>


listNotes() ​

ts
listNotes(opts?): Promise<FmdNoteOut[]>;

Defined in: @lelantos-org/sdk/dist/services/fmd-server/client.d.ts:15

Parameters ​

ParameterType
opts?{ after?: number; limit?: number; }
opts.after?number
opts.limit?number

Returns ​

Promise<FmdNoteOut[]>