跳转到主要内容
POST
使用标准的 getMultipleAccounts 方法读取最多 100 个账户过去的状态。在配置对象中添加以下其中一项:
  • slot:每个账户在该 slot 结束时的状态。
  • lastUpdateBeforeSlot:每个账户在该 slot 之前(不含)各自最后一次更新后的状态。
  • firstUpdateAfterSlot:每个账户在该 slot 之后(不含)各自第一次更新后的状态。
只能设置其中一项。都不设置时,getMultipleAccounts 返回账户的当前状态,见 getMultipleAccounts。 结果按输入顺序返回。使用 lastUpdateBeforeSlot 和 firstUpdateAfterSlot 时,各账户可能来自不同的 slot,因此结果会增加 slots:每个账户一个 slot,按输入顺序排列;账户在该方向没有更新时为 null。

限制

  • 历史读取返回 finalized 数据。commitment 会被忽略,minContextSlot 不能与这些选项同时使用。
  • 账户在该时间点不存在或已关闭,或没有可用数据时,value 中对应项为 null。
  • SPL Token 和 Token-2022 的 mint 账户无法按历史读取:返回错误 -32033,data.reason 为 "splTokenMint",只要有一个这样的地址,整个请求就会失败。Stake、vote、config 和 sysvar 账户也返回 -32033。
  • 代币账户根据其余额历史重建。会返回余额、mint、所有者和租金 lamports;不返回 Token-2022 扩展、委托人、冻结状态、关闭权限和精确的 space。
  • 晚于最新可用 slot 的 slot 返回 -32030,早于最早可用 slot 的返回 -32031,没有可用数据的 slot 返回 -32034。lastUpdateBeforeSlot 或 firstUpdateAfterSlot 遍历超过第一次或最后一次已知更新时返回 -32020。
  • dataSlice 不能与 jsonParsed 或 jsonParsedEnhanced 同时使用。
一次历史读取消耗 1 积分,与实时调用相同。要遍历单个账户的历史并获取更早版本,请使用历史 getAccountInfo。 请求配置和错误处理见 RPC 快速入门。计费见积分与限制。

授权

api_key
string
query
必填

请求体

application/json
jsonrpc
enum<string>
默认值:2.0
必填

The JSON-RPC protocol version.

可用选项:
2.0
示例:

"2.0"

id
string
默认值:1
必填

A unique identifier for the request.

示例:

"1"

method
enum<string>
默认值:getMultipleAccounts
必填

The name of the RPC method to invoke.

可用选项:
getMultipleAccounts
示例:

"getMultipleAccounts"

params
(string[] | object)[]
必填

Parameters for the method.

Minimum array length: 2

Array of Solana account addresses (up to 100) to fetch in a single optimized batch request.

示例:

响应

Successfully retrieved the account details.

jsonrpc
enum<string>

The JSON-RPC protocol version.

可用选项:
2.0
示例:

"2.0"

id
string

Identifier matching the request.

示例:

"1"

result
object

Accounts information with context.