const { runContractFunction: approve, data: enterTxResponse, error, isLoading, isFetching } = useWeb3Contract({
// chain: "eth",
contractAddress: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
abi: ABI,
functionName: "approve",
params: {
_spender: "0xc....",
_value: 1000000,
},
},
);
// gasprice
const gas = async () => {
const web3Provider = await Moralis.enableWeb3();
const gasPrice = await web3Provider.getGasPrice();
const signer = web3Provider.getSigner();
const contract = new ethers.Contract("0xdAC17F958D2ee523a2206206994597C13D831ec7", ABI, signer);
const tx = await contract.approve({
value: 1000000,
gasPrice: gasPrice,
gasLimit: 21000,
})
await tx.wait();
};