diff --git a/demos/inpage/.gitignore b/demos/inpage/.gitignore index d9aa86cf..6ae0b39c 100644 --- a/demos/inpage/.gitignore +++ b/demos/inpage/.gitignore @@ -22,3 +22,5 @@ dist-ssr *.njsproj *.sln *.sw? + +.vite diff --git a/demos/inpage/src/EthereumApi.tsx b/demos/inpage/src/EthereumApi.tsx index 77759ccd..b8fafafe 100644 --- a/demos/inpage/src/EthereumApi.tsx +++ b/demos/inpage/src/EthereumApi.tsx @@ -290,7 +290,12 @@ export default class EthereumApi { parsedTx.data.to, ); - if (recipientBalance === 0n) { + const txCount = + await this.#waxInPage.ethersProvider.getTransactionCount( + parsedTx.data.to, + ); + + if (recipientBalance === 0n && txCount === 0) { gas += extraGasForTransferToNewAddress; } }