Skip to main content

Class: HttpTransport

HttpTransport represents the HTTP transport for connecting to the network.

HttpTransport

Implements

Implements

Constructors

new HttpTransport()

new HttpTransport(__namedParameters): HttpTransport

Parameters

ParameterType

__namedParameters

IHttpTransportConfig

Returns

HttpTransport

Defined

@nilfoundation/niljs/src/transport/HttpTransport.ts:46

Properties

endpoint

endpoint: string;

The endpoint to which the transport connects.

Defined

@nilfoundation/niljs/src/transport/HttpTransport.ts:29


fetcher()

fetcher: (input, init?) => Promise<Response>;

The fetcher to be used in the requests.

MDN Reference

Parameters

ParameterType

input

RequestInfo | URL

init?

RequestInit

Returns

Promise<Response>

Defined

@nilfoundation/niljs/src/transport/HttpTransport.ts:44


headers

headers: Record<string, string>;

The headers to be used in the requests.

Defined

@nilfoundation/niljs/src/transport/HttpTransport.ts:39


timeout

timeout: number;

The timeout for the requests.

Defined

@nilfoundation/niljs/src/transport/HttpTransport.ts:34

Methods

request()

request(requestObject, client): Promise<void>

Sends a request to the network.

Parameters

ParameterTypeDescription

requestObject

JSONRPCRequest

The request object.

client

JSONRPCClient

Returns

Promise<void>

The response.

Async

Implementation of

ITransport.request

Defined

@nilfoundation/niljs/src/transport/HttpTransport.ts:62