getTransactionCount method
Transaction count, returns the number of transactions sent from an address.
Implementation
Future<int> getTransactionCount(
BigInt address, MoacDefaultBlock block) async {
if (address == null) {
throw ArgumentError.notNull("Moac::getTransactionCount - address");
}
if (block == null) {
throw ArgumentError.notNull("Moac::getTransactionCount - block");
}
final String method = MoacRpcMethods.transactionCount;
final String blockString = block.getSelection();
final List params = [MoacUtilities.bigIntegerToHex(address), blockString];
final res = await rpcClient.request(method, params);
if (res != null && res.containsKey(moacResultKey)) {
return MoacUtilities.hexToInt(res[moacResultKey]);
}
_processError(method, res);
return null;
}