Interface RpcCaller


@Generated("copilot-sdk-codegen") public interface RpcCaller
Interface for invoking JSON-RPC methods with typed responses.

Implementations delegate to the underlying transport layer (e.g., a JsonRpcClient instance). A method reference is typically the clearest way to adapt a generic invoke method to this interface:


 RpcCaller caller = jsonRpcClient::invoke;
 
Since:
1.0.0
  • Method Summary

    Modifier and Type
    Method
    Description
    invoke(String method, Object params, Class<T> resultType)
    Invokes a JSON-RPC method and returns a future for the typed response.
  • Method Details

    • invoke

      <T> CompletableFuture<T> invoke(String method, Object params, Class<T> resultType)
      Invokes a JSON-RPC method and returns a future for the typed response.
      Type Parameters:
      T - the expected response type
      Parameters:
      method - the JSON-RPC method name
      params - the request parameters (may be a Map, DTO record, or JsonNode)
      resultType - the Class of the expected response type
      Returns:
      a CompletableFuture that completes with the deserialized result