superfluid-finance / widget

https://checkout-builder.superfluid.finance
MIT License
15 stars 9 forks source link

Upgrade to wagmi v2 #245

Open MidnightLightning opened 3 weeks ago

MidnightLightning commented 3 weeks ago

Draft solution to #236. Upgrades libraries to:

vercel[bot] commented 3 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
widget-docs ❌ Failed (Inspect) Oct 7, 2024 6:30pm
widget-reference-docs ✅ Ready (Inspect) Visit Preview Oct 7, 2024 6:30pm
vercel[bot] commented 3 weeks ago

@MidnightLightning is attempting to deploy a commit to the Superfluid Finance Team on Vercel.

A member of the Team first needs to authorize it.

MidnightLightning commented 3 weeks ago

This change gets the bulk of the changes for wagmi v2 in place (renaming of the hooks that changed).

The key things that still need to be changed (and I likely need some direction from the project team on how they want them changed) is the CommandMapper and ContractWriteManager concepts need to be re-evaluated. I think several of the roles they were aiming to fill are now easily done by wagmi or viem directly (so they might not be needed as such an abstract middle layer?).

kasparkallas commented 3 weeks ago

Hey, thanks! I'll take a look at this today.

Regarding the Command abstraction, the main purpose is to capture the intent of the user, and based on that map into transaction when it's time to.

In this proof of concept PR, the value of the abstraction is better captured, as the user can choose whether to batch the transaction or do them incrementally: https://github.com/superfluid-finance/widget/pull/216

If the user doesn't finish the process all the way, and moves back and forth in the widget, or comes back later, as long as the intent is there, we can map it into the correct set of transactions.

So I think the value of the abstraction is still there. wagmi/viem deal with lower level concerns.