Skip to content

Commit 05c8356

Browse files
committed
docs: updated react account kit hooks
1 parent 796d0d7 commit 05c8356

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

account-kit/react/src/hooks/useAccount.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,11 @@ export type UseAccountProps<TAccount extends SupportedAccountTypes> =
3232

3333
/**
3434
* [Hook](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/react/src/hooks/useAccount.ts) to subscribe to account state and interactions, including creation, connection, and status monitoring. It synchronizes with external store updates and provides status-dependent results.
35-
* The supported account types are: LightAccount, MultiOwnerLightAccount, and MultiOwnerModularAccount. Primarily used to get the smart account address before deployment. Dependent on the signer, if the signer has not been initialized and authenticated, address and isLoadingAccount return null.
36-
* If using a smart contract account, returns instance of a smart contract account that the user is connected to. Returns address of smart contract account, not address of the signer. If using an EOA, returns address of signer
35+
* The supported account types are: LightAccount, MultiOwnerLightAccount, and MultiOwnerModularAccount. Primarily used to get the smart account address before deployment. Dependent on the signer: if the signer has not been initialized and authenticated, `address` and `isLoadingAccount` return null.
36+
*
37+
* If using a smart contract account, returns instance of a smart contract account that the user is connected to. Returns address of smart contract account, not address of the signer.
38+
*
39+
* If using an EOA, returns address of signer
3740
*
3841
* @example
3942
* ```ts

account-kit/react/src/hooks/useAuthenticate.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ export type UseAuthenticateResult = {
3131
*
3232
* This can be complex for magic link or OTP flows: OPT calls authenticate twice, but this should be handled by the signer.
3333
*
34-
* An example flow, we kick off useAuthenticate with authenticateAsync: we fire off to an incognito window to get a session from a backend. We listen to the signer or smart contract account client state to make sure the address is defined. And onSuccess, we redirect to a new view, which might be gated on useSmartAccountClient and a defined address.
35-
*
3634
* @example
3735
* ```ts
3836
* import { useAuthenticate } from "@account-kit/react";

account-kit/react/src/hooks/useExportAccount.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export type UseExportAccountResult = {
3939

4040
/**
4141
* A [hook](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/react/src/hooks/useExportAccount.ts) use to export the private key for an account. It returns the mutation functions to kick off the export process, as well as a component to render the account recovery details in an iframe.
42+
* What is returned is dependent on what you used most recently used to authenticate. If your session was initiated with a passkey, then a private key is returned. Otherwise, a seed phrase.
4243
*
4344
* @example
4445
* ```ts
@@ -58,7 +59,7 @@ export type UseExportAccountResult = {
5859
* ```
5960
*
6061
* @param {UseExportAccountMutationArgs} args Optional arguments for the mutation and export parameters. [ref](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/react/src/hooks/useExportAccount.ts#L11)
61-
* @returns {UseExportAccountResult} An object containing the export state, possible error, and the export account function and component. [ref](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/react/src/hooks/useExportAccount.ts#L32)
62+
* @returns {UseExportAccountResult} An object containing the export state, possible error, and the export account function and component. [ref](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/react/src/hooks/useExportAccount.ts#L32)*
6263
*/
6364
export function useExportAccount(
6465
args?: UseExportAccountMutationArgs

account-kit/react/src/hooks/useSigner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { useAlchemyAccountContext } from "../context.js";
77

88
/**
99
* [Hook](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/react/src/hooks/useSigner.ts) for accessing the current Alchemy signer within a React component. It uses a synchronous external store for updates.
10-
* This is a good use case if you want to use the signer as an EOA, giving you direct access to it.
10+
* This is a good use case if you want to use the signer as an EOA, giving you direct access to it. The signer returned from `usSigner` just does a `personal_sign` or `eth_signTypedData` without any additional logic, but a smart contract account might have additional logic for creating signatures for 1271 validation so `useSignMessage` or `useSignTypeData` instead.
1111
*
1212
* @example
1313
* ```ts

0 commit comments

Comments
 (0)