listActions method
Implementation
Future<List<ActionDoc>> listActions({
required String operator,
required String name,
String? accountId,
Uint8List? contextId,
int minTxId = 0,
int maxTxId = 0,
int limit = 10,
}) async {
final request = ListActionsRequest()
..name = name
..minTxId = Int64(minTxId)
..maxTxId = Int64(maxTxId)
..limit = Int64(limit);
if (accountId != null) {
request.accountId = hex.decode(accountId);
} else if (contextId != null) {
request.contextId = contextId;
} else {
throw Exception(
'Missing filter, one of `accountId` or `contextId` must be non-null',
);
}
final envelop = await requestEnvelope(request: request);
final response =
await getServiceClient(operator).query.listActions(envelop);
return response.actions.map(ActionDoc.new).toList();
}