Estimate Fee Options

Gas is complicated. Use this function to make it less complicated.

The SDK provides a function that returns a set of fee options which can be passed in when sending a transaction.

txOptions = await peanut.setFeeOptions({
                            chainId: '137',
                            provider: undefined //optional arg for ethers provider
                        })

And returns an interface like this:

interface ISetFeeOptionsResponse {
    gasPrice: string
    gasLimit: string
    maxPriorityFeePerGas: string
    maxFeePerGas: string
} 

Last updated