Class: RpcNode<TSHandlers, TCHandlers>
Type parameters
Name |
---|
TSHandlers |
TCHandlers |
Hierarchy
RpcNode
Constructors
constructor
• new RpcNode<TSHandlers
, TCHandlers
>(transport
, requestHandlers
)
Type parameters
Name |
---|
TSHandlers |
TCHandlers |
Parameters
Name | Type |
---|---|
transport | Transport |
requestHandlers | TSHandlers |
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
Name | Type |
---|---|
K | extends string | number | symbol |
Parameters
Name | Type |
---|---|
request | RpcRequest <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
Name | Type |
---|---|
K | extends string | number | symbol |
Parameters
Name | Type |
---|---|
request | RpcRequest <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
Name | Type |
---|---|
message | string |
Returns
Promise
<void
>
Defined in
packages/core/src/JSONRPC/RpcNode.ts:151
handleRpcRequest
▸ Private
handleRpcRequest(request
): Promise
<void
>
Parameters
Name | Type |
---|---|
request | RpcRequest <string , unknown > |
Returns
Promise
<void
>
Defined in
packages/core/src/JSONRPC/RpcNode.ts:113
handleRpcResponse
▸ Private
handleRpcResponse(response
): void
Parameters
Name | Type |
---|---|
response | RpcResponse <ReturnTypeOfMethodIfExists <TCHandlers , keyof TCHandlers >, unknown > |
Returns
void
Defined in
packages/core/src/JSONRPC/RpcNode.ts:196
notify
▸ notify<K
>(method
, params
): void
Type parameters
Name | Type |
---|---|
K | extends string | number | symbol |
Parameters
Name | Type |
---|---|
method | K |
params | MethodParamsIfExists <TCHandlers , K > |
Returns
void
Defined in
packages/core/src/JSONRPC/RpcNode.ts:102
onRequest
▸ Protected
Abstract
onRequest(request
): Promise
<unknown
>
Parameters
Name | Type |
---|---|
request | RpcRequest <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
Name | Type |
---|---|
K | extends string | number | symbol |
Parameters
Name | Type |
---|---|
method | K |
params | MethodParamsIfExists <TCHandlers , K > |
Returns
Promise
<ReturnTypeOfMethodIfExists
<TCHandlers
, K
>>
Defined in
packages/core/src/JSONRPC/RpcNode.ts:89