accountNextIndex method

Future<int> accountNextIndex(
  1. String account
)

Returns the next valid index (aka nonce) for given account.

This method takes into consideration all pending transactions currently in the pool and if no transactions are found in the pool it fallbacks to query the index from the runtime (aka. state nonce).

Implementation

Future<int> accountNextIndex(String account) async {
  final response = await _provider.send('system_accountNextIndex', [account]);
  return response.result as int;
}