MoralisWeb3 / react-moralis

Hooks and components to use Moralis in a React app
MIT License
624 stars 166 forks source link

GasLimit in `useWeb3ExecuteFunction` hook #323

Open Belingheri opened 1 year ago

Belingheri commented 1 year ago

New Feature Request

Add the option to set the gasLimit when use the useWeb3ExecuteFunction hook

Checklist

Current Limitation

I cannot run my function on the chain caused by :

cannot estimate gas; transaction may fail or may require manual gas limit

Feature / Enhancement Description

Add in the option:

const { data, error, fetch, isFetching, isLoading } = useWeb3ExecuteFunction({
        abi: abi,
        contractAddress: raffleAddress!,
        functionName: "placeBet",
        params: {
            _roomSize: roomSize,
        },
        msgValue: ethers.utils.parseEther(bet.toString()).toString(),
        gasLimit:xxxx, // new param
    })

Example Use Case

Alternatives / Workarounds

3rd Party References