y-pakorn / flutter_web3

Web3 Ethereum, Etherjs and Wallet Connect wrapper for Flutter Web.
Other
136 stars 46 forks source link

Support for encodeFunctionData or equivalent? #15

Closed ordinatorix closed 3 years ago

ordinatorix commented 3 years ago

how to implement function encoder?

interface.encodeFunctionData( fragment [ , values ] ) ⇒ string< DataHexString >

or is there a way to achieve the same with [defaultAbiCoder]

y-pakorn commented 3 years ago

Already available in utils branch (Lastest pre-release).

Or you can encode function signature and data separately. Use EthUtils.id(functionSig) for function signature and abiCoder.encode(types, values) for data.

ordinatorix commented 3 years ago

Already available in utils branch (Lastest pre-release).

Awesome, that worked! Thanks