-
Notifications
You must be signed in to change notification settings - Fork 146
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
feat: eip-7702 support in aa-sdk/core, and sma7702 support in account-kit/smart-contracts #1287
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. |
6797694
to
ed436d8
Compare
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.
this is looking good!
One thing missing is some client.test at a minimum (though would be great if we could extend it to installValidation.ts
and have unit tests for installValidation.test.ts
)
OOS for this PR is the naming I think, but calling it out here as @howydev and @linnall look at consolidating to the Prism naming as just looking at this PR it's clear that it'll be much better devex externally to have both a Prism account factory and Prism client factory for release
|
||
export type MAV2Account< | ||
TSigner extends SmartAccountSigner = SmartAccountSigner | ||
> = SmartContractAccountWithSigner<"MAV2Account", TSigner, "0.7.0"> & { |
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 think this base type should probably be generic on source
as well since source
should be unique per instance (ie. the first generic parameter in SmartContractAccountWithSigner
)
signer: TSigner; | ||
entryPoint?: EntryPointDef<"0.7.0", Chain>; | ||
signerEntity?: SignerEntity; |
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 yea I remember seeing this during hackathon and thinking it odd. Why can't we merge signer
and signerEntity
?
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.
cc @howydev
account-kit/smart-contracts/src/ma-v2/account/semiModularAccount7702.ts
Outdated
Show resolved
Hide resolved
site/pages/reference/account-kit/infra/functions/alchemyGasManagerMiddleware.mdx
Outdated
Show resolved
Hide resolved
c0d52b7
to
847ab00
Compare
bfc87e7
to
b3acd54
Compare
* chore: move optional mode into account params * chore: removed unused var
const is7702 = | ||
params.accountParams && | ||
"mode" in params.accountParams && | ||
params.accountParams.mode === "7702"; |
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 simplification:
const is7702 = params?.accountParams?.mode === "7702";
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.
actually, if its just used in a single place, you can probably do it below directly
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.
makes sense to me to simplify, cc @jakehobbs since this was originally from https://github.com/alchemyplatform/aa-sdk/pull/1329/files#diff-454ebcaf71636677b50d6564ee14fec20267d25b134f5487855ce1e7bc3f8705R222
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, it seems like the branching destructuring at the top of this file is breaking the type relationship between account.source
and params.accountParams
, even though we can obviously see that there should be a relationship.
For now, I'll leave it as is, and make note of avoiding this type of destructuring to preserve type checking.

@@ -277,9 +221,22 @@ export async function createSMAV2Account( | |||
: callData; | |||
}; | |||
|
|||
const baseAccount = await toSmartContractAccount({ |
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, instead of modifying toSmartContractAccount
, another option would be to override getNonce
and getImplementationAddress
when unrolling below right?
this would be a bigger refactor and there's no issue with the current impl, so think we can keep the existing one for speed
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 think @moldy530 considered the unrolling-override as an anti-pattern, from these discussions:
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.
ok, sg
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.
need to update docs in 2 places, other that that LGTM
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.
read the example wrongly, we're good to go!
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 primarily updates the
viem
package version across multiplepackage.json
files and introduces theModularAccountV2
functionality, including new methods and types for account creation and management.Detailed summary
viem
version from^2.20.0
to^2.22.6
in multiplepackage.json
files.ModularAccountV2
support in several components.ModularAccountV2
.ModularAccountV2
.ModularAccountV2
in the React components.