Skip to content

[docs-agent] Add getBalanceByOwnerAtSlot method (Solana mainnet) - #1552

Open
alchemy-bot wants to merge 2 commits into
mainfrom
docs/getbalancebyowneratslot-solana
Open

[docs-agent] Add getBalanceByOwnerAtSlot method (Solana mainnet)#1552
alchemy-bot wants to merge 2 commits into
mainfrom
docs/getbalancebyowneratslot-solana

Conversation

@alchemy-bot

Copy link
Copy Markdown
Contributor

Summary

Adds documentation for a new Solana JSON-RPC method, getBalanceByOwnerAtSlot. Sibling of getTokenAccountsByOwnerAtSlot: returns a wallet's total balance of a single SPL Token / Token-2022 mint as of a specific slot, already summed across every token account the wallet held of that mint at that slot.

Available on Solana mainnet only.

Changes

  • src/openrpc/chains/_components/solana/methods.yaml — new getBalanceByOwnerAtSlot method definition, inserted directly after getTokenAccountsByOwnerAtSlot. Uses paramStructure: by-name (recommended object form) with four flat params: wallet (Pubkey, required, owner accepted as alias), mint (Pubkey, required), slot (integer, required, no "latest" default), scope (enum all / ata, default all, case-sensitive). Positional form [wallet, mint, slot, scope] documented in the method description.
  • src/openrpc/chains/_components/solana/account.yaml — new GetBalanceByOwnerAtSlotResult schema (wallet, mint, isNative, balance, balanceRaw, decimals, slot). balance and balanceRaw are strings so large values survive JSON parsing.
  • src/openrpc/chains/solana/solana.yaml — add $ref under methods: and append getBalanceByOwnerAtSlot to x-bot-ignore so Daikon does not strip the entry on its next sync.
  • content/api-reference/solana/solana-api-overview.mdx — new table row inserted alphabetically between getBalance and getBlock. The table is now 29 rows × 2 columns, no empty cells.

Errors documented per the spec: -32602 (invalid params — malformed wallet/mint, missing/non-integer slot, unknown scope, mint not indexed), -32600 (unsupported method — chain other than Solana mainnet), -32603 (internal error).

Validation

  • pnpm run generate:rpc — All OpenRPC specs generated successfully.
  • pnpm run validate:rpc — chains + json-rpc specs both green.
  • npx prettier --check on the four modified files — all clean.

Open question

I omitted x-compute-units on the method because the CU value lives in the private chain-config topconfig and I don't have that number. Sibling getBalance is 10, sibling getTokenAccountsByOwnerAtSlot is 40 — happy to add the correct value in a follow-up commit once someone with topconfig access shares it.

Linear

DOCS-200 — Add getBalanceByOwnerAtSlot documentation (Solana mainnet)

Requested by

@andreidg31 (via Slack thread)

New Solana JSON-RPC method that returns a wallet's aggregated balance of a single SPL Token or Token-2022 mint at a specific slot, sibling of getTokenAccountsByOwnerAtSlot.

- Add getBalanceByOwnerAtSlot method definition to _components/solana/methods.yaml with paramStructure: by-name.
- Add GetBalanceByOwnerAtSlotResult schema to _components/solana/account.yaml.
- Wire the method into solana.yaml under methods: and add it to x-bot-ignore so Daikon does not strip it.
- Add a table row to the Solana API overview page linking to the auto-generated endpoint page.

Refs DOCS-200

Requested-by: @andreidg31
@alchemy-bot
alchemy-bot requested a review from a team as a code owner August 21, 2026 13:01
@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown

🔗 Preview Mode

Name Status Preview Updated (UTC)
Alchemy Docs ✅ Ready 🔗 Visit Preview Aug 21, 2026, 1:14 PM

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5551bbccfc

ℹ️ 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".

Comment on lines +323 to +324
getBalanceByOwnerAtSlot:
name: getBalanceByOwnerAtSlot

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Document the method's compute-unit cost

When this endpoint is published, it will be the only one of the 84 Solana method definitions without x-compute-units; consequently, consumers that build billing or throughput metadata from the generated OpenRPC spec cannot report the cost of this method even though its requests consume CUs. Obtain the canonical value from the chain configuration and add the extension before publishing the endpoint.

Useful? React with 👍 / 👎.

Andrei confirmed the CU cost in the Slack thread; matches the sibling getTokenAccountsByOwnerAtSlot.

Refs DOCS-200

Requested-by: @andreidg31
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