-
Notifications
You must be signed in to change notification settings - Fork 134
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(aa-sdk): sdk light client can call the alchemy client #1236
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. |
@@ -67,7 +86,7 @@ export function createLightAccountClient< | |||
*/ | |||
export async function createLightAccountClient( | |||
params: CreateLightAccountClientParams | |||
): Promise<SmartAccountClient> { | |||
): Promise<SmartAccountClient | AlchemySmartAccountClient> { | |||
const { transport, chain } = params; | |||
|
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.
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 the difference is that this by default calls createSmartAccountClient
and the alchemy calls createAlchemySmartAccountClient
they take slightly different config params (createSCAClient takes in a paymasterMiddleware
and createAlchemySCAClient takes in a gasManagerConfig
or I think just a policyId
)
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.
Okay, I'll go down the side of testing the params to check the transport as alchemyTransport
params: AlchemyLightAccountClientConfig<TSigner> | ||
): Promise< | ||
AlchemySmartAccountClient< | ||
Chain | undefined, | ||
LightAccount<TSigner>, | ||
LightAccountClientActions<TSigner> | ||
> | ||
>; |
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 nice! this is way cleaner than what I was thinking which was adding to the conditional typing in for CreateLightAccountClientParams
based on the transport
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.
Had to verify this, and slight variation. Good thing for tests right?
f41c381
to
6ebfca5
Compare
59af47f
to
cca9ba3
Compare
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. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Merge activity
|
cca9ba3
to
e7bcc56
Compare
e7bcc56
to
939f24e
Compare
939f24e
to
a0fdd71
Compare
a0fdd71
to
22a2e20
Compare
# Pull Request Checklist - [x] Did you add new tests and confirm existing tests pass? (`yarn test`) - [x] Did you update relevant docs? (docs are found in the `site` folder, and guidelines for updating/adding docs can be found in the [contribution guide](https://github.com/alchemyplatform/aa-sdk/blob/main/CONTRIBUTING.md)) - [x] Do your commits follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard? - [x] Does your PR title also follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) standard? - [x] If you have a breaking change, is it [correctly reflected in your commit message](https://www.conventionalcommits.org/en/v1.0.0/#examples)? (e.g. `feat!: breaking change`) - [x] Did you run lint (`yarn lint:check`) and fix any issues? (`yarn lint:write`) - [x] Did you follow the [contribution guidelines](https://github.com/alchemyplatform/aa-sdk/blob/main/CONTRIBUTING.md)? <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on enhancing the `createLightAccountClient` function to support an `AlchemyTransport`, modifying its return type accordingly. Additionally, it introduces the `isAlchemyTransport` utility to check the transport type. ### Detailed summary - Modified `createLightAccountClient` to return `AlchemySmartAccountClient` when using `AlchemyTransport`. - Added `isAlchemyTransport` function to verify if the transport is an `AlchemyTransport`. - Updated type parameters in `CreateLightAccountClientParams` to include `AlchemyTransport`. - Enhanced documentation for the `createLightAccountClient` function. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
22a2e20
to
cd9053b
Compare
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 enhancing the
createLightAccountClient
function to support a new return type for the Alchemy transport and introduces a utility functionisAlchemyTransport
to check transport types.Detailed summary
createLightAccountClient
to returnAlchemySmartAccountClient
when the transport is Alchemy.isAlchemyTransport
function to determine if the transport is of typeAlchemyTransport
.CreateLightAccountClientParams
to includeAlchemyTransport
.