Skip to content

v4 follow-up: banners + v5 rewrites for low-level-infra and smart-contracts#1328

Open
jakehobbs wants to merge 23 commits into
mainfrom
jake/v4-followup-pass-1
Open

v4 follow-up: banners + v5 rewrites for low-level-infra and smart-contracts#1328
jakehobbs wants to merge 23 commits into
mainfrom
jake/v4-followup-pass-1

Conversation

@jakehobbs
Copy link
Copy Markdown
Contributor

@jakehobbs jakehobbs commented May 22, 2026

Summary

Two passes on the v4-flavored pages identified in the follow-up doc.

Pass 1 (commit 1) — Banners (39 pages)

Adds two shared snippets and applies them via <Markdown /> imports.

  • <v4-code-banner> → 33 pages (after rewrites in pass 2 removed 4): recipes, troubleshooting/ssr, supported-chains, plus orphan v4 pages (core/, infra/, signer/, react/getting-started/, react-native/getting-started/, smart-contracts/modular-account-v2/session-keys/, smart-contracts/other-accounts/modular-account/**, smart-contracts/overview).
  • <v4-concept-banner> → 2 pages: concepts/middleware, resources/types.

Pass 2 (commit 2) — v5 rewrites (13 pages + 1 shared snippet)

Replaces v4 @account-kit/* + @aa-sdk/* code with verified v5 patterns. Removes the v4 banner from each rewritten page since the code is now v5.

  • Low-level Infra (5 NAV'd): low-level-infra/{overview,quickstart}, low-level-infra/bundler/{overview,sdk}, bundler-api/bundler-sponsored-operations.
  • Low-level Infra 3rd-party (3 orphans): low-level-infra/third-party-infrastructure/{bundlers,paymasters,chains}.
  • Smart Contracts (5 NAV'd): smart-contracts/modular-account-v2/getting-started, smart-contracts/other-accounts/light-account/{getting-started,multi-owner-light-account,transfer-ownership-light-account}, third-party/smart-contracts.
  • Shared snippet: shared/infra/mav2-client.mdx → v5 MAv2 client setup.

How v5 code was verified

Every code pattern in this PR typechecks against published v5 packages in a sandbox at ~/dev/jakehobbs/wallet-v5-dogfooding/docs-rewrites/:

  • @alchemy/aa-infra@5.0.1
  • @alchemy/smart-accounts@5.0.1
  • @alchemy/wallet-apis@5.0.1
  • viem@2.50.4

The doc patterns mirror those test snippets (08 files in the sandbox, each bun run typecheck clean).

Out of scope (deferred)

  • The 35 remaining bannered pages — most are signer-SDK / Account-Kit-v4 content where v5 has no direct equivalent (the recommended v5 stack is @alchemy/wallet-apis + Privy as signer). Eventually the entire "Account Kit (v4)" nav section should be hidden away.
  • Real rewrites for concepts/middleware.mdx and resources/types.mdx (currently just v4-concept banner) — these need conceptual rework, not a mechanical swap.

Test plan

  • Preview deploy: spot-check a rewritten page (e.g. /docs/wallets/smart-contracts/modular-account-v2/getting-started, /docs/wallets/low-level-infra/quickstart) renders cleanly.
  • Preview deploy: spot-check a bannered page (e.g. /docs/wallets/recipes/hyperliquid-wallets, /docs/wallets/concepts/middleware) shows the banner.
  • Run one of the sandbox snippets against a real testnet API key + private key to confirm the rewritten patterns actually work end-to-end (typecheck is necessary but not sufficient).

🤖 Generated with Claude Code

Adds two shared snippets — v4-code-banner.mdx (for pages whose code
examples still use Account Kit v4) and v4-concept-banner.mdx (for
concept pages like middleware/types that are largely abstracted away
in v5 wallet-apis). Applies them via <Markdown /> imports across 39
pages: recipes, troubleshooting, bundler-api, supported-chains,
middleware, types, plus 27 orphan v4 pages still served via direct
URL. No code changes — just flags the v4-ness for readers while we
work through the rewrites in follow-up PRs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 22, 2026

🔗 Preview Mode

Name Status Preview Updated (UTC)
Alchemy Docs ✅ Ready 🔗 Visit Preview May 23, 2026, 1:03 AM

Replaces v4 @account-kit/* + @aa-sdk/* code in 13 NAV'd/orphan pages
with verified v5 patterns: @alchemy/smart-accounts for account impls,
@alchemy/aa-infra estimateFeesPerGas helper, viem's createBundlerClient
for the bundler RPC. Pages affected:

  Low-level Infra (5 NAV'd):
    - low-level-infra/{overview,quickstart}.mdx
    - low-level-infra/bundler/{overview,sdk}.mdx
    - bundler-api/bundler-sponsored-operations.mdx

  Low-level Infra 3rd-party (3 orphans):
    - low-level-infra/third-party-infrastructure/{bundlers,paymasters,chains}.mdx

  Smart Contracts (5 NAV'd):
    - smart-contracts/modular-account-v2/getting-started.mdx
    - smart-contracts/other-accounts/light-account/{getting-started,multi-owner-light-account,transfer-ownership-light-account}.mdx
    - third-party/smart-contracts.mdx

  Shared snippet:
    - shared/infra/mav2-client.mdx → v5 MAv2 client setup

All code typechecks against @alchemy/aa-infra@5.0.1,
@alchemy/smart-accounts@5.0.1, @alchemy/wallet-apis@5.0.1, viem@2.50.4
in a sandbox at ~/dev/jakehobbs/wallet-v5-dogfooding/docs-rewrites/.
v4-code-banner.mdx is removed from each rewritten page since the code
is now v5.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jakehobbs jakehobbs changed the title Flag v4 pages with shared warning banners v4 follow-up: banners + v5 rewrites for low-level-infra and smart-contracts May 22, 2026
jakehobbs and others added 18 commits May 22, 2026 16:07
Per "low-level pages use viem, higher-level use wallet-apis" — the
bundler-sponsored-operations page documents the bundler API directly,
so it should use viem's createBundlerClient. Two correctness fixes
that came from cross-checking against ws-tools (the canonical BSO
demo at apps/cli + scripts/bundler-sponsored-demo.ts):

  - preVerificationGas must also be 0n. All three gas fields are the
    signal to the bundler that it should cover gas.
  - The policy ID rides on the bundler transport's fetchOptions, not
    inside a capabilities.gasParamsOverride object.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Cross-checked against ~/dev/OMGWINNING/ws-tools (apps/cli sendops,
send7702ops, senderc20op + packages/lib/src/clients/smart-account-client).
Three style/correctness updates across all v5 rewrites:

  - createClient (not createPublicClient) for the rpc client passed to
    toModularAccountV2 / toLightAccount / toMultiOwnerLightAccount and
    to createBundlerClient. Matches the canonical ws-tools style and
    avoids pulling in unused PublicActions.

  - import { estimateFeesPerGas } from '@alchemy/aa-infra' without
    aliasing; pass it directly as userOperation.estimateFeesPerGas.
    Matches the canonical ws-tools imports.

  - Pass client: rpcClient to every createBundlerClient call.
    Without it viem uses the bundler transport for non-bundler reads,
    which is fine for plain Alchemy infra but breaks once the bundler
    transport carries a BSO header or hits a third-party RPC.

Also renames the shared mav2-client snippet's exported helper from
createClient → getClient to avoid colliding with the viem
createClient import; quickstart.mdx updated to match.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Per review feedback: @alchemy/common exports alchemyTransport which
takes { apiKey } and handles the chain-aware URL automatically. Much
cleaner than every snippet hardcoding the eth-sepolia / worldchain URL
string with the API key interpolated in. Matches the canonical
pattern used in ws-tools' bundler-sponsored-demo.ts and ws-sendop.ts.

For BSO, the policy-id header still rides on the same transport via
fetchOptions — alchemyTransport extends viem's HttpTransportConfig so
this works identically.

Bundler/overview prose updated to reference alchemyTransport too.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…rship to v5

- Add v4-signer-banner.mdx (signer SDK sunsetting → Privy) and apply to 14 signer/login-method pages
- Add v4-react-banner.mdx (no v5 react pkg → wallet-apis quickstart) and apply to 18 react pages
- Rewrite tutorials/getting-started/alchemy-quickstart-guide.mdx to use createSmartWalletClient + alchemyWalletTransport + sendCalls
- Rewrite smart-contracts/modular-account-v2/managing-ownership.mdx to use toModularAccountV2 + viem encodeFunctionData against semiModularAccountV2StaticImpl.accountAbi (typecheck-verified in sandbox)
- Drop the leftover "v5 in beta" Info banner from the 4 third-party signer pages

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…eads as deliberate

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…d lists

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…only line

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ready covers these links

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tead of @account-kit/infra

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…n rewritten

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ate backlog

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…a future v5 React pkg

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tead of just noting absence

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… advanced path

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…lient.encode{Install,Uninstall}Validation + sendUserOperation)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…py tweaks

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jakehobbs jakehobbs marked this pull request as ready for review May 23, 2026 00:54
@jakehobbs jakehobbs requested a review from a team as a code owner May 23, 2026 00:54
…4 React in react banner

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 748c99f645

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread content/wallets/pages/low-level-infra/quickstart.mdx Outdated
Comment thread content/wallets/shared/infra/mav2-client.mdx
jakehobbs and others added 2 commits May 22, 2026 18:02
…it from package root yet)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…re policyId through paymaster; fix v4-signer-banner Privy link

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant