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: updated account kit react hook docs #1321

Merged
merged 7 commits into from
Feb 4, 2025

Conversation

aashkrishnan
Copy link
Collaborator

@aashkrishnan aashkrishnan commented Feb 4, 2025

Pull Request Checklist


PR-Codex overview

This PR enhances documentation across various hooks in the account-kit/react package. It adds links to the hook definitions, clarifies descriptions, and provides references to relevant parts of the codebase for better understanding and navigation.

Detailed summary

  • Added links to hook documentation in comments for useLogout, useConnection, useConnect, useAuthModal, useSignerStatus, useSigner, useWaitForUserOperationTransaction, useUiConfig, useAddPasskey, useSignTypedData, useClientActions, useDropAndReplaceUserOperation, useExportAccount, useUser, useBundlerClient, useAuthenticate, useSendUserOperation, useChain, useSignMessage, useAccount, and useSmartAccountClient.
  • Improved descriptions for clarity, including usage notes and additional context.
  • Added references to specific lines in the codebase for better navigation.

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

Copy link

vercel bot commented Feb 4, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
aa-sdk-site 🛑 Canceled (Inspect) Feb 4, 2025 7:33pm
aa-sdk-ui-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 4, 2025 7:33pm

Copy link

graphite-app bot commented Feb 4, 2025

How to use the Graphite Merge Queue

Add the label graphite-merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

jakehobbs
jakehobbs previously approved these changes Feb 4, 2025
Copy link
Member

@jakehobbs jakehobbs left a comment

Choose a reason for hiding this comment

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

Such a big improvement! Left a few small comments, but preemptively approved.

* Custom hook to get a bundler client using the Alchemy account context.
* It uses `useSyncExternalStore` to watch for any changes in the bundler client configuration and provides the updated bundler client.
* Custom [hook](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/react/src/hooks/useBundlerClient.ts) to get a bundler client using the Alchemy account context.
* It uses `useSyncExternalStore` to watch for any changes in the bundler client configuration and provides the updated bundler client. React hooks don’t manage their own states, so they depend on an external store other than manage state, such as `useSyncExternalStore`. useBundlerClient’s only job is to call the bundler JSON RPC methods directly; it does not do additional processing, unlike useSmartAccountClient. For example, if you call sendUserOperation, it expects a fully formed user operation.
Copy link
Member

Choose a reason for hiding this comment

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

nit: this sentence is confusing to me, but maybe i'm reading it wrong:

React hooks don’t manage their own states, so they depend on an external store other than manage state, such as useSyncExternalStore.

account-kit/react/src/hooks/useExportAccount.ts Outdated Show resolved Hide resolved
* Hook for signing typed data, supporting both connected accounts and clients.
* Similar to `useSignMessage`, [hook](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/react/src/hooks/useSignTypedData.ts) for signing typed data, supporting both connected accounts and clients in EIP 712 format.
*
* Uses `eth_signtypedmessage` to sign structured, typed data. Accepts typed, complex data structures as input. Like `useSignMessage`, this hook also handles deployed (1271) and undeployed accounts (6492).
Copy link
Member

Choose a reason for hiding this comment

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

should this be eth_signTypedData instead of eth_signtypedmessage?

https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md

account-kit/react/src/hooks/useSigner.ts Outdated Show resolved Hide resolved
@aashkrishnan aashkrishnan merged commit d8bf4b2 into main Feb 4, 2025
7 checks passed
@aashkrishnan aashkrishnan deleted the ash/update-account-kit-react-hook-docs branch February 4, 2025 23:39
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