Skip to content

[DO NOT MERGE] sol sdk examples#2476

Draft
jakehobbs wants to merge 37 commits into
v5.x.x-gradudatedfrom
jake/v5/sol-examples
Draft

[DO NOT MERGE] sol sdk examples#2476
jakehobbs wants to merge 37 commits into
v5.x.x-gradudatedfrom
jake/v5/sol-examples

Conversation

@jakehobbs
Copy link
Copy Markdown
Collaborator

@jakehobbs jakehobbs commented Apr 29, 2026

  • Add SOLANA_DOGFOODING.md with setup instructions for all 3 test paths (SDK client e2e, raw JSON-RPC e2e, Privy + Next.js example)
  • Include full JSON-RPC request/response examples for each wallet method
  • Add verbose req/res console.log to solana-raw-rpc-e2e.ts
  • Update privy example to use published @alchemy/wallet-apis@0.1.0-alpha.28

Pull Request Checklist


PR-Codex overview

This PR primarily focuses on enhancing the documentation and type definitions across various modules, improving clarity and consistency in function signatures, type aliases, and error classes.

Detailed summary

  • Updated function signatures to improve clarity by adding parameter types.
  • Enhanced type definitions for various entities, making them more explicit.
  • Adjusted error classes to ensure consistent inheritance from BaseError.
  • Improved formatting and structure in documentation files for better readability.
  • Added new configuration settings in examples/solana-privy.
  • Modified existing examples to align with updated types and functions.

The following files were skipped due to too many changes: docs/pages/reference/smart-accounts/src/variables/multiOwnerModularAccountStaticImpl.mdx, docs/pages/reference/smart-accounts/src/functions/toModularAccountV2.mdx, docs/pages/reference/smart-accounts/src/variables/multiOwnerLightAccountStaticImplV2_0_0.mdx, docs/pages/reference/smart-accounts/src/type-aliases/BaseMaV1AccountImplementation.mdx, docs/pages/reference/smart-accounts/src/functions/deferralActions.mdx, docs/pages/reference/smart-accounts/src/type-aliases/UninstallValidationParams.mdx, docs/pages/reference/smart-accounts/src/type-aliases/InstallValidationParams.mdx, docs/pages/reference/smart-accounts/src/type-aliases/LightAccount.mdx, docs/pages/reference/wallet-apis/src/exports/functions/signTypedData.mdx, docs/pages/reference/wallet-apis/src/exports/functions/signSignatureRequest.mdx, docs/pages/reference/smart-accounts/src/type-aliases/StaticSmartAccountImplementation.mdx, docs/pages/reference/wallet-apis/src/exports/functions/sendPreparedCalls.mdx, docs/pages/reference/wallet-apis/src/exports/type-aliases/SignPreparedCallsResult.mdx, docs/pages/reference/smart-accounts/src/classes/PermissionBuilder.mdx, docs/pages/reference/smart-accounts/src/type-aliases/LightAccountAbi.mdx, docs/pages/reference/README.mdx, docs/pages/reference/common/src/functions/isAlchemyConnectionConfig.mdx, docs/pages/reference/smart-accounts/src/type-aliases/BaseModularAccountV2Implementation.mdx, docs/pages/reference/common/src/classes/BaseError.mdx, docs/pages/reference/wallet-apis/src/exports/functions/createSmartWalletClient.mdx, docs/pages/reference/common/src/functions/alchemyTransport.mdx, docs/pages/reference/common/src/variables/AlchemyConnectionConfigSchema.mdx, docs/pages/reference/smart-accounts/src/type-aliases/EntryPointFromAccountRegistry.mdx, pnpm-lock.yaml, docs/pages/reference/smart-accounts/src/type-aliases/Permission.mdx, docs/pages/reference/smart-accounts/src/classes/PermissionBuilderError.mdx, docs/pages/reference/smart-accounts/src/functions/installValidationActions.mdx, examples/solana-privy/src/app/layout.tsx, docs/pages/reference/aa-infra/src/README.mdx, examples/solana-privy/src/app/page.tsx, packages/wallet-apis/src/__tests__/solana-e2e.ts, examples/solana-privy/src/app/phantom-raw/page.tsx, examples/solana-privy/src/app/wallet-standard/page.tsx, packages/wallet-apis/src/__tests__/solana-raw-rpc-e2e.ts, docs/pages/reference/smart-accounts/src/variables/ENTITY_ID_AND_NONCE_READER_BYTECODE.mdx, docs/pages/reference/common/src/README.mdx, docs/pages/reference/wallet-apis/src/exports/README.mdx, SOLANA_DOGFOODING.md, docs/pages/reference/smart-accounts/src/README.mdx

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

jakehobbs and others added 21 commits April 24, 2026 16:49
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
… utils

- Replace hand-rolled hexToBytes/bytesToBase58 with viem hexToBytes and ox Base58.fromBytes
- Add type guards (isSolanaChain, isSolanaResponse, isEvmResponse) instead of casts
- Prefix all Solana action logs with solana: namespace
- Add mergeSolanaClientCapabilities for client-level policyId merging
- Fix solanaSmartWalletActions decorator to use InnerSolanaWalletApiClient

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

