-
Notifications
You must be signed in to change notification settings - Fork 167
feat(wip): implement viem compatible SCA impls for LA #1555
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
base: main
Are you sure you want to change the base?
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. |
🌿 Documentation Preview
|
c780173
to
3dbcdaa
Compare
import { createBundlerClient } from "viem/account-abstraction"; | ||
import type { AlchemySmartAccountClientConfig } from "./smartAccountClient"; | ||
|
||
// Yea this isn't great or going to work well, we should just keep using our smart account client, but change the account type to match the viem one |
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.
💬 What about the idea of a transform then from the current client into this new client. Like rust's Into
traits
Or, is it more worth it for the changing of the account type?
}, | ||
}, | ||
userOperation: { | ||
// This doesn't have the ability to skip gas estimation AFAICT |
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.
🙀
} | ||
|
||
throw new Error( | ||
"this is the biggest issue with viem's approach. we can't skip gas estimation during paymaster flows..." |
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.
💬 If we do some hacky stuff, like stub it out, it might be possible. But would is it worth the cost to our souls.
Is there a line of communication to the viem team on this at least?
TTransport extends Transport = Transport, | ||
TSigner extends SmartAccountSigner = SmartAccountSigner, | ||
TLightAccountVersion extends LightAccountVersion<"LightAccount"> = "v2.0.0" | ||
> = CreateBaseViemLightAccountParams< |
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.
💬 ❓ Wondering if it is worth it to do this extend style, maybe we should be flattening this, so just inline this https://github.com/alchemyplatform/aa-sdk/pull/1555/files#diff-477606e38764f257d171de4bf2d12f95adb50f0b6b9256aaf04ff292e20ff638R26
Was hoping that there was a keyword for the types, like satisfies.
That exists but not what I was thinking of.
I would hate that the best is something along the lines of interface implements
but that also doesn't exists. 😞
|
||
// TODO: define the implementation and return type for single owner light account | ||
|
||
// TODO: the return type isn't quite correct here, we can do better following this as an example https://github.com/wevm/viem/blob/main/src/account-abstraction/accounts/implementations/toSoladySmartAccount.ts |
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.
❤️ Love these todo's
PR-Codex overview
This PR focuses on integrating the
viem
library for managing smart accounts, enhancing the functionality of light accounts, and implementing error handling for paymaster flows.Detailed summary
foo
function inviem.ts
to create a bundler client with error handling.createViemLightAccount
andcreateViemMultiOwnerLightAccount
functions for light account management.base.ts
.