I am getting the following error using ethers.js version 6 while getting the total transaction counts.

TypeError: wallet.getTransactionCount is not a function

1 Answer 1


getTransactionCount is changed to getNonce in ethers.js version 6.

For ethers.js version 5;

const nonce = await wallet.getTransactionCount()

For ethers.js version 6;

const nonce = await wallet.getNonce()

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.