requestWithContext<T> method
Future<ResultWithContext>
requestWithContext<T>(
- SolanaRPCRequest<
T> request, [ - Duration? timeout
Sends a JSON-RPC request to the solana node and returns the result after processing the response.
request
: The JSON-RPC request to be sent.
timeout
: The maximum duration for waiting for the response.
return value with context if response contains context
Implementation
Future<ResultWithContext> requestWithContext<T>(SolanaRPCRequest<T> request,
[Duration? timeout]) async {
final response = await requestDynamic(request, timeout);
final result = _fetchRequest<T>(request, response);
final context = _fetchContext(response);
return ResultWithContext(result: result, context: context);
}