@lelantos-org/sdk / services/fmd-server / FmdClient
Class: FmdClient โ
Defined in: @lelantos-org/sdk/dist/services/fmd-server/client.d.ts:138
Constructors โ
Constructor โ
new FmdClient(
baseUrl,
chainId,
opts?
): FmdClient;Defined in: @lelantos-org/sdk/dist/services/fmd-server/client.d.ts:142
Parameters โ
| Parameter | Type |
|---|---|
baseUrl | string |
chainId | bigint |
opts? | HttpClientOptions |
Returns โ
FmdClient
Methods โ
createSubscription() โ
createSubscription(input): Promise<SubscriptionOut>;Defined in: @lelantos-org/sdk/dist/services/fmd-server/client.d.ts:193
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 โ
| Parameter | Type |
|---|---|
input | CreateSubscriptionInput |
Returns โ
Promise<SubscriptionOut>
deleteSubscription() โ
deleteSubscription(token): Promise<void>;Defined in: @lelantos-org/sdk/dist/services/fmd-server/client.d.ts:195
Token travels in the Authorization header, not the path โ see listMatches.
Parameters โ
| Parameter | Type |
|---|---|
token | string |
Returns โ
Promise<void>
fetchCommitmentChunk() โ
fetchCommitmentChunk(chunkId, opts?): Promise<CommitmentChunkOut>;Defined in: @lelantos-org/sdk/dist/services/fmd-server/client.d.ts:175
Leaves chunkId * 1024 .. +1024. Complete chunks are immutable.
One of the two routes exempted from the SDK's blanket no-store. The feed is global and append-only: every wallet fetches the identical bytes, so a cache entry says only that this device synced, which the request itself already said. The origin serves complete chunks as max-age=31536000, immutable, and honoring that turns a repeat sync into no network at all โ the single largest transfer in a cold sync.
Parameters โ
| Parameter | Type |
|---|---|
chunkId | number |
opts? | { signal?: AbortSignal; } |
opts.signal? | AbortSignal |
Returns โ
Promise<CommitmentChunkOut>
fetchHead() โ
fetchHead(): Promise<FmdHead>;Defined in: @lelantos-org/sdk/dist/services/fmd-server/client.d.ts:150
Current sync watermarks. Cheap enough to poll several times a minute: two indexed MAX()s, uncached on both sides.
The point is to gate the expensive reads โ listNotes, listMatches and the chunk feeds โ on whether anything actually moved.
Returns โ
Promise<FmdHead>
fetchNullifierChunk() โ
fetchNullifierChunk(chunkId, opts?): Promise<NullifierChunkOut>;Defined in: @lelantos-org/sdk/dist/services/fmd-server/client.d.ts:183
Spent nullifiers chunkId * 1024 .. +1024 in insertion order. The whole set is paged down and filtered client-side โ the server must never learn which nullifiers a wallet cares about.
Parameters โ
| Parameter | Type |
|---|---|
chunkId | number |
opts? | { signal?: AbortSignal; } |
opts.signal? | AbortSignal |
Returns โ
Promise<NullifierChunkOut>
fetchTreeState() โ
fetchTreeState(): Promise<FmdTreeState>;Defined in: @lelantos-org/sdk/dist/services/fmd-server/client.d.ts:151
Returns โ
Promise<FmdTreeState>
listMatches() โ
listMatches(opts): Promise<FmdMatchesPage>;Defined in: @lelantos-org/sdk/dist/services/fmd-server/client.d.ts:160
Server-side FMD-filtered notes for a subscription, addressed by the capability token from createSubscription.
Parameters โ
| Parameter | Type |
|---|---|
opts | { after?: number; limit?: number; token: string; } |
opts.after? | number |
opts.limit? | number |
opts.token | string |
Returns โ
Promise<FmdMatchesPage>
listNotes() โ
listNotes(opts?): Promise<FmdNoteOut[]>;Defined in: @lelantos-org/sdk/dist/services/fmd-server/client.d.ts:152
Parameters โ
| Parameter | Type |
|---|---|
opts? | { after?: number; limit?: number; } |
opts.after? | number |
opts.limit? | number |
Returns โ
Promise<FmdNoteOut[]>