@lelantos-org/sdk / services / FmdClient
Class: FmdClient
Defined in: @lelantos-org/sdk/dist/services/fmd-server/client.d.ts:3
Constructors
Constructor
new FmdClient(
baseUrl,
chainId,
opts?
): FmdClient;Defined in: @lelantos-org/sdk/dist/services/fmd-server/client.d.ts:7
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: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
| Parameter | Type |
|---|---|
input | CreateSubscriptionInput |
Returns
Promise<SubscriptionOut>
deleteSubscription()
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
| 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: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
| 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: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()
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
| 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:14
Returns
Promise<FmdTreeState>
listMatches()
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
| 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:15
Parameters
| Parameter | Type |
|---|---|
opts? | { after?: number; limit?: number; } |
opts.after? | number |
opts.limit? | number |
Returns
Promise<FmdNoteOut[]>