[codex] Add viem-free common core entrypoint - #2544
Draft
blakecduncan wants to merge 1 commit into
Draft
Conversation
jakehobbs
reviewed
Jun 23, 2026
jakehobbs
left a comment
Collaborator
There was a problem hiding this comment.
don't love that we are copying things from viem again, which v5 undid a lot of from v4. this seems fairly small though.
might be worth adding eslint rules to block importing viem from places that could get us in trouble, since we're making it optional now.
| "import": "./dist/esm/index.js", | ||
| "default": "./dist/esm/index.js" | ||
| }, | ||
| "./core": { |
Collaborator
There was a problem hiding this comment.
don't love the name core for this, but sure i have any better suggestions.
Collaborator
Author
There was a problem hiding this comment.
yeah that's fair, we could do something like runtime or primatives but I don't really have anything better than that
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add a viem-free
@alchemy/common/coreentrypoint for shared Alchemy SDK infrastructure. This lets packages such as Data APIs reuse REST/JSON-RPC transport, normalized API errors, retries/timeouts/abort handling, request IDs, redaction, and network resolution without depending on viem or wallet-client types.The root
@alchemy/commonbarrel stays wallet-facing: existing viem transport utilities andBaseError-based errors remain available there, while chain-library-free consumers can import only from the new/coresubpath.Summary
@alchemy/common/corepackage export and core barrel.AlchemyError/AlchemyApiErrorfamily plus fetch/server subclasses for shared HTTP clients.@alchemy/commonfocused on wallet/viem-facing exports and mark viem as an optional peer.Test Plan
pnpm --filter @alchemy/common test:runpnpm --filter @alchemy/common buildpnpm --filter @alchemy/wallet-apis buildpnpm --filter @alchemy/smart-accounts exec tsc --project tsconfig.build.json --noEmitpnpm --filter @alchemy/aa-infra exec tsc --project tsconfig.build.json --noEmit@alchemy/common/coregit diff --checkBreaking Changes
None expected. Existing root
@alchemy/commonwallet-facing exports remain available; the new core entrypoint is additive.Deployment Notes
No service deployment or migration required. This is a package surface addition for downstream SDK work.
LINEAR TASK: N/A - Data SDK Foundation follow-up; no Linear issue provided.
PR-Codex overview
This PR primarily focuses on enhancing error handling, introducing new error classes, and refining the
AlchemyRestClientfor better request management. It also adds utility functions for redacting sensitive information in URLs and improves query serialization.Detailed summary
ServerErrorandFetchError.AlchemyFetchErrorandAlchemyServerErrorclasses for better error handling.redactUrlCredentialsfunction to mask sensitive data in URLs.AlchemyRestClientwith request ID and improved retry logic.AlchemyRestClient.AlchemyRestClientandAlchemyJsonRpcClient.