Skip to content

@lelantos-org/sdk / services / JsonClientOptions

Interface: JsonClientOptions ​

Defined in: @lelantos-org/sdk/dist/services/http/json-client.d.ts:31

Extends ​

Properties ​

backoffMs? ​

ts
optional backoffMs?: number;

Defined in: @lelantos-org/sdk/dist/services/http/client.d.ts:20

Base backoff, doubled per attempt, ±25% jitter. Default 250.

Inherited from ​

HttpClientOptions.backoffMs


defaultParams? ​

ts
optional defaultParams?: QueryParams;

Defined in: @lelantos-org/sdk/dist/services/http/json-client.d.ts:33

Query params merged into every GET/DELETE (e.g. a pinned chainId).


fetch? ​

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

Defined in: @lelantos-org/sdk/dist/services/http/client.d.ts:22

Defaults to bound globalThis.fetch.

MDN Reference

Parameters ​

ParameterType
inputRequestInfo | URL
init?RequestInit

Returns ​

Promise<Response>

Inherited from ​

HttpClientOptions.fetch


headers? ​

ts
optional headers?: Readonly<Record<string, string>>;

Defined in: @lelantos-org/sdk/dist/services/http/client.d.ts:27

Added to every request, e.g. an API gateway key. A per-request header of the same name wins.

Inherited from ​

HttpClientOptions.headers


onPaymentRequired? ​

ts
optional onPaymentRequired?: StatusHook;

Defined in: @lelantos-org/sdk/dist/services/http/client.d.ts:39

Invoked on a 402 response, before NetworkError is thrown; see StatusHook for the contract.

Inherited from ​

HttpClientOptions.onPaymentRequired


onRetry? ​

ts
optional onRetry?: (info) => void;

Defined in: @lelantos-org/sdk/dist/services/http/client.d.ts:29

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/services/http/client.d.ts:18

Additional attempts after the first. Default 3.

Inherited from ​

HttpClientOptions.retries


submitTimeoutMs? ​

ts
optional submitTimeoutMs?: number;

Defined in: @lelantos-org/sdk/dist/services/http/client.d.ts:16

Per-attempt deadline for non-idempotent requests: the submit endpoints, which the relayer answers only once the transaction is mined. Takes precedence over timeoutMs for them; default timeoutMs, else 30 000.

Chain-dependent: a relayer on a slow-block chain, or one waiting to fill a bundle, needs longer than one on an L2.

Inherited from ​

HttpClientOptions.submitTimeoutMs


timeoutMs? ​

ts
optional timeoutMs?: number;

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

Per-attempt deadline for idempotent requests, default 15 000. Also applies to non-idempotent requests unless HttpClientOptions.submitTimeoutMs is set.

Inherited from ​

HttpClientOptions.timeoutMs