-
Notifications
You must be signed in to change notification settings - Fork 196
docs: updating client page and adding to auth section #2078
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
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🌿 Documentation Preview
|
transport: alchemy({ apiKey: "your-alchemy-api-key"}), | ||
chain: sepolia, | ||
signer: LocalAccountSigner.privateKeyToAccountSigner( | ||
"0x-your-wallet-private-key", | ||
), | ||
policyId: "your-policy-id", | ||
}; |
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.
Missing indentation here, looks funny in the preview.
import React from "react"; | ||
import { useSmartAccountClient } from "@account-kit/react"; | ||
|
||
const { client } = useSmartAccountClient({}); |
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.
We don't want this to be the "client" that the end-user is using, we want it to either be wrapped in a specific action like the useSendCalls
hook, or wrapped in the useSmartWalletClient
hook. If we end the guide here, they will likely assune this client is what they should use, and try to call .sendUserOperation
or similar.
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.
Hmm okay. Then what would you suggest we use as the example for react and react native? No client example?
I don't rlly know what the recommendation is for this case i guess
import React from "react"; | ||
import { useSmartAccountClient } from "@account-kit/react"; | ||
|
||
const { client } = useSmartAccountClient({}); |
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.
Same here as above
- `"ModularAccountV2"` (recommended and default) | ||
- `"LightAccount"` | ||
- `"MultiOwnerLightAccount"` | ||
- `"MultiOwnerModularAccount"` |
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.
We should remove MultiOwnerModularAccount
from the list here
| Simulate user operations before sending (i.e. use [`alchemyUserOperationSimulator`](/wallets/reference/account-kit/infra/functions/alchemyUserOperationSimulator)) | `useSimulation` | `boolean` | | ||
| Custom middleware to run before requesting sponsorship | `customMiddleware` | `ClientMiddlewareFn` | | ||
| Override fee estimation middleware (if you are using our RPCs, it's important to use the default [`alchemyFeeEstimator`](/wallets/reference/account-kit/infra/functions/alchemyFeeEstimator)) | `feeEstimator` | `ClientMiddlewareFn` | | ||
| Override gas estimation middleware (the default middleware calls the underlying bundler RPC to `eth_estimateUserOperationGas`) | `gasEstimator` | `ClientMiddlewareFn` | | ||
| Override middleware that signs user operation(s) | `signUserOperation` | `ClientMiddlewareFn` | |
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.
I don't think any of these are valid options - they won't change the behavior of the resulting SmartWalletClient
.
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.
And actually, these aren't valid options to pass to the JS client at all
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.
Oh really? we used to have these documented - when did that change?
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.
Are the advanced account params still valid like passing 7702?
docs/docs.yml
Outdated
- page: Set up client | ||
path: wallets/pages/concepts/smart-account-client.mdx |
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.
Imo we should leave this at the bottom - the setup provided in all of the other examples is more direct and gets the job done, I'd rather people view those first. This doc goes deeper into client config, which is likely a follow-up action after getting it to work at all.
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.
Interesting. Would you rename this to something like Congifure client then? My concern was that we throw people into example and they have to look at the client.ts file and use it but dont actually know what it is
…form/aa-sdk into ava/update-sa-client
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.
Looks good!
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 focuses on updating documentation related to the
Smart Account Client
, enhancing clarity and usability for developers interacting with smart wallets.Detailed summary
Smart Account Client
documentation.SmartWalletClient
description and its functionalities.React
andJavaScript
usage.