requestReadContract method
Future<List>
requestReadContract({
- required String? topic,
- required String chainId,
- required DeployedContract deployedContract,
- required String functionName,
- EthereumAddress? sender,
- List parameters = const [],
override
Implementation
@override
Future<List<dynamic>> requestReadContract({
required String? topic,
required String chainId,
required DeployedContract deployedContract,
required String functionName,
EthereumAddress? sender,
List parameters = const [],
}) async {
try {
if (selectedChain == null) {
throw W3MServiceException(
'You must select a chain before reading a contract',
);
}
return await _web3App.requestReadContract(
deployedContract: deployedContract,
functionName: functionName,
rpcUrl: selectedChain!.rpcUrl,
sender: sender,
parameters: parameters,
);
} catch (e) {
rethrow;
}
}