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

docs: update the magic docs to highlight signer creation is async #170

Merged
merged 2 commits into from
Oct 26, 2023

Conversation

moldy530
Copy link
Collaborator

@moldy530 moldy530 commented Oct 24, 2023

PR-Codex overview

Detailed summary

This PR focuses on updating the magicSigner import and usage in the code. The notable changes include:

  • Renamed the import from magicSigner to createMagicSigner
  • Updated the owner assignment to use await createMagicSigner() instead of magicSigner
  • Added an async function createMagicSigner that authenticates the user and creates a WalletClientSigner object using the magic SDK and magicClient

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

denniswon
denniswon previously approved these changes Oct 25, 2023
export const magicClient = createWalletClient({
transport: custom(magic.rpcProvider),
Copy link
Contributor

Choose a reason for hiding this comment

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

this one doesn't work? did not look into magic code, but why is getting rpc provider async here?
hmm, and just using rpcProvider field directly seems to work fine on examples I tried.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yea I'm not sure why this didn't work for a customer... maybe it was because you have to authenticate with a user first?

lemme take another pass at this and make it even more clear that authentication is required first

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

in the unauthed case .rpcProvider was returning undefined

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm I didn't need to do this if I mapped the magicClient to any for the new WalletClientSigner below:

https://github.com/alchemyplatform/aa-simple-dapp/blob/a71b0b78/src/hooks/useMagicSigner.ts#L17

Copy link
Contributor

@avasisht23 avasisht23 left a comment

Choose a reason for hiding this comment

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

unblocking, but yeah curious why it needs to be async

@moldy530
Copy link
Collaborator Author

needs to be async because the method to auth with magic is async. if you don't auth first then you get errors when connecting the account and using it. to make it simpler, I think we should just recommend that people auth first before connecting

@moldy530 moldy530 merged commit 22bc4f4 into main Oct 26, 2023
2 checks passed
@moldy530 moldy530 deleted the moldy/magic-docs-update branch October 26, 2023 18:23
moldy530 added a commit that referenced this pull request Oct 30, 2023
* docs: update the magic docs to highlight signer creation is async

* docs: update the magic docs to highlight signer creation is async
avasisht23 pushed a commit that referenced this pull request Nov 3, 2023
* docs: update the magic docs to highlight signer creation is async

* docs: update the magic docs to highlight signer creation is async
@moldy530 moldy530 mentioned this pull request Nov 10, 2023
moldy530 added a commit that referenced this pull request Nov 10, 2023
* docs: update the magic docs to highlight signer creation is async

* docs: update the magic docs to highlight signer creation is async
avasisht23 pushed a commit that referenced this pull request Nov 14, 2023
* docs: update the magic docs to highlight signer creation is async

* docs: update the magic docs to highlight signer creation is async
avasisht23 pushed a commit that referenced this pull request Nov 14, 2023
* docs: update the magic docs to highlight signer creation is async

* docs: update the magic docs to highlight signer creation is async
denniswon pushed a commit that referenced this pull request Nov 16, 2023
* docs: update the magic docs to highlight signer creation is async

* docs: update the magic docs to highlight signer creation is async
moldy530 added a commit that referenced this pull request Nov 16, 2023
* docs: update the magic docs to highlight signer creation is async

* docs: update the magic docs to highlight signer creation is async
@moldy530 moldy530 mentioned this pull request Nov 17, 2023
7 tasks
@moldy530 moldy530 mentioned this pull request Dec 1, 2023
8 tasks
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.

3 participants