buildJsonRPCParams static method

Map<String, dynamic> buildJsonRPCParams({
  1. required int requestId,
  2. required String method,
  3. Object? params,
})

Builds a JSON-RPC request object.

  • requestId: The ID of the request.
  • method: The RPC method being called.
  • params: Optional parameters for the RPC call.

Returns: A map representing the JSON-RPC request.

Implementation

static Map<String, dynamic> buildJsonRPCParams({
  required int requestId,
  required String method,
  Object? params,
}) {
  return {
    "jsonrpc": "2.0",
    "method": method,
    "params": params,
    "id": requestId
  };
}