-
Notifications
You must be signed in to change notification settings - Fork 142
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
How to use the Graphite Merge QueueAdd 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. |
There was a problem hiding this 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. |
There was a problem hiding this comment.
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
.
* 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). |
There was a problem hiding this comment.
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
Co-authored-by: jakehobbs <[email protected]>
Pull Request Checklist
yarn test
)site
folder, and guidelines for updating/adding docs can be found in the contribution guide)feat!: breaking change
)yarn lint:check
) and fix any issues? (yarn lint:write
)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
useLogout
,useConnection
,useConnect
,useAuthModal
,useSignerStatus
,useSigner
,useWaitForUserOperationTransaction
,useUiConfig
,useAddPasskey
,useSignTypedData
,useClientActions
,useDropAndReplaceUserOperation
,useExportAccount
,useUser
,useBundlerClient
,useAuthenticate
,useSendUserOperation
,useChain
,useSignMessage
,useAccount
, anduseSmartAccountClient
.