ethers.js icon indicating copy to clipboard operation
ethers.js copied to clipboard

Expose encodeFunctionData and decodeFunctionResult as properties on the contract method

Open cosullivan opened this issue 9 months ago • 1 comments

Describe the Feature

I have some scenarios were I need to call encodeFunctionData() and decodeFunctionResult() and whilst I can do this via the Interface, it would be nice to expose these as properties on the method just like there is;

testContract.testMethod.staticCall(...)
testContract.testMethod.estimateGas(...)

it would be nice to have these;

testContract.testMethod.encodeFunctionData(...)
testContract.testMethod.decodeFunctionResult(...)

The code pretty much exists already in the buildWrappedMethod function.

Code Example

No response

cosullivan avatar May 30 '24 05:05 cosullivan