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

feat: Change the return value of the connect function to Promise<AccountInfo | null> #243

Closed
wants to merge 1 commit into from

Conversation

livetOwO
Copy link

A Pull Request has been created to enable various operations without the necessity of using useEffect after invoking the connect function in the wallet-adapter-react library.

related docs:

@livetOwO livetOwO requested a review from a team as a code owner March 18, 2024 05:17
@gregnazario gregnazario requested a review from 0xmaayan April 1, 2024 20:42
@0xmaayan
Copy link
Collaborator

0xmaayan commented Apr 2, 2024

Thank you for the contribution.

A Pull Request has been created to enable various operations without the necessity of using useEffect after invoking the connect function in the wallet-adapter-react library.

The React provider package updates the account state on a connect event and that bubbles down to the end user.
The end user (dapp) should use the account state provided by the provider to manage the current connected account

This is a Wallet standard, i.e a Wallet must return AccountInfo on connect method

Therefore, I am not completely convinced this change is needed. Could you clarify more the use case and the need for this change?

@livetOwO
Copy link
Author

livetOwO commented Apr 4, 2024

@0xmaayan
Thank you for the comment

My service collects from amplitude and Google Analytics that the user connected their wallet immediately after connecting.
At the same time, it requests a session to the service using signMessage.
Because of this, I need to return a promise or have a callback function.
The reason I need to return the account is because I don't want to use signMessage without any usage effect.

@livetOwO livetOwO closed this May 8, 2024
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