call method

Future<String> call({
  1. String? sender,
  2. required String contractAddress,
  3. required Uint8List data,
  4. BlockNum? atBlock,
})

Implementation

Future<String> call({
  String? sender,
  required String contractAddress,
  required Uint8List data,
  BlockNum? atBlock,
}) async {
  final response = await _call<String>(
    'eth_call',
    args: [
      {
        if (sender != null) 'from': sender,
        'to': contractAddress,
        'data': "0x${data.toHex}",
      },
      atBlock?.toBlockParam() ?? 'latest',
    ],
  );

  return response;
}