Repository navigation
refactor: use explicit named RPC types instead of derived types - #265
Conversation
…unts as Rpc<GetMultipleAccountsApi>
…ms instead of derived types
|
Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
⛔ Files ignored due to path filters: 1
📒 Files selected for processing: 11
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Reviewer's GuideThis refactor standardizes RPC, transaction, commitment, and address annotations on named exports from the Solana and project packages, including a new explicit RPC API type for the batch accounts loader and its associated peer dependencies. The changes are type-only and should not alter runtime behavior; review primarily for type compatibility, dependency correctness, and preservation of intentionally narrower types. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
grill-example-dapp | 3461ae8 | Commit Preview URL Branch Preview URL |
Oct 12 2026, 11:12 AM |
Replaces derived types (
Parameters<typeof ...>,ReturnType<typeof ...>, inline literal unions) with the named types the granular@solana/*packages and our own packages already export.Changed
RpcWithGetMultipleAccounts:Parameters<typeof import("@solana/accounts").fetchEncodedAccounts>[0]→Rpc<GetMultipleAccountsApi>. The shape is the same;@solana/accountsjust doesn't export itsGetMultipleAccountsApi. Adds@solana/rpc-apiand@solana/rpc-specas peer and dev deps, which is why this is a minor bump. Type-checked against a full kit rpc (grill-headless-provider) and againstfetchEncodedAccounts(gill-extra/fetch-token-info-for-mint).prepare-transaction-message,create-sign-tx,create-send-txand their tests:ReturnType<typeof simulateTransactionFactory>→SimulateTransactionFunction(already exported by gill-extra).create-send-tx.test.ts:Partial<Parameters<typeof createSendTX>[0]>→Partial<CreateSendTXParams>.confirm-transaction.test.ts:"processed" | "confirmed" | "finalized" | null→Commitment | null.token-balances.tsx:ReturnType<typeof address>→Address.Left alone
BatchAccountsLoaderConfig.commitment: "confirmed" | "finalized":Commitmentwould also allow"processed", which widens the public type.SimulateTransactionConfig/SimulateTransactionFunction, which index intoSimulateTransactionApi["simulateTransaction"]: rpc-api doesn't export the config or response types.createDasRpcconfig,Parameters<typeof createDefaultRpcTransport<TClusterUrl>>[0]:DefaultRpcTransportConfigisn't exported from@solana/rpc.Parameters<RpcTransport>[0]: the transport request config type isn't exported from@solana/rpc-spec.ConfirmedTransaction: derived from our owngetConfirmedTransaction, and rpc-api has no named jsonParsed transaction response type.GillUseQueryDefaultOptions,Parameters<typeof useQuery>[0]: this is TanStack, not Solana, and switching toUseQueryOptionscould change how generic defaults resolve.Summary by Sourcery
Adopt explicit exported types across RPC-related APIs and examples to improve type clarity and maintainability without changing runtime behavior.
Enhancements:
Build: