[docs-agent] Document Solana getBalanceByOwnerAtSlot method - #1551
[docs-agent] Document Solana getBalanceByOwnerAtSlot method#1551alchemy-bot wants to merge 1 commit into
Conversation
Adds an OpenRPC definition for the new Solana JSON-RPC method `getBalanceByOwnerAtSlot`, the aggregate counterpart to `getTokenAccountsByOwnerAtSlot`. It returns a wallet's summed balance of one SPL Token or Token-2022 mint at a specific slot, with an optional `scope` parameter (all | ata) selecting between the wallet-wide sum and its canonical Associated Token Account. - Method definition in `src/openrpc/chains/_components/solana/methods.yaml` - `GetBalanceByOwnerAtSlotScope` and `GetBalanceByOwnerAtSlotResult` schemas in `src/openrpc/chains/_components/solana/account.yaml` - `$ref` registration and `x-bot-ignore` entry in `src/openrpc/chains/solana/solana.yaml` - Table link in `content/api-reference/solana/solana-api-overview.mdx` Refs DOCS-199 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: 8c7e912f75
ℹ️ 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".
| For a wallet holding a single token account of the mint, both | ||
| scopes return the same value. For a wallet holding many, they | ||
| can differ by orders of magnitude. |
There was a problem hiding this comment.
Qualify the single-account equivalence claim
Qualify this statement to require that the sole token account is the wallet's canonical ATA. If the wallet's only account for the mint is an auxiliary or legacy non-ATA account, all includes its balance while ata resolves the separate canonical address and can return zero or a different value, so the current guidance may lead callers to choose the faster scope and receive an incomplete balance.
Useful? React with 👍 / 👎.
Summary
Adds an OpenRPC definition for the new Solana JSON-RPC method
getBalanceByOwnerAtSlot, the aggregate counterpart togetTokenAccountsByOwnerAtSlot. It returns a wallet's summed balance of one SPL Token or Token-2022 mint at a specific slot, with an optionalscopeparameter selecting between:all(default): sum across every token account the wallet held of that mint at that slot (portfolio value, cost basis, PnL, tax reporting, treasury reconciliation)ata: the canonical Associated Token Account only, faster because it resolves one derived address instead of aggregatingUnlike
getTokenAccountsByOwnerAtSlot, there is no "latest slot" default: omittingslotis an error. The method accepts either an object (recommended) or a positional array[wallet, mint, slot, scope], and thewalletfield also acceptsowneras an alias in the object form.Changes
src/openrpc/chains/_components/solana/methods.yaml(params, description, example, result, errors)src/openrpc/chains/_components/solana/account.yaml:GetBalanceByOwnerAtSlotScope(string enumall|ata, defaultall, case-sensitive)GetBalanceByOwnerAtSlotResult(wallet,mint,isNative,balance,balanceRaw,decimals,slot)src/openrpc/chains/solana/solana.yaml:$refadded right aftergetTokenAccountsByOwnerAtSlotgetBalanceByOwnerAtSlotadded tox-bot-ignoreso Daikon does not strip it before the upstream chain-config catches upcontent/api-reference/solana/solana-api-overview.mdx: link added alphabetically to the method table (which is now re-flowed to keep two columns per row while preserving alphabetical ordering)Validation
pnpm run generate:rpc— cleanpnpm run validate:rpc— clean (✅ Successfully validated chains OpenRPC specs)pnpm run lint:prettier— clean on new filescontent/api-specs/chains/solana.jsonincludesgetBalanceByOwnerAtSlotwithparams: [wallet, mint, slot, scope], required[wallet, mint, slot], and the example result matches the requester's specLinear
DOCS-199 — https://linear.app/alchemyapi/issue/DOCS-199/document-new-solana-method-getbalancebyowneratslot
Requested by
@andreidg31 (via Slack thread)