PatrickAlphaC / ethers-simple-storage-fcc

90 stars 128 forks source link

wallet.getTransactionCount() is not a function in Ethers v6 #74

Closed lightweightcoder closed 1 year ago

lightweightcoder commented 1 year ago

Just FYI: This line in deploy.js:

const nonce = await wallet.getTransactionCount()

raises this error when I ran node deploy.js:

TypeError: wallet.getTransactionCount is not a function

It seems like the function is deprecated in Ethers v6. I tried this alternative method and I was able to get the transaction count :)

const nonce = await provider.getTransactionCount(<address>)