requestReadContract method

  1. @override
Future<List> requestReadContract({
  1. required DeployedContract deployedContract,
  2. required String functionName,
  3. required String rpcUrl,
  4. EthereumAddress? sender,
  5. List parameters = const [],
})
override

Implementation

@override
Future<List<dynamic>> requestReadContract({
  required DeployedContract deployedContract,
  required String functionName,
  required String rpcUrl,
  EthereumAddress? sender,
  List<dynamic> parameters = const [],
}) async {
  try {
    final results = await Web3Client(rpcUrl, http.Client()).call(
      sender: sender,
      contract: deployedContract,
      function: deployedContract.function(functionName),
      params: parameters,
    );

    return results;
  } catch (e) {
    rethrow;
  }
}