getNonce method
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 {
String? walletAddr = await Wallet.pubKeyToWalletAddr(this.publicKey);
int? resp = await _methodChannel.invokeMethod('getNonce', {
'_id': this.address,
'address': walletAddr,
'txPool': txPool,
});
return resp;
} catch (e) {
rethrow;
}
}