-
Notifications
You must be signed in to change notification settings - Fork 113
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
refactor: switch alchemy client configs to use alchemy transport #987
base: moldy/alchemy-transport-0
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
TODO:
|
357b010
to
64a6405
Compare
fetchOptions.headers = new Headers(fetchOptions.headers); | ||
fetchOptions.headers.set("Alchemy-AA-Sdk-Version", VERSION); |
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.
@dphilipson finally fixed the issues in the previous PR doing this: #563 (comment)
64a6405
to
b7941c4
Compare
b7941c4
to
9dd6d0b
Compare
579cacf
to
fd7bca0
Compare
fd7bca0
to
affecef
Compare
affecef
to
69a89cc
Compare
69a89cc
to
c2449f1
Compare
const pConn = persistedConnection as Record<string, any>; | ||
if (key === "chain") return value.id === pConn.chain.id; | ||
|
||
return pConn[key] === value; |
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.
yaayyy testing, we need to get better at our coverage here. it's really bad (I take a lot of the blame for that) and this core logic does a lot of complex state mgmt that needs to be tested
// this is the default merge behavior | ||
return { ...current, ...persistedState }; | ||
const { chain, ...connection } = persistedConnections.find( | ||
(x) => x.chain.id === persistedState.bundlerClient.chain.id |
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.
it's fine to use the persisted state here because we've already established the persisted client uses the same connections as the core state. this way if a user has switched chains that switch persists (see tests above)
c2449f1
to
01bcfe3
Compare
01bcfe3
to
867c55f
Compare
e1ebd1b
to
3a78277
Compare
867c55f
to
9de5775
Compare
Gonna do the docs in a separate PR to keep this one from getting any bigger than it already is |
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 introduces significant updates to the
account-kit
library, primarily focusing on the integration ofalchemy
transport for smart account clients, enhancing the functionality and configuration of various client creation methods, and refining type definitions for better clarity.Detailed summary
createAlchemySmartAccountClientFromExisting
function.alchemy
transport integration in client creation methods.getSmartAccountClient
to utilize new transport methods.watchSmartAccountClient
.jsdom
environment.