readFromContractWithFirstResult static method
Future<BigInt>
readFromContractWithFirstResult({
- required Web3Client client,
- required String contractName,
- required EthereumAddress contractAddress,
- required String methodName,
- required List params,
Reads data from a specified contract and returns the first result as BigInt.
client
- The Web3Client instance to use for reading data.
contractName
- Name of the contract (for clarity and potentially for use in other functions).
contractAddress
- Address of the contract.
methodName
- Name of the method to call on the contract.
params
- List of parameters to pass to the contract method.
Returns the first result of the contract call as a BigInt.
Implementation
static Future<BigInt> readFromContractWithFirstResult({
required Web3Client client,
required String contractName,
required EthereumAddress contractAddress,
required String methodName,
required List<dynamic> params,
}) async {
final response = await readFromContract(
client,
contractName,
contractAddress,
methodName,
params,
);
return response.first as BigInt;
}