From 4ea9046abeba2ebf8e86001a7c1e87fb6579d406 Mon Sep 17 00:00:00 2001 From: BokkyPooBah Date: Mon, 29 Apr 2024 12:53:31 +1000 Subject: [PATCH] wip --- docs/online.html | 76 ++++++++++++++++++++++++++++++------------------ 1 file changed, 47 insertions(+), 29 deletions(-) diff --git a/docs/online.html b/docs/online.html index fdd7510..b4aa4a7 100644 --- a/docs/online.html +++ b/docs/online.html @@ -164,9 +164,9 @@ - + - + - + - + - +
- +
- +
- +
{{ prepare.token.symbol }} {{ prepare.token.decimals }} - +
@@ -225,12 +225,21 @@ Refresh - - + + + + - - + + + + + @@ -240,7 +249,7 @@
- +
@@ -250,7 +259,7 @@
- +
@@ -260,7 +269,7 @@
- +
@@ -270,7 +279,7 @@
- +
@@ -431,16 +440,22 @@ // data: null, // signature: null, chainId: null, + chainIdError: null, nonce: null, - estimatedGas: null, + nonceError: null, + estimatedGas: null, // TODO: Delete + gasLimit: null, + transactionType: 2, gasPrice: null, - lastBaseFeePerGas: null, + lastBaseFeePerGas: null, // TODO: Delete maxFeePerGas: null, maxPriorityFeePerGas: null, - gasPriceUnit: "gwei", - lastBaseFeePerGasUnit: "gwei", - maxFeePerGasUnit: "gwei", - maxPriorityFeePerGasUnit: "gwei", + gasUnit: "gwei", + gasPriceUnit: "gwei", // TODO: Delete + lastBaseFeePerGasUnit: "gwei", // TODO: Delete + maxFeePerGasUnit: "gwei", // TODO: Delete + maxPriorityFeePerGasUnit: "gwei", // TODO: Delete + tx: {}, error: null, }, @@ -489,7 +504,7 @@ ], actionOptions: [ - { value: null, text: '(Select)' }, + { value: null, text: '(Select Action)' }, { value: 'ethtransfer', text: 'Transfer Ethers' }, { value: 'erc20transfer', text: 'Transfer ERC-20 Tokens' }, { value: 'erc721transfer', text: 'Transfer ERC-721 Token', disabled: true }, @@ -830,7 +845,7 @@ async prepareSimulate() { console.log(moment().format("HH:mm:ss") + " prepareSimulate: " + JSON.stringify(this.prepare, bigNumberReplacer, 2)); const provider = new ethers.providers.Web3Provider(window.ethereum); - this.prepare.chainId = this.chainId; + this.prepare.chainIdError = this.prepare.chainId != this.chainId && ("Warning - Web3 connected chain: " + this.chainsOptions.filter(e => e.value == this.chainId)[0].text) || null; const tokenInfo = this.prepare.token.address && this.addresses[this.prepare.token.address] || {}; console.log("tokenInfo: " + JSON.stringify(tokenInfo, null, 2)); // console.log("2: " + JSON.stringify(this.addresses[this.prepare.token.address].chains)); @@ -875,14 +890,17 @@ this.prepare.from.tokens = null; this.prepare.to.tokens = null; } + this.prepare.nonceError = null; if (this.prepare.from.address) { this.prepare.from.ensName = this.addresses[this.prepare.from.address].ensName; try { this.prepare.from.transactionCount = await provider.getTransactionCount(this.prepare.from.address); - this.prepare.nonce = this.prepare.from.transactionCount; + // this.prepare.nonce = this.prepare.from.transactionCount; + // if (this.prepare.nonce != this.prepare.from.transactionCount) + this.prepare.nonceError = this.prepare.nonce != this.prepare.from.transactionCount && ("Warning - Nonce <> from.transactionCount: " + this.prepare.from.transactionCount) || null; + } catch (e) { this.prepare.from.transactionCount = null; - this.prepare.nonce = null; // TODO: ? } try { this.prepare.from.balance = await provider.getBalance(this.prepare.from.address);