@lelantos-org/sdk / core / JsonClientOptions
Interface: JsonClientOptions โ
Defined in: @lelantos-org/sdk/dist/core/json-client.d.ts:37
Extends โ
Properties โ
backoffMs? โ
optional backoffMs?: number;Defined in: @lelantos-org/sdk/dist/core/http.d.ts:8
Base backoff, doubled per attempt, ยฑ25% jitter. Default 250.
Inherited from โ
defaultParams? โ
optional defaultParams?: QueryParams;Defined in: @lelantos-org/sdk/dist/core/json-client.d.ts:39
Query params merged into every GET/DELETE (e.g. a pinned chainId).
fetchImpl? โ
optional fetchImpl?: (input, init?) => Promise<Response>;Defined in: @lelantos-org/sdk/dist/core/http.d.ts:10
Defaults to bound globalThis.fetch.
Parameters โ
| Parameter | Type |
|---|---|
input | RequestInfo | URL |
init? | RequestInit |
Returns โ
Promise<Response>
Inherited from โ
onPaymentRequired? โ
optional onPaymentRequired?: (res, url, init) => Promise<Response | null>;Defined in: @lelantos-org/sdk/dist/core/http.d.ts:30
Invoked when the server returns 402, before NetworkError is thrown. Return a Response to replace the 402 (its ok/non-ok status is then honored) or null to fall through to the normal error path. Owns its own retry semantics โ the outer retry loop does NOT loop on the returned response.
Parameters โ
| Parameter | Type |
|---|---|
res | Response |
url | string |
init | RequestInit | undefined |
Returns โ
Promise<Response | null>
Inherited from โ
HttpClientOptions.onPaymentRequired
onRetry? โ
optional onRetry?: (info) => void;Defined in: @lelantos-org/sdk/dist/core/http.d.ts:17
Observability hook fired before each backoff. Must not throw.
Parameters โ
| Parameter | Type |
|---|---|
info | { attempt: number; delayMs: number; method: string; url: string; } |
info.attempt | number |
info.delayMs | number |
info.method | string |
info.url | string |
Returns โ
void
Inherited from โ
retries? โ
optional retries?: number;Defined in: @lelantos-org/sdk/dist/core/http.d.ts:6
Additional attempts after the first. Default 3.
Inherited from โ
retryOnSubmit? โ
optional retryOnSubmit?: boolean;Defined in: @lelantos-org/sdk/dist/core/http.d.ts:15
Retry POST/PUT/PATCH/DELETE (which carry an Idempotency-Key). Default true. See the module header before turning this off โ or on.
Inherited from โ
HttpClientOptions.retryOnSubmit
timeoutMs? โ
optional timeoutMs?: number;Defined in: @lelantos-org/sdk/dist/core/http.d.ts:4
Per-attempt deadline. Default 15 000 for GET, 30 000 for POST.