Class RpcClient
The RPC client to send and receive data to the Casper network.
Inheritance
System.Object
RpcClient
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
RpcClient(String, HttpClient)
Declaration
public RpcClient(string nodeAddress, HttpClient client)
Parameters
Type |
Name |
Description |
System.String |
nodeAddress |
|
HttpClient |
client |
|
Methods
Dispose()
Declaration
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
Returns
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 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
Returns
Type Parameters
Name |
Description |
TRpcResult |
|