cowprotocol / cow-sdk

CoW protocol SDK
https://docs.cow.fi/cow-protocol/reference/sdks/cow-sdk
Other
31 stars 9 forks source link

Support viem #188

Open devanoneth opened 9 months ago

devanoneth commented 9 months ago

viem is gaining traction over ethers. I think it would be beneficial for SDK adoption to support both ethers and viem.

You could accept a viem walletClient or account as well as an ethers Signer for order signing: https://github.com/cowprotocol/cow-sdk/blob/main/src/order-signing/utils.ts

This could either be done via function overloading or new functions directly.

I guess it's also worth considering then publishing a separate ethers or viem cow-sdk package because I see the SDK is currently referencing ethers as a peer dependency.

If you can comment some pointers on which design you'd prefer, I'd be happy to open a PR.