-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add wallet connection functionality #40
Conversation
* feat: set up ui elements for wallet connect * set up account avatar function * structure connect wallet modal * more ui updates for wc modal * wip provider utils * mm connection wip * linter * semi-working MM connection flow * Implement Metamask connection * minor alignment css * Add WIP WC functionality * Refactor useprovider fxn * Add link to help center for nowallet * Clean up useProvider * Fix WalletConnect; need window.Buffer polyfill * Fix WC connection * Add mainnet RPC URL fallback constant * Leave TODOs for readability * Leave TODOs for readability * Another todo * Update yarn.lock * Update .nvmrc for new @node/types * Better modal layout UI * Only use wallet if wallet is active * Update yarn.lock * Should only use our own flow iff provider & callbacks not given * fix: refactor wallet connection components (#33) * Refactor connect wallet into a separate component, and rename connect wallet callbacks * Rename callbacks * Fixes from PRs * Remove fallback JSON RPC URL logic; move to separate PR * Move web3 connection-related hooks into new folder * Rename and move connect web3-related hooks * fix: move updating Web3Context into hook (#34) * wip * Move context s.t. context is not exposed * Clean commit * Connect eagerly on mount * Minor css * Move components to Wallet * Rename dialog buttons to wallet name * Put network conditional back (fallback not implemented yet) * Add back disabled prop * Use e.preventDefault to determine opening our connection flow * Clean up unused code * nit * Clean comments * Don't deactivate other wallets before activating this one * Update yarn.lock
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
* Add useENSAvatar from interface, WIP identicon * Only use gradient icon * Remove broken useENSAvatar hook for now * nit: update comments
…b3-react (#38) * Add wip WC QR code; broken on second load * wip: display_uri not fired on second load * Clean code * Add support for both tile & popup WalletConnect * wip: use atom to save QR code between dialog close * Add persisting QR code * Update web3-react, wip handle errors * broken: * Add better RPC URL from props * Clean up code * Handle errors * Clean up URI listeners * Clean up code * Update yarn.lock * Undo force-changes to yarn.lock * Nit * Nit * Address PR comments * nit: rename useConnect handler * remove reportError for new w3r * add } * Rename hooks
* Use w3r's provider * Use provider instead of library * reformat * Finalize changes * Update useWeb3React imports * Rename file * PR review fixes * Remove useConnectCallback fxn * Revert w3r/network version
* feat: add fallback mainnet JSON RPC endpoint * Add better chainId support * Clean up code * nit: remove console .log * PR review updates * Remove console logs
* fix: use safer QR image * Use svg, change width * nit * fix: check staleness before setting state * fix: color match qr code * nit Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
…ur built-in flow" This reverts commit ba31255.
@@ -40,32 +42,36 @@ function getTransactionFromMap( | |||
return | |||
} | |||
|
|||
// SwapProps also currently includes props needed for wallet connection, since the wallet connection component exists within the Swap component | |||
// TODO(kristiehuang): refactor WalletConnection outside of Swap component |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this TODO still relevant?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#123 - let me know if this PR makes sense
Wanted to pull wallet connection out of the Swap component since it's separate concerns -- and also makes it slightly easier to build Buy/Donate/etc widgets in the future
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work, havent gone though everything but just some small comments so far
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks great to me! would wait on approvals from others
* wip tests; timeout? * write tests * Revert yarn.lock * Update tests * add newline * fix: do not log failed connection after unmount * Address PR review * move hardhat account to const * resolve provider toolbar flakiness Co-authored-by: Zach Pomerantz <zzmp@uniswap.org>
🎉 This PR is included in version 2.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Adding wallet connection functionality to widget! This means that every prop is now optional; a new integrator can now see a fully functional swap widget via
<SwapWidget />
😀Remaining PRs that need reviews:
Breaking changes:
Other API changes: