Skip to main content
Version: Next

Class: BatchClient<T>

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

Type Parameters

T

T extends object

Constructors

Constructor

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

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

Parameters

options

BatchClientOptions<T>

Returns

BatchClient<T>

Properties

nodeUrl

nodeUrl: string

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


headers

headers: object

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


interval

interval: number

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


requestId

requestId: number = 0

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

Methods

fetch()

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

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

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