@lelantos-org/sdk / services / HttpClientOptions
Interface: HttpClientOptions
Defined in: @lelantos-org/sdk/dist/services/http/client.d.ts:2
Extended by
Properties
backoffMs?
optional backoffMs?: number;Defined in: @lelantos-org/sdk/dist/services/http/client.d.ts:20
Base backoff, doubled per attempt, ±25% jitter. Default 250.
fetch?
optional fetch?: (input, init?) => Promise<Response>;Defined in: @lelantos-org/sdk/dist/services/http/client.d.ts:22
Defaults to bound globalThis.fetch.
Parameters
| Parameter | Type |
|---|---|
input | RequestInfo | URL |
init? | RequestInit |
Returns
Promise<Response>
headers?
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.
onPaymentRequired?
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.
onRetry?
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
| 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
retries?
optional retries?: number;Defined in: @lelantos-org/sdk/dist/services/http/client.d.ts:18
Additional attempts after the first. Default 3.
submitTimeoutMs?
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.
timeoutMs?
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.