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

Init wagmi and connect wallet functionality #17

Merged
merged 4 commits into from
Nov 7, 2024
Merged

Conversation

rccsousa
Copy link
Collaborator

@rccsousa rccsousa commented Nov 7, 2024

Why

Wordle3 didn't have the proper wallet connection logic to enable players to connect and interact with the game.

How

  • By adding Wagmi and TanStack Query to enable wallet interaction wrapping App.jsx on the respective providers.
  • Also creates a custom ConnectWallet component that passes on the respective address for smart contract interaction. Style to be added later.

Also adds new publicclients for future usage.

## Why
Wordle3 didn't have the proper wallet connection logic to enable players
to connect and interact with the game.
## How
By adding Wagmi and TanStack Query to enable wallet interaction wrapping
App.jsx on the respective providers. Also creates a custom ConnectWallet
component that passes on the respective address for smart contract
interaction. Style to be added later.

Also adds new publicclients for future usage.
Comment on lines +10 to +14
connectors: [
injected(),
metaMask(),
safe(),
]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

added these for the time being, but more can be added later. wagmi also auto-detects wallets.

Copy link
Member

@DavideSilva DavideSilva left a comment

Choose a reason for hiding this comment

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

👍

## Why
Wordle3 hooks were using a local account strucutre that had to
destructure the account into `account.address` in order to separate
address and private key which is not what will happen in production.
## How
By refactoring the hooks' argument to stop destructuring the account as
`WagmiProvider` passes the correct data structure to work as intended.
@rccsousa rccsousa merged commit 098fa60 into main Nov 7, 2024
2 checks passed
@rccsousa rccsousa deleted the rs/add-wallet-client branch November 7, 2024 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants