getNonce method

Future<int?> getNonce({
  1. bool txPool = true,
})

getNonce RPC gets the next nonce to use of an address. If txPool is false, result only counts transactions in ledger; if txPool is true, transactions in txPool are also counted.

Implementation

Future<int?> getNonce({bool txPool = true}) async {
  try {
    return await _methodChannel.invokeMethod('getNonce', {
      'address': this.address,
      'txPool': txPool,
      'seedRpc':
          this.walletConfig.seedRPCServerAddr ?? [DEFAULT_SEED_RPC_SERVER],
    });
  } catch (e) {
    rethrow;
  }
}