dmihal / eth-permit

Lightweight library for signing ERC-2612 permit signatures.
https://www.npmjs.com/package/eth-permit
139 stars 30 forks source link

Add support for local signer #11

Open ryanc414 opened 2 years ago

ryanc414 commented 2 years ago

Hey, this looks like a really useful library as getting permit txs right can be confusing!

It seems to me that the library is designed to be used on the client-side in conjunction with a remote signer. However sometimes it is useful to sign transactions from the backend, using e.g. https://github.com/MetaMask/eth-sig-util. It would be useful if there was a function within eth-permit which constructed the typedData and returned it without signing, allowing the calling code to decide how it should be signed.

I think this could be achieved by exporting the createTypedERC2612Data function as public, and similar for the Dai version. What do you think?