-
Notifications
You must be signed in to change notification settings - Fork 542
[SDK] Feature: Adds getAdminAccount
to ecosystem wallets and cleans up smart account creation
#5829
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
[SDK] Feature: Adds getAdminAccount
to ecosystem wallets and cleans up smart account creation
#5829
Conversation
🦋 Changeset detectedLatest commit: a47600a The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
How to use the Graphite Merge QueueAdd either label to this PR to merge it via 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. |
size-limit report 📦
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5829 +/- ##
==========================================
+ Coverage 54.11% 55.29% +1.17%
==========================================
Files 1102 1123 +21
Lines 59202 59623 +421
Branches 4885 5042 +157
==========================================
+ Hits 32037 32966 +929
+ Misses 26441 25935 -506
+ Partials 724 722 -2
*This pull request uses carry forward flags. Click here to find out more.
|
Merge activity
|
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 have full context but LGTM from what I understand
… up smart account creation (#5829) Also Fixes TOOL-2833 <!-- start pr-codex --> --- ## PR-Codex overview This PR introduces a new method, `getAdminAccount`, to the `inAppWallet` interface, enhancing support for account abstraction (AA) wallets. It also refactors existing wallet connection methods to streamline interactions with smart accounts. ### Detailed summary - Added `getAdminAccount` method to `inAppWallet` interface. - Refactored wallet connection methods from `connectSmartWallet` to `connectSmartAccount`. - Updated tests to reflect new connection methods and account handling. - Enhanced logic to determine if an account is a smart account. - Improved error handling for personal account connections. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
3a9fa64
to
ca3cbca
Compare
@@ -46,6 +47,7 @@ export function createInAppWallet(args: { | |||
const { createOptions: _createOptions, connectorFactory, ecosystem } = args; | |||
const walletId = ecosystem ? ecosystem.id : "inApp"; | |||
const emitter = createWalletEmitter<"inApp">(); | |||
let isSmartWallet = false; |
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.
Why do you need this?
return undefined; | ||
} else { | ||
// This might return an admin account (if the main account is a smart account), otherwise it'll return undefined | ||
return getAdminAccountForSmartAccount(account); |
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.
How about we just store the admin account the same way we store the active account?
Would rather not rely on an in-memory map if possible.
That way you don't need the boolean flag either, just keep both accounts around
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.
Nice, I like that much better
3a9fa64
to
db093ab
Compare
db093ab
to
a47600a
Compare
Also Fixes TOOL-2833
PR-Codex overview
This PR introduces the
getAdminAccount
method to theinAppWallet
interface, enhancing the functionality for Account Abstraction (AA) ecosystem wallets. It also refines wallet connection and disconnection processes, improving the overall wallet management experience.Detailed summary
getAdminAccount
method toinAppWallet
.smartWallet
to includegetAdminAccount
and refactored connection methods.connectSmartWallet
withconnectSmartAccount
across various files.