I am trying to estimate gas using ethers. I have tried using
await this.signer.getGasPrice()
but this doesn't take into account my contract's function and my address.I saw that on ethers's documentation they have a function
await provider.estimateGas({ // Wrapped ETH address
to: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", // `function deposit() payable`
data: "0xd0e30db0", // 1 ether
value: parseEther("1.0") });
but this takes transaction data as an input?
How am I supposed to get tranaction data prior to submitting a transaction?