From e0eb85e79245ab7988da52552969d27df6a93a6e Mon Sep 17 00:00:00 2001 From: Andrew Morris Date: Wed, 13 Sep 2023 14:39:50 +1000 Subject: [PATCH 1/2] Ignore .vite --- demos/inpage/.gitignore | 2 ++ 1 file changed, 2 insertions(+) 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 From 717820732460b00f14917e014df394de424e6b58 Mon Sep 17 00:00:00 2001 From: Andrew Morris Date: Wed, 13 Sep 2023 15:28:08 +1000 Subject: [PATCH 2/2] Also check the new account has txCount===0 --- demos/inpage/src/EthereumApi.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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; } }