another one try to fix the metamask inner state

Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
Uncle Fatso 2026-05-11 14:17:47 +03:00
parent e583a591f1
commit 1eefdfc7ca
Signed by: f4ts0
GPG Key ID: 565F4F2860226EBB
2 changed files with 2 additions and 17 deletions

View File

@ -1,7 +1,7 @@
{
"name": "ghost-dao-interface",
"private": true,
"version": "0.7.45",
"version": "0.7.46",
"type": "module",
"scripts": {
"dev": "vite",

View File

@ -9,7 +9,6 @@ import {
FTSO_DAI_LP_ADDRESSES,
WETH_ADDRESSES,
} from "../constants/addresses";
import { isNetworkLegacyType } from "../constants";
import { config } from "../config";
import { tokenNameConverter } from "../helpers/tokenConverter";
@ -207,17 +206,6 @@ export const getTokenPurchaseLink = (chainId, tokenAddress, chainName) => {
return purchaseUrl;
}
const sanitizeTransactionRequest = (request, isLegacy) => {
const finalRequest = { ...request };
if (isLegacy) {
delete finalRequest.maxFeePerGas;
delete finalRequest.maxPriorityFeePerGas;
} else {
delete finalRequest.gasPrice;
}
return finalRequest;
}
export const executeOnChainTransaction = async ({
chainId,
abi,
@ -229,7 +217,6 @@ export const executeOnChainTransaction = async ({
value
}) => {
try {
const isLegacy = isNetworkLegacyType(chainId);
const { request } = await simulateContract(config, {
abi,
address,
@ -238,11 +225,9 @@ export const executeOnChainTransaction = async ({
account,
chainId,
value,
type: isLegacy ? 'legacy' : 'eip1559',
});
const finalRequest = sanitizeTransactionRequest(request, isLegacy);
const txHash = await writeContract(config, { ...finalRequest });
const txHash = await writeContract(config, request);
await waitForTransactionReceipt(config, {
hash: txHash,
onReplaced: () => toast(messages.replacedMsg),