- Add Solana-specific getCallsStatus/waitForCallsStatus (viem's versions fail on non-hex chainId)
- Simplify SolanaSigner to signTransaction/signMessage (SDK extracts message bytes from serialized tx)
- Use TypeBox decode with Solana-specific schemas instead of decoding full union
- Add e2e test script for Solana devnet flow
- Update wallet-api-types to 0.1.0-local.1 (adds SolanaGetCallsStatusResponse schema)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…for Solana + add Privy example

SolanaSigner is now a union of three signer types — wallet standard
(Privy, Phantom), @solana/kit TransactionPartialSigner, and raw Ed25519
message signers. The SDK auto-detects via type guards and handles
signature extraction internally. Privy's ConnectedStandardSolanaWallet
plugs in directly with no adapter.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…all 3 signer paths

- Dynamically import @solana/kit to decode raw tx bytes into Transaction
  objects for the TransactionPartialSigner path (keeps @solana/kit optional)
- Update e2e test to exercise both TransactionPartialSigner (@solana/kit
  KeyPairSigner) and MessageSigner (raw Ed25519) paths
- Wallet standard path tested via Privy example app

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

Align with updated wallet-api-types@local.2 which uses solana:devnet / solana:mainnet
instead of solana-devnet / solana-mainnet. Rename client factory param from chainId to
chain to match EVM client convention. Add raw RPC e2e test.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Single factory with overloads that discriminates on chain type — pass a
Chain object for EVM or a SolanaChainId string for Solana and get the
correct return type. Adds address validation (hex for EVM, base58 for
Solana), fixes the solanaAccount override bug where factory-level account
was ignored in Solana actions, and removes the hex type lie by making
BaseWalletClient generic over the account type (Solana clients now have
account: undefined + solanaAccount: string).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add SOLANA_DOGFOODING.md with setup instructions for all 3 test paths
  (SDK client e2e, raw JSON-RPC e2e, Privy + Next.js example)
- Include full JSON-RPC request/response examples for each wallet method
- Add verbose req/res console.log to solana-raw-rpc-e2e.ts
- Update privy example to use published @alchemy/wallet-apis@0.1.0-alpha.28

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Moved to jake/v5/sol-examples branch for dogfooding.

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

Reduce exported types to only what consumers need (drop BaseWalletClient, SignerClient, SolanaSigner), export Solana action functions with solana* prefix for parity with EVM, and reorder types.ts for clarity.

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

Solana actions were using a separate decodeSolanaResponse that bypassed
the union schema. Now they use the same decode + type guard pattern as
EVM, and decodeSolanaResponse is removed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Prove all 3 signer adapters (fromKeypair, fromKitSigner, raw SolanaStandardSigner) produce identical signatures, then use the simplest (fromKeypair) for e2e tests covering sendCalls, prepare/sign/send flow, and status polling.

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

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

Resolve delete-vs-modify conflicts by keeping test scripts and example app.
Update solana-e2e.ts to use fromKeypair/fromKitSigner adapters instead of
removed SolanaMessageSigner/SolanaTransactionPartialSigner types. Update
privy example to use workspace dependency.

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

wiz-code-21c5ec5a85 Bot commented Apr 29, 2026

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities 1 High 2 Medium 1 Low
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings -
Software Management Finding Software Management Findings -
Total 1 High 2 Medium 1 Low

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension.

jakehobbs and others added 8 commits April 29, 2026 10:52
…olana e2e tests

Replace hardcoded private key with a randomly generated keypair and use
the idiomatic @solana/kit signer path instead of manual crypto.subtle.sign.

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

The "Standard" in the name falsely implied it was the wallet-standard interface
when it's actually a simplified signer contract. Also adds fromWalletAdapter for
@solana/wallet-adapter-react and injected providers (Phantom, etc.), with
equivalence test coverage for all four adapter paths.

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

Solana actions, adapters, and decorator now live under /solana instead of
being prefixed (solanaPrepareCalls → prepareCalls) in the main entrypoint.
Removes solana-adapters subpath (folded into /solana). Adds JSDoc to the
shared createSmartWalletClient factory.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…s, and fromWalletAdapter usage

Move the full API shape (types, request/response schemas, real devnet
payloads) to the top of the doc, followed by the signer interface and
adapter table, then the five runnable examples. Also pick up
fromWalletAdapter refactor in phantom-raw and SolanaSigner rename in
wallet-standard page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…, and zero-dep signing example

Restructure for Notion readability: use ? for optionals, strip wide
comments, add real wallet_prepareCalls example, inline signer adapter
snippets showing where each signer comes from, and a zero-dependency
Ed25519 signing section for non-JS consumers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jakehobbs and others added 8 commits April 30, 2026 18:07
Adds wallet-standard support, lazy-loads peer deps (@solana/kit,
@solana/web3.js), validates signature length, uses @solana/kit's
isAddress for Solana address validation, and fixes chainId-based
response narrowing in getCallsStatus.

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

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

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Base automatically changed from jake/v5/sol to v5.x.x May 8, 2026 23:42
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