[docs-agent] Add Solana getProgramAccountsV2 to JSON-RPC spec + CU pricing - #1587
[docs-agent] Add Solana getProgramAccountsV2 to JSON-RPC spec + CU pricing#1587alchemy-bot wants to merge 2 commits into
Conversation
…icing Adds the Helius-compatible `getProgramAccountsV2` method to the Alchemy Solana JSON-RPC surface: - `_components/solana/cluster-program.yaml`: new `GetProgramAccountsV2Config` schema (V1 fields plus `limit`, `paginationKey`, `changedSinceSlot`) - `_components/solana/account.yaml`: new `ProgramAccountsV2Page` + `ProgramAccountsV2Result` schemas; `result` shape depends on `withContext` - `_components/solana/methods.yaml`: new method definition (x-compute-units 20, x-rate-limit-cus 117, same rate-limit group as `getProgramAccounts`) - `chains/solana/solana.yaml`: reference the new method alongside `getProgramAccounts` - Compute Unit Costs page: add `getProgramAccountsV2` at 20 CU / 117 throughput CU, matching `getProgramAccounts` The CU pricing entry mirrors `getProgramAccounts` per the request. A companion PR on OMGWINNING/chain-config updates `topconfig_v2/solana.yml` so the pricing table stays consistent once Daikon regenerates the `cu:auto` block. Refs DOCS-212 Requested-by: @dimitriedavid
🔗 Preview Mode
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bf68189679
ℹ️ 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".
| unchanged; only the JSON shape of `result` differs. | ||
| encoding: | ||
| $ref: "./base-types.yaml#/components/schemas/Encoding" | ||
| default: json |
There was a problem hiding this comment.
Remove the unsupported
json encoding default
When generated documentation or a client applies this default, it will send encoding: "json", but the referenced Encoding schema permits only base58, base64, base64+zstd, and jsonParsed (base-types.yaml:23-27). Use a supported encoding as the default or omit the default so the new method does not advertise an invalid request value.
Useful? React with 👍 / 👎.
…nts + V2 Per follow-up on DOCS-212 Slack thread: both methods should use normal throughput (throughput CU defaults to the base CU). - Drop `x-rate-limit-cus: 117` from `getProgramAccounts` and `getProgramAccountsV2` in `_components/solana/methods.yaml`. - Clear the Throughput CU column for both rows in `compute-unit-costs.mdx` so they render blank (i.e., defaults to the 20 CU base cost per the Compute Units page). Companion chain-config PR (OMGWINNING/chain-config#7149) drops `rateLimitComputeUnits: 117` from the same two methods in `topconfig_v2/solana.yml` and the legacy `topconfig/topconfig.yml` (prod + staging in both layouts). The `rateLimitGroup: fragile:getProgramAccounts` grouping is untouched (the request was only to remove the throughput CU). If that group should also be removed, that's a separate one-liner. Refs DOCS-212 Requested-by: @dimitriedavid
Summary
Adds the Helius-compatible
getProgramAccountsV2method to the Alchemy Solana JSON-RPC surface, priced identically togetProgramAccounts(20 CU / 117 throughput CU per the request).Changes:
src/openrpc/chains/_components/solana/cluster-program.yaml— newGetProgramAccountsV2Configschema. Backward-compatible with V1 (commitment,minContextSlot,withContext,encoding,dataSlice,filters) plus new fields:limit(1-10,000, default 1000),paginationKey(base-58 cursor), andchangedSinceSlot.src/openrpc/chains/_components/solana/account.yaml— newProgramAccountsV2Page(accounts[]+ nullablepaginationKey) andProgramAccountsV2Result(oneOf: bare page whenwithContextis false or omitted, or{context, value}envelope whenwithContextis true).src/openrpc/chains/_components/solana/methods.yaml— newgetProgramAccountsV2method:x-compute-units: 20,x-rate-limit-cus: 117. Description covers the V2 additions (pagination, incremental updates viachangedSinceSlot, optional wrapped result). Example uses the SPL Token program withdataSize: 165filter (base64 encoding,limit: 1000) — the standard get-all-token-accounts pattern.src/openrpc/chains/solana/solana.yaml— referencegetProgramAccountsV2alongsidegetProgramAccounts.content/api-reference/pricing-resources/pricing/compute-unit-costs.mdx— addgetProgramAccountsV2row under the Solana Standard JSON-RPC block at 20 CU / 117 throughput CU (immediately aftergetProgramAccounts).Ran
pnpm run generate:rpcandpnpm run validate:rpc; both pass. The regeneratedcontent/api-specs/chains/solana.jsonincludes the new method and schemas.The CU costs table sits inside a
{/* cu:auto product="solana" */}block that Daikon regenerates fromtopconfig_v2/solana.ymlinOMGWINNING/chain-config. A companion PR on that repo (linked below) adds the matchinggetProgramAccountsV2entry so the manual row here stays consistent when Daikon next regenerates.Linear
DOCS-212 — https://linear.app/alchemyapi/issue/DOCS-212/add-solana-getprogramaccountsv2-to-json-rpc-spec-cu-costs
Companion PR
OMGWINNING/chain-configPR (coming in the next post) mirrors the same 20 CU / 117 rate-limit-CU /fragile:getProgramAccountsrate-limit group entry intopconfig_v2/solana.yml(prod + staging).Requested by
@dimitriedavid (via Slack thread)