Skip to main content

Class: RpcNode<TSHandlers, TCHandlers>

Type parameters

Name
TSHandlers
TCHandlers

Hierarchy

Constructors

constructor

new RpcNode<TSHandlers, TCHandlers>(transport, requestHandlers)

Type parameters

Name
TSHandlers
TCHandlers

Parameters

NameType
transportTransport
requestHandlersTSHandlers

Defined in

packages/core/src/JSONRPC/RpcNode.ts:39

Properties

ongoingRequests

Private ongoingRequests: Object = {}

Index signature

[requestId: number | string]: Resolver<RpcResponse<ReturnTypeOfMethodIfExists<TCHandlers, keyof TCHandlers>, unknown>>

Defined in

packages/core/src/JSONRPC/RpcNode.ts:30


requestHandlers

Protected requestHandlers: TSHandlers

Defined in

packages/core/src/JSONRPC/RpcNode.ts:28


transport

Private transport: Transport

Defined in

packages/core/src/JSONRPC/RpcNode.ts:26

Methods

_notify

Private _notify<K>(request): void

Type parameters

NameType
Kextends string | number | symbol

Parameters

NameType
requestRpcRequest<K, MethodParamsIfExists<TCHandlers, K>>

Returns

void

Defined in

packages/core/src/JSONRPC/RpcNode.ts:83


_request

Private _request<K>(request): Promise<ReturnTypeOfMethodIfExists<TCHandlers, K>>

Type parameters

NameType
Kextends string | number | symbol

Parameters

NameType
requestRpcRequest<K, MethodParamsIfExists<TCHandlers, K>>

Returns

Promise<ReturnTypeOfMethodIfExists<TCHandlers, K>>

Defined in

packages/core/src/JSONRPC/RpcNode.ts:47


handleMessage

Private handleMessage(message): Promise<void>

Parameters

NameType
messagestring

Returns

Promise<void>

Defined in

packages/core/src/JSONRPC/RpcNode.ts:151


handleRpcRequest

Private handleRpcRequest(request): Promise<void>

Parameters

NameType
requestRpcRequest<string, unknown>

Returns

Promise<void>

Defined in

packages/core/src/JSONRPC/RpcNode.ts:113


handleRpcResponse

Private handleRpcResponse(response): void

Parameters

NameType
responseRpcResponse<ReturnTypeOfMethodIfExists<TCHandlers, keyof TCHandlers>, unknown>

Returns

void

Defined in

packages/core/src/JSONRPC/RpcNode.ts:196


notify

notify<K>(method, params): void

Type parameters

NameType
Kextends string | number | symbol

Parameters

NameType
methodK
paramsMethodParamsIfExists<TCHandlers, K>

Returns

void

Defined in

packages/core/src/JSONRPC/RpcNode.ts:102


onRequest

Protected Abstract onRequest(request): Promise<unknown>

Parameters

NameType
requestRpcRequest<string, unknown>

Returns

Promise<unknown>

Defined in

packages/core/src/JSONRPC/RpcNode.ts:194


request

request<K>(method, params): Promise<ReturnTypeOfMethodIfExists<TCHandlers, K>>

Type parameters

NameType
Kextends string | number | symbol

Parameters

NameType
methodK
paramsMethodParamsIfExists<TCHandlers, K>

Returns

Promise<ReturnTypeOfMethodIfExists<TCHandlers, K>>

Defined in

packages/core/src/JSONRPC/RpcNode.ts:89