[docs-agent] Document Solana getTokenAccountsByOwnerAtSlot method#1444
[docs-agent] Document Solana getTokenAccountsByOwnerAtSlot method#1444alchemy-bot wants to merge 2 commits into
Conversation
Adds an OpenRPC definition for Alchemy's new Solana JSON-RPC method `getTokenAccountsByOwnerAtSlot`, plus the config/result schemas, an alphabetized overview-table row, and an `x-bot-ignore` guard so Daikon won't strip the method until `topconfig.yml` in chain-config lists it. The method returns every SPL Token and Token-2022 account owned by a wallet as of a specific slot; if `slot` is omitted it returns the wallet's current holdings. Includes `pageKey`/`pageLimit` pagination. The 40 CU cost is set on the method definition (`x-compute-units: 40`) but the Solana Standard JSON-RPC pricing table (`content/api-reference/pricing-resources/pricing/compute-unit-costs.mdx`) is Daikon-managed via `cu:auto` markers (PRs #1424 + #1425), so that row will populate on Daikon's next daily run once the value lands in `topconfig.yml` upstream. Refs DOCS-137 Requested-by: @andreidg31
🔗 Preview Mode
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 24936723aa
ℹ️ 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".
| type: array | ||
| description: The token accounts the wallet held at that slot. | ||
| items: | ||
| $ref: "#/components/schemas/TokenAccount" |
There was a problem hiding this comment.
Fix parsed token account response schema
For this new method the description says responses are always jsonParsed, and the example returns account.data as an object with program, space, and parsed. Reusing TokenAccount here points generated docs/clients at AccountInfo, whose data is a string array and whose size field is named size, so every successful getTokenAccountsByOwnerAtSlot response is documented with the wrong account shape. Please add/use a parsed token-account schema for this result instead of the generic encoded TokenAccount.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in a5f7cba. Since the method returns jsonParsed responses only (per the description and example), reusing the generic TokenAccount / AccountInfo was wrong: data should be an object with program / space / parsed, not a base64 string array, and the account-metadata field is named space, not size.
Added four schemas — ParsedTokenAccount, ParsedTokenAccountInfo, ParsedSplTokenAccountData, ParsedSplTokenAccountInfo — reusing the existing TokenBalance schema for tokenAmount, and pointed GetTokenAccountsByOwnerAtSlotResult.value.items at ParsedTokenAccount. generate:rpc + validate:rpc pass.
…ountsByOwnerAtSlot The method returns `jsonParsed` responses (per its description and example), where `account.data` is an object with `program` / `space` / `parsed` and the account metadata field is named `space` (not `size`). The previous schema reused the generic `TokenAccount` / `AccountInfo`, which types `data` as a base64 string array and names the size field `size` — every successful response was documented with the wrong account shape. Adds parsed-token-account schemas (`ParsedTokenAccount`, `ParsedTokenAccountInfo`, `ParsedSplTokenAccountData`, `ParsedSplTokenAccountInfo`) that match the actual `jsonParsed` payload, and points `GetTokenAccountsByOwnerAtSlotResult.value.items` at the new `ParsedTokenAccount` schema. The existing `TokenBalance` schema is reused for `tokenAmount`. `generate:rpc` + `validate:rpc` pass. Addresses Codex review on PR #1444. Refs DOCS-137 Requested-by: @andreidg31
Summary
Adds documentation for Alchemy's new Solana JSON-RPC method
getTokenAccountsByOwnerAtSlot: the historical, point-in-time version ofgetTokenAccountsByOwner. Same inputs plus an optionalslotto look up past state andpageKey/pageLimitto page through large wallets.Changes
src/openrpc/chains/_components/solana/methods.yaml— full OpenRPC method definition (params, result, example, errors,x-compute-units: 40).src/openrpc/chains/_components/solana/account.yaml— three new schemas:GetTokenAccountsByOwnerAtSlotFilter,GetTokenAccountsByOwnerAtSlotConfig,GetTokenAccountsByOwnerAtSlotResult.src/openrpc/chains/solana/solana.yaml— new$refin alphabetical position, plusx-bot-ignoreentry to protect the method untiltopconfig.ymlinOMGWINNING/chain-configlists it.content/api-reference/solana/solana-api-overview.mdx— alphabetized table row, remaining rows shifted so the table stays sorted.Not touching
content/api-reference/pricing-resources/pricing/compute-unit-costs.mdx: the Solana Standard JSON-RPC table is Daikon-managed viacu:automarkers (see PRs #1424 + #1425). The 40 CU cost for this method needs to be added totopconfig.ymlinOMGWINNING/chain-configfor it to render on the pricing page on Daikon's next daily 12 PM EST run.Validation
pnpm run generate:rpc— succeeded.pnpm run validate:rpc— passed both json-rpc and chains OpenRPC specs.npx prettier --checkon all four changed files — clean.content/api-specs/chains/solana.jsonincludes the method with 3 params, 3 errors, 1 example (withresult.valuepopulated so Fern's Response panel renders real data), andx-compute-units: 40.Linear
DOCS-137
Requested by
@andreidg31 (via Slack thread)