@hiero-ledger/sdk
    Preparing search index...

    Class FetchHttpTransport

    The fetch-backed transport: the SDK default in the browser and on React Native, and available on Node for an application that wants the platform's global fetch (and whatever dispatcher or proxy it has been configured with) instead of the SDK's private connection pool.

    This is the constrained conformance profile. The HTTP stack belongs to the platform, so:

    • connectTimeout is ignored; the platform's own connect bound applies.
    • Redirects follow the platform's own bound, not maxRedirects.
    • Every network failure is one opaque TypeError, so a bad host name or an untrusted certificate is reported as connection-error (and retried) rather than as unknown-host-error or tls-error. Under Node the failure carries a cause.code and is classified precisely.
    • The body cap is enforced while streaming where the runtime exposes a readable body, and after buffering where it does not (React Native).
    • There is no connection pool to drain, so close aborts outstanding requests immediately.

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      • Optionalconfiguration:
            | HttpTransportConfiguration
            | {
                connectTimeout?: number;
                defaultHeaders?: Record<string, string>;
                maxRedirects?: number;
                maxResponseBytes?: number;
            }
      • Optionaloptions: FetchHttpTransportOptions = {}

      Returns FetchHttpTransport

    Accessors

    Methods

    • Abort every exchange in flight and refuse new ones. There is no connection pool behind fetch to drain, so closeTimeout is not waited out; the returned promise is already settled.

      Parameters

      • OptionalcloseTimeout: number

      Returns Promise<void>

    • Parameters

      • Optionalconfiguration:
            | HttpTransportConfiguration
            | {
                connectTimeout?: number;
                defaultHeaders?: Record<string, string>;
                maxRedirects?: number;
                maxResponseBytes?: number;
            }
      • Optionaloptions: FetchHttpTransportOptions

      Returns FetchHttpTransport