another one try to fix the metamask inner state
Signed-off-by: Uncle Fatso <uncle.fatso@ghostchain.io>
This commit is contained in:
parent
e583a591f1
commit
1eefdfc7ca
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "ghost-dao-interface",
|
||||
"private": true,
|
||||
"version": "0.7.45",
|
||||
"version": "0.7.46",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@ -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),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user