Casper.Network.SDK
Show / Hide Table of Contents

Class RpcClient

The RPC client to send and receive data to the Casper network.

Inheritance
System.Object
RpcClient
Namespace: Casper.Network.SDK.JsonRpc
Assembly: Casper.Network.SDK.dll
Syntax
public class RpcClient : IDisposable

Constructors

RpcClient(String, RpcLoggingHandler)

Creates an instance of the RPC Client that connects to the node address received as argument. Optionally, use an RpcLoggingHandler object to log requests and responses.

Declaration
public RpcClient(string nodeAddress, RpcLoggingHandler loggingHandler = null)
Parameters
Type Name Description
System.String nodeAddress
RpcLoggingHandler loggingHandler

RpcClient(String, HttpClient)

Declaration
public RpcClient(string nodeAddress, HttpClient client)
Parameters
Type Name Description
System.String nodeAddress
HttpClient client

Methods

Dispose()

Declaration
public void Dispose()

Dispose(Boolean)

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
System.Boolean disposing

SendAsync<TRpcResult>(RpcMethod)

Declaration
protected async Task<RpcResponse<TRpcResult>> SendAsync<TRpcResult>(RpcMethod method)
Parameters
Type Name Description
RpcMethod method
Returns
Type Description
Task<RpcResponse<TRpcResult>>
Type Parameters
Name Description
TRpcResult

SendJsonAsync<TRpcResult>(String)

Declaration
public async Task<RpcResponse<TRpcResult>> SendJsonAsync<TRpcResult>(string json)
Parameters
Type Name Description
System.String json
Returns
Type Description
Task<RpcResponse<TRpcResult>>
Type Parameters
Name Description
TRpcResult

SendRpcRequestAsync<TRpcResult>(RpcMethod)

Sends the RPC method received as argument to the network and returns an RPC response object.

Declaration
public async Task<RpcResponse<TRpcResult>> SendRpcRequestAsync<TRpcResult>(RpcMethod method)
Parameters
Type Name Description
RpcMethod method
Returns
Type Description
Task<RpcResponse<TRpcResult>>
Type Parameters
Name Description
TRpcResult
In This Article
Back to top Maintained by MAKE Technology LLC