snapshot-labs / sx-ui

An open source interface for Snapshot X protocol.
https://snapshotx.xyz
MIT License
34 stars 29 forks source link

feat: add WalletConnect execution #854

Closed Sekhmet closed 8 months ago

Sekhmet commented 9 months ago

Summary

Closes: https://github.com/snapshot-labs/sx-ui/issues/386

Looking for approach/design approvals foremost.

How to test

  1. Go to treasury page of this space: http://localhost:8080/#/sep:0xeb8ea538c90d2e009460ed69add7025560e18481/treasury
  2. Go to Uniswap on speolia: https://app.uniswap.org/swap?chain=sepolia
  3. Connect both, create some execution.

Screenshots

image image image image image
bonustrack commented 9 months ago

index-b727bc3d.js:573 Uncaught (in promise) Error: Non conforming namespaces. approve() namespaces chains don't satisfy required namespaces. Required: eip155:1 Approved: eip155:11155111

Sekhmet commented 9 months ago

Should work now, I wasn't able to test with Aave because WalletConnect doesn't open on that URL.

bonustrack commented 9 months ago

It work for me now on Uniswap but only to swap ETH to UNI, when I try to wrap ETH to WETH it doesnt trigger a new transaction.

For the flow what would be better is to keep the WalletConnect connection alive regardless of the page you staying on SX, currently if I change page it will break connection. Also when I trigger a new tx on Uniswap (or other app) we should show a modal with "Add transaction" populated with the tx and confirm button, and this even if I'm still on the treasury page. We should redirect user to proposal creation page only if user confirm the new tx.

Otherwise modal title should be "Connect to apps"

Sekhmet commented 9 months ago

For the flow what would be better is to keep the WalletConnect connection alive regardless of the page you staying on SX, currently if I change page it will break connection.

I'm not sure how to handle that UX-wise. Connection needs to be per-space (because we are connecting to app as treasury from specific space). So what happens if we navigate from the space? And if we navigate from it how do we disconnect? If we put the button on topnav it might end up being confusing (as it doesn't look space-specific anymore).

Do you think any specific idea in mind?

bonustrack commented 9 months ago

If I have a connection on space A and I move to another space B then we wont see the connection in WC modal, another session can be started from space B in parallel of the first space A connection. But if you confirm a transaction you get redirected to the editor for the correct space where connection was initiated. Would this works?

bonustrack commented 9 months ago

Looks good! Some others improvements:

image
Sekhmet commented 9 months ago

@bonustrack Uniswap updated their metadata on WalletConnect and their image they return first no longer resolves.

bonustrack commented 9 months ago

Ok then no worry will probably be fixed at some point

bonustrack commented 8 months ago

Somehow something is wrong with the background, showing white color on scroll see: https://www.loom.com/share/8a6dbcd305c84c108ce6cf857af58fe7

I'm now able to add multiple txs, but it's hard to review what's the tx is about, what I recommend is to show this modal directly when a new tx is triggered:

image
Sekhmet commented 8 months ago

Somehow something is wrong with the background, showing white color on scroll see: https://www.loom.com/share/8a6dbcd305c84c108ce6cf857af58fe7

This was fixed there: https://github.com/snapshot-labs/sx-ui/pull/858