const { runContractFunction: approve, data: enterTxResponse, error, isLoading, isFetching } = useWeb3Contract({
// chain: "eth",
contractAddress: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
abi: ABI,
functionName: "approve",
params: {
_spender: "0xc.....",
_value: 1,
},
}
);
//gasprice
const gas = async () => {
const tx = await contract.approve(_spender, _value, [], {
gasLimit: 100000,
nonce: nonce || undefined,
});
};
const Web3Api = useMoralisWeb3Api();
const allowace = async () => {
//Get token allowace on ETH
const options = {
//token holder
_owner: user,
//uniswap v3 router 2 contract address
_spender: "0xc....",
//ENS token contract address
contractAddress: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
};
const allowance = await Web3Api.token.getTokenAllowance(options);
console.log(allowance);
};
please i still got the same error.