Skip to content

@lelantos-org/sdk / core / JsonClientOptions

Interface: JsonClientOptions โ€‹

Defined in: @lelantos-org/sdk/dist/core/json-client.d.ts:37

Extends โ€‹

Properties โ€‹

backoffMs? โ€‹

ts
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 โ€‹

HttpClientOptions.backoffMs


defaultParams? โ€‹

ts
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? โ€‹

ts
optional fetchImpl?: (input, init?) => Promise<Response>;

Defined in: @lelantos-org/sdk/dist/core/http.d.ts:10

Defaults to bound globalThis.fetch.

MDN Reference

Parameters โ€‹

ParameterType
inputRequestInfo | URL
init?RequestInit

Returns โ€‹

Promise<Response>

Inherited from โ€‹

HttpClientOptions.fetchImpl


onPaymentRequired? โ€‹

ts
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 โ€‹

ParameterType
resResponse
urlstring
initRequestInit | undefined

Returns โ€‹

Promise<Response | null>

Inherited from โ€‹

HttpClientOptions.onPaymentRequired


onRetry? โ€‹

ts
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 โ€‹

ParameterType
info{ attempt: number; delayMs: number; method: string; url: string; }
info.attemptnumber
info.delayMsnumber
info.methodstring
info.urlstring

Returns โ€‹

void

Inherited from โ€‹

HttpClientOptions.onRetry


retries? โ€‹

ts
optional retries?: number;

Defined in: @lelantos-org/sdk/dist/core/http.d.ts:6

Additional attempts after the first. Default 3.

Inherited from โ€‹

HttpClientOptions.retries


retryOnSubmit? โ€‹

ts
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? โ€‹

ts
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.

Inherited from โ€‹

HttpClientOptions.timeoutMs

Lelantosno cookies ๐Ÿช ยท no tracking ๐Ÿ‘๏ธ ยท no accounts ๐Ÿ‘คwalletexplorer4536080GitHub