getSeqNum method

Future getSeqNum({
  1. required String seqName,
})

Gets a sequence number for the given sequence name. It's guaranteed that the returned number of unique across all invocations of this API for the given sequence name. However, multiple clients may invoke this API for the same sequence name, so invoking this API multiple times may NOT result in consecutive numbers.

Implementation

Future getSeqNum({
	required String seqName
}) async {
	var url = '/get-seq-num';
	var params = {
		'seqName': seqName
	};

	var resp = await _invoke(url, params);

	if (resp['result'] != 'OK') throw resp['result'];

	return resp['seqNum'] as int;
}