postWeb3RpcByChainWithHttpInfo method

Future<Response> postWeb3RpcByChainWithHttpInfo(
  1. String chain,
  2. RpcIn rpcIn
)

Forwards a JSON-RPC call to the named chain and returns its answer unchanged.

Forwards a JSON-RPC call to the named chain and returns its answer unchanged. Only declared chains are reachable, and only to a caller with a validated principal — this is the deployment's upstream, not an open relay.

Note: This method returns the HTTP Response.

Parameters:

  • String chain (required): Chain is the registry id, from the URL.

  • RpcIn rpcIn (required):

Implementation

Future<Response> postWeb3RpcByChainWithHttpInfo(String chain, RpcIn rpcIn,) async {
  // ignore: prefer_const_declarations
  final path = r'/v1/web3/rpc/{chain}'
    .replaceAll('{chain}', chain);

  // ignore: prefer_final_locals
  Object? postBody = rpcIn;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  const contentTypes = <String>['application/json'];


  return apiClient.invokeAPI(
    path,
    'POST',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}