Skip to content
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

Added thirdweb ConnectWallet button to LaunchScreen #176

Merged
merged 16 commits into from
Jan 20, 2024

Conversation

cameronvoell
Copy link
Contributor

@cameronvoell cameronvoell commented Dec 13, 2023

Closes #159

Description

This PR adds the ability to connect with accounts from wallet apps via the Thirdweb SDK. The only wallets that were consistently working for me were Rainbow and Metamask so those are the only two options for now.

To Do before removing PR draft state:

  • Fix disconnect + re-connect flows for ConnectWallet button
  • Add example/.env for reading thirdweb API key
  • Update example/README.md

Testing Steps:

  1. Follow new example/README.md steps for obtaining a Thirdweb client id (not mandatory, just clears network errors from SDK when it tries to obtain visual assets)
  2. On a device with either Metamask or Rainbow Wallet installed with at least one account, install Example app and click connect button
  3. Select either Rainbow or Metamask
  4. Should be re-directed to the selected app, click connect when prompted (sometimes takes 5+ seconds)
  5. After connecting you should be re-directed back to the Example app. There should be new options to use the connected wallet on either a dev or local network. Select one.
  6. You should then be re-directed to Connected wallet app and prompted to sign either an enable account prompt, or first a create account and then enable account prompt.
  7. After signing necessary prompts, you should enter the Conversations screen.
  8. If you back out of the conversations Screen, your key information should be in the SAVED WALLET, and you can use that to re-enter.
  9. You can disconnect the wallet app by clicking on the Connect button while it is connected and then clicking the red exit arrow icon.

Log in flow with Metamask or Rainbow via Thirdweb SDK

Connect Button Thirdweb Modal Connect Prompt Loading indicator
Connected Wallet Button Sign Prompt

Note on npm install --legacy-peer-deps and @thirdweb-dev/react-native expo dependency version
As mentioned in the linked issue, re-adding the dependency for @thirdweb-dev/react-native means that we need to always run npm install --force when installing dependencies in the example directory (README.md already includes these instructions). The reason is that @thirdweb-dev/react-native specifies a version for expo dependency that is less than our current version. I left a comment on the thirdweb sdk repo to see if updating this dependency has blockers for any reason => thirdweb-dev/js#1778 (comment)

No longer relevant, as thirdweb is compatible with our version of expo now.

@cameronvoell cameronvoell force-pushed the cameronvoell/example-wallet-auth branch from 417a130 to f64420f Compare December 21, 2023 22:15
@cameronvoell cameronvoell force-pushed the cameronvoell/example-wallet-auth branch 2 times, most recently from 6a81e07 to a11f243 Compare December 22, 2023 19:02
@cameronvoell cameronvoell force-pushed the cameronvoell/example-wallet-auth branch from a11f243 to c00864f Compare January 9, 2024 19:19
@cameronvoell cameronvoell marked this pull request as ready for review January 18, 2024 23:33
@cameronvoell cameronvoell requested review from humanagent and a team as code owners January 18, 2024 23:33
@cameronvoell cameronvoell force-pushed the cameronvoell/example-wallet-auth branch from caec6ed to fc0d7a5 Compare January 18, 2024 23:40
Copy link
Contributor

@nplasterer nplasterer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 👍

@cameronvoell cameronvoell merged commit 1d16938 into main Jan 20, 2024
4 of 5 checks passed
@cameronvoell cameronvoell deleted the cameronvoell/example-wallet-auth branch January 20, 2024 00:47
Copy link
Contributor

🎉 This PR is included in version 1.24.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Example app: Re-add logic to log in on a physical device
2 participants