Skip to main content
Version: 11.x

Class: BatchClient<T>

Defined in: src/utils/batch/index.ts:19

Type Parameters​

T​

T extends object

Constructors​

Constructor​

new BatchClient<T>(options): BatchClient<T>

Defined in: src/utils/batch/index.ts:42

Parameters​

options​

BatchClientOptions<T>

Returns​

BatchClient<T>

Properties​

nodeUrl​

nodeUrl: string

Defined in: src/utils/batch/index.ts:20


headers​

headers: object

Defined in: src/utils/batch/index.ts:22


interval​

interval: number

Defined in: src/utils/batch/index.ts:24


requestId​

requestId: number = 0

Defined in: src/utils/batch/index.ts:26

Methods​

fetch()​

fetch<M, TResponse>(method, params?, id?): Promise<TResponse>

Defined in: src/utils/batch/index.ts:110

Automatically batches and fetches JSON-RPC calls in a single request.

Type Parameters​

M​

M extends string | number | symbol

TResponse​

TResponse extends ResponseBody & object

Parameters​

method​

M

Method to call

params?​

T[M]["params"]

Method parameters

id?​

string | number

JSON-RPC Request ID

Returns​

Promise<TResponse>

JSON-RPC Response