Skip to content
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: add alchemy transport update for the mav2 account client #1271

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Blu-J
Copy link
Collaborator

@Blu-J Blu-J commented Jan 10, 2025

Pull Request Checklist


PR-Codex overview

This PR focuses on enhancing the SMAV2AccountClient functionality by integrating Alchemy support, improving type definitions, and modifying the client creation process to accommodate different transport types.

Detailed summary

  • Added imports for Alchemy-related types and functions in client.ts.
  • Enhanced SMAV2AccountClient type definitions to support Alchemy transport.
  • Introduced CreateSMAV2AlchemyAccountClientParams type for Alchemy-specific parameters.
  • Modified createSMAV2AccountClient to handle both standard and Alchemy transports.
  • Updated the implementation of createSMAV2AccountClient to return either SmartAccountClient or AlchemySmartAccountClient.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

vercel bot commented Jan 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
aa-sdk-site ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 11, 2025 1:22am
aa-sdk-ui-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 11, 2025 1:22am

Copy link
Collaborator Author

Blu-J commented Jan 10, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more


How to use the Graphite Merge Queue

Add 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.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Blu-J Blu-J force-pushed the 01-07-feat_client_multi_account_light_and_alchemy_consolidation branch from d05051e to b677351 Compare January 10, 2025 20:44
@Blu-J Blu-J force-pushed the 01-10-feat_add_alchemy_transport_update_for_the_mav2_account_client branch from 0bbe272 to 05a7dca Compare January 10, 2025 20:44
Copy link
Collaborator

@moldy530 moldy530 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple nits and just some questions for my own understanding but overall LGTM

We should probs also test the types at a minimum that with AlchemyTransport we get an Alchemy client and any other transport we get a non Alchemy Client

account-kit/smart-contracts/src/ma-v2/client/client.ts Outdated Show resolved Hide resolved
Comment on lines 103 to 107
const smaV2Account = await createSMAV2Account({
...config,
transport,
chain,
});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we should be able to just pull this up and remove line 115 below since the account instance can be created the same way regardless of the client

@@ -64,7 +97,21 @@ export function createSMAV2AccountClient<
*/
export async function createSMAV2AccountClient(
config: CreateSMAV2AccountClientParams
): Promise<SmartAccountClient> {
): Promise<SmartAccountClient | AlchemySmartAccountClient> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for my own understanding: does it complain if this is just SmartAccountClient? technically the AlchemySmartAccountClient is a SmartAccountClient

@Blu-J Blu-J force-pushed the 01-07-feat_client_multi_account_light_and_alchemy_consolidation branch from b677351 to d05051e Compare January 10, 2025 21:15
@Blu-J Blu-J force-pushed the 01-10-feat_add_alchemy_transport_update_for_the_mav2_account_client branch from 05a7dca to acc1708 Compare January 10, 2025 21:15
@Blu-J Blu-J force-pushed the 01-07-feat_client_multi_account_light_and_alchemy_consolidation branch from d05051e to bfde6c0 Compare January 10, 2025 22:32
@Blu-J Blu-J force-pushed the 01-10-feat_add_alchemy_transport_update_for_the_mav2_account_client branch from acc1708 to b826ba0 Compare January 10, 2025 22:33
@Blu-J Blu-J force-pushed the 01-07-feat_client_multi_account_light_and_alchemy_consolidation branch from bfde6c0 to 136cc8f Compare January 10, 2025 22:51
@Blu-J Blu-J force-pushed the 01-10-feat_add_alchemy_transport_update_for_the_mav2_account_client branch from b826ba0 to 73e0725 Compare January 10, 2025 22:51
@Blu-J Blu-J force-pushed the 01-07-feat_client_multi_account_light_and_alchemy_consolidation branch from 136cc8f to 5d46490 Compare January 10, 2025 23:53
@Blu-J Blu-J force-pushed the 01-10-feat_add_alchemy_transport_update_for_the_mav2_account_client branch from 73e0725 to 60ebd5f Compare January 10, 2025 23:53
@Blu-J Blu-J changed the base branch from 01-07-feat_client_multi_account_light_and_alchemy_consolidation to graphite-base/1271 January 11, 2025 00:39
@Blu-J Blu-J force-pushed the graphite-base/1271 branch from 5d46490 to 18a9228 Compare January 11, 2025 00:52
@Blu-J Blu-J force-pushed the 01-10-feat_add_alchemy_transport_update_for_the_mav2_account_client branch from 60ebd5f to 0048417 Compare January 11, 2025 00:52
@Blu-J Blu-J changed the base branch from graphite-base/1271 to main January 11, 2025 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